aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-06-21 12:44:26 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-21 12:44:28 +0000
commit960d421fb98f9e08ec6efb380607b54a7cf72f95 (patch)
tree5c5ce63f7b25896b6c9ac292cc931f83a2c1c502 /tests
parentb1a6e65c9be5794d86e2d02994b87e83f566270a (diff)
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 <herb@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> 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 <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/SkRemoteGlyphCacheTest.cpp25
1 files changed, 9 insertions, 16 deletions
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<SkScalerContextProxy*>(testCache->getScalerContext());
- scalerProxy->initCache(testCache.get(), &strikeCache);
+ static_cast<SkScalerContextProxy*>(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<uint8_t> 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);