From 960d421fb98f9e08ec6efb380607b54a7cf72f95 Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Thu, 21 Jun 2018 12:44:26 +0000 Subject: Revert "Make SkRemoteGlyphCache tests use private glyph cache" This reverts commit 3e36ce6e660ad585c58c5cc5591f23a46fcab767. Reason for revert: Too much verification Original change's description: > Make SkRemoteGlyphCache tests use private glyph cache > > Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f > Reviewed-on: https://skia-review.googlesource.com/136225 > Commit-Queue: Herb Derby > Reviewed-by: Mike Klein TBR=mtklein@google.com,herb@google.com Change-Id: Ia0c096abd0ab651bc7c907f0595af4f07c88fb5e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/136478 Reviewed-by: Herb Derby Commit-Queue: Herb Derby --- tests/SkRemoteGlyphCacheTest.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/SkRemoteGlyphCacheTest.cpp b/tests/SkRemoteGlyphCacheTest.cpp index 6dc79a7dd5..8bdfb7af69 100644 --- a/tests/SkRemoteGlyphCacheTest.cpp +++ b/tests/SkRemoteGlyphCacheTest.cpp @@ -428,8 +428,6 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { auto lostGlyphID = SkPackedGlyphID(1, SK_FixedHalf, SK_FixedHalf); const uint8_t glyphImage[] = {0xFF, 0xFF}; - SkStrikeCache strikeCache; - // Build a fallback cache. { SkAutoDescriptor ad; @@ -439,7 +437,7 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { SkScalerContext::MakeRecAndEffects(paint, nullptr, nullptr, flags, &rec, &effects, false); auto desc = SkScalerContext::AutoDescriptorGivenRecAndEffects(rec, effects, &ad); - auto fallbackCache = strikeCache.findOrCreateStrikeExclusive(*desc, effects, *clientTf); + auto fallbackCache = SkStrikeCache::FindOrCreateStrikeExclusive(*desc, effects, *clientTf); auto glyph = fallbackCache->getRawGlyphByID(lostGlyphID); glyph->fMaskFormat = SkMask::kA8_Format; glyph->fHeight = 1; @@ -456,7 +454,7 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { SkScalerContextFlags flags = SkScalerContextFlags::kFakeGammaAndBoostContrast; SkScalerContext::MakeRecAndEffects(paint, nullptr, nullptr, flags, &rec, &effects, false); auto desc = SkScalerContext::AutoDescriptorGivenRecAndEffects(rec, effects, &ad); - auto testCache = strikeCache.findStrikeExclusive(*desc); + auto testCache = SkStrikeCache::FindStrikeExclusive(*desc); REPORTER_ASSERT(reporter, !(testCache == nullptr)); } @@ -468,12 +466,11 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { SkScalerContextFlags flags = SkScalerContextFlags::kNone; SkScalerContext::MakeRecAndEffects(paint, nullptr, nullptr, flags, &rec, &effects, false); auto desc = SkScalerContext::AutoDescriptorGivenRecAndEffects(rec, effects, &ad); - testCache = strikeCache.findStrikeExclusive(*desc); + testCache = SkStrikeCache::FindStrikeExclusive(*desc); REPORTER_ASSERT(reporter, testCache == nullptr); - testCache = strikeCache.createStrikeExclusive(*desc, + testCache = SkStrikeCache::CreateStrikeExclusive(*desc, clientTf->createScalerContext(effects, desc)); - auto scalerProxy = static_cast(testCache->getScalerContext()); - scalerProxy->initCache(testCache.get(), &strikeCache); + static_cast(testCache->getScalerContext())->initCache(testCache.get()); // Look for the lost glyph. { @@ -507,7 +504,7 @@ DEF_TEST(SkRemoteGlyphCache_SearchOfDesperation, reporter) { REPORTER_ASSERT(reporter, discardableManager->cacheMissCount(i) == 0); } } - strikeCache.internalValidate(); + SkStrikeCache::Validate(); // Must unlock everything on termination, otherwise valgrind complains about memory leaks. discardableManager->unlockAndDeleteAll(); @@ -533,8 +530,6 @@ DEF_TEST(SkRemoteGlyphCache_ReWriteGlyph, reporter) { uint32_t realMask; uint32_t fakeMask; - SkStrikeCache strikeCache; - { SkAutoDescriptor ad; SkScalerContextRec rec; @@ -562,7 +557,7 @@ DEF_TEST(SkRemoteGlyphCache_ReWriteGlyph, reporter) { SkScalerContext::MakeRecAndEffects(paint, nullptr, nullptr, flags, &rec, &effects, false); auto desc = SkScalerContext::AutoDescriptorGivenRecAndEffects(rec, effects, &ad); - auto fallbackCache = strikeCache.findOrCreateStrikeExclusive(*desc, effects, *clientTf); + auto fallbackCache = SkStrikeCache::FindOrCreateStrikeExclusive(*desc, effects, *clientTf); auto glyph = fallbackCache->getRawGlyphByID(lostGlyphID); fakeMask = (realMask == SkMask::kA8_Format) ? SkMask::kBW_Format : SkMask::kA8_Format; glyph->fMaskFormat = fakeMask; @@ -584,9 +579,7 @@ DEF_TEST(SkRemoteGlyphCache_ReWriteGlyph, reporter) { std::vector serverStrikeData; server.writeStrikeData(&serverStrikeData); REPORTER_ASSERT(reporter, - client.readStrikeData( - serverStrikeData.data(), - serverStrikeData.size())); + client.readStrikeData(serverStrikeData.data(), serverStrikeData.size())); } { @@ -598,7 +591,7 @@ DEF_TEST(SkRemoteGlyphCache_ReWriteGlyph, reporter) { SkScalerContext::MakeRecAndEffects(paint, nullptr, nullptr, flags, &rec, &effects, false); auto desc = SkScalerContext::AutoDescriptorGivenRecAndEffects(rec, effects, &ad); - auto fallbackCache = strikeCache.findStrikeExclusive(*desc); + auto fallbackCache = SkStrikeCache::FindStrikeExclusive(*desc); REPORTER_ASSERT(reporter, fallbackCache.get() != nullptr); auto glyph = fallbackCache->getRawGlyphByID(lostGlyphID); REPORTER_ASSERT(reporter, glyph->fMaskFormat == fakeMask); -- cgit v1.2.3