aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-09-07 10:02:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-07 10:02:04 -0700
commitb77a907c2fb4402b7e70e9fff70eb71482354e67 (patch)
tree692acfaad6a575969ceb547d617aa6bfcbc7a4d8 /tests
parent5edf2908a305d3365a1574a8358343bb26468b35 (diff)
Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache.
Consolidates all flush actions into GrDrawingManager and makes GrContext::flush a passthrough. Removes the unused and untested discard flush variation. Replaces the indirect overbudget callback mechanism of GrResourceCache with a flag set by resource cache when it wants to flush that is checked after each draw by GrDrawContext. Modifies GrResourceCache::notifyFlushOccurred() to take a param indicating whether it triggered the flush that just occurred. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2307053002 Committed: https://skia.googlesource.com/skia/+/1dbb207babecdae8f1f74ed9d9900c73064df744 Review-Url: https://codereview.chromium.org/2307053002
Diffstat (limited to 'tests')
-rw-r--r--tests/ResourceCacheTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 2cbf81c231..b568485e4b 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -1133,7 +1133,7 @@ static void test_flush(skiatest::Reporter* reporter) {
make_unique_key<1>(&k, i);
r->resourcePriv().setUniqueKey(k);
r->unref();
- cache->notifyFlushOccurred();
+ cache->notifyFlushOccurred(GrResourceCache::kExternal);
}
// Send flush notifications to the cache. Each flush should purge the oldest resource.
@@ -1147,7 +1147,7 @@ static void test_flush(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, !SkToBool(r));
SkSafeUnref(r);
}
- cache->notifyFlushOccurred();
+ cache->notifyFlushOccurred(GrResourceCache::kExternal);
}
REPORTER_ASSERT(reporter, 0 == cache->getResourceCount());
@@ -1169,13 +1169,13 @@ static void test_flush(skiatest::Reporter* reporter) {
} else {
r->unref();
}
- cache->notifyFlushOccurred();
+ cache->notifyFlushOccurred(GrResourceCache::kExternal);
}
for (int i = 0; i < kFlushCount; ++i) {
// Should get a resource purged every other flush.
REPORTER_ASSERT(reporter, kFlushCount - i/2 - 1 == cache->getResourceCount());
- cache->notifyFlushOccurred();
+ cache->notifyFlushOccurred(GrResourceCache::kExternal);
}
// Unref all the resources that we kept refs on in the first loop.
@@ -1187,7 +1187,7 @@ static void test_flush(skiatest::Reporter* reporter) {
// get kFlushCount additional flushes. Then everything should be purged.
for (int i = 0; i < kFlushCount; ++i) {
REPORTER_ASSERT(reporter, kFlushCount >> 1 == cache->getResourceCount());
- cache->notifyFlushOccurred();
+ cache->notifyFlushOccurred(GrResourceCache::kExternal);
}
REPORTER_ASSERT(reporter, 0 == cache->getResourceCount());