diff options
author | Herb Derby <herb@google.com> | 2018-03-09 12:21:56 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-09 19:32:22 +0000 |
commit | d49665513b507b67ab8136259a48c36523364beb (patch) | |
tree | 0e64ffea1549aa5b7c3ea6614619eb3ad66a00a8 /tests | |
parent | b07fd4d7fb701b70668eefd7f1be46d9c1fbd554 (diff) |
Remove TLS glyph cache calls.
Change-Id: Iafeb02d395cac81e8fe6d74c989a37607503919c
Reviewed-on: https://skia-review.googlesource.com/113208
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathOpsThreadedCommon.h | 1 | ||||
-rw-r--r-- | tests/TLSTest.cpp | 68 |
2 files changed, 0 insertions, 69 deletions
diff --git a/tests/PathOpsThreadedCommon.h b/tests/PathOpsThreadedCommon.h index 706da6b110..b47af531ad 100644 --- a/tests/PathOpsThreadedCommon.h +++ b/tests/PathOpsThreadedCommon.h @@ -83,7 +83,6 @@ public: void operator()() { SkBitmap bitmap; fState.fBitmap = &bitmap; - SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); (*fTestFun)(&fState); } diff --git a/tests/TLSTest.cpp b/tests/TLSTest.cpp deleted file mode 100644 index 0fadd7ed9c..0000000000 --- a/tests/TLSTest.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2012 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkGraphics.h" -#include "SkPaint.h" -#include "SkTLS.h" -#include "Test.h" -#include <atomic> -#include <thread> - -static void thread_main() { - SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); - - const char text[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - size_t len = strlen(text); - - SkPaint paint; - - for (int j = 0; j < 10; ++j) { - for (int i = 9; i <= 48; ++i) { - paint.setTextSize(SkIntToScalar(i)); - paint.setAntiAlias(false); - paint.measureText(text, len); - paint.setAntiAlias(true); - paint.measureText(text, len); - } - } -} - -template <typename Fn> -static void test_threads(Fn fn) { - std::thread threads[8]; - - for (auto& thread : threads) { - thread = std::thread(fn); - } - for (auto& thread : threads) { - thread.join(); - } -} - -static std::atomic<int> gCounter{0}; - -static void* fake_create_TLS() { - gCounter++; - return nullptr; -} -static void fake_delete_TLS(void*) { - gCounter--; -} - -DEF_TEST(TLS, reporter) { - // TODO: Disabled for now to work around - // http://code.google.com/p/skia/issues/detail?id=619 - // ('flaky segfault in TLS test on Shuttle_Ubuntu12 buildbots') - if( false ) test_threads(&thread_main); - - // Test to ensure that at thread destruction, TLS destructors - // have been called. - test_threads([] { - SkTLS::Get(fake_create_TLS, fake_delete_TLS); - }); - REPORTER_ASSERT(reporter, 0 == gCounter.load()); -} |