Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: tests/GpuLayerCacheTest.cpp

Issue 753253002: Use variable length key (rather than accumulated matrix) as save layer hoisting key (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Compiling Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/GpuLayerCacheTest.cpp
diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp
index 1043a208f5c74312931bd451e85260d0b58c5d16..083c97508de870f6e9ca8fb18f531a8573a7fb5a 100644
--- a/tests/GpuLayerCacheTest.cpp
+++ b/tests/GpuLayerCacheTest.cpp
@@ -34,14 +34,16 @@ static void create_layers(skiatest::Reporter* reporter,
int idOffset) {
for (int i = 0; i < numToAdd; ++i) {
+ int foo[2] = { picture.uniqueID(), idOffset+i+1 };
GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(),
idOffset+i+1, idOffset+i+2,
SkIRect::MakeEmpty(),
SkMatrix::I(),
+ foo, 2,
NULL);
REPORTER_ASSERT(reporter, layer);
GrCachedLayer* temp = cache->findLayer(picture.uniqueID(), idOffset + i + 1,
- SkIRect::MakeEmpty(), SkMatrix::I());
+ SkIRect::MakeEmpty(), SkMatrix::I(), foo, 2);
REPORTER_ASSERT(reporter, temp == layer);
REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset + i + 1);
@@ -111,8 +113,9 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
create_layers(reporter, &cache, *picture, kInitialNumLayers, 0);
for (int i = 0; i < kInitialNumLayers; ++i) {
- GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1,
- SkIRect::MakeEmpty(), SkMatrix::I());
+ int foo[2] = { picture->uniqueID(), i + 1 };
+ GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i + 1,
+ SkIRect::MakeEmpty(), SkMatrix::I(), foo, 2);
REPORTER_ASSERT(reporter, layer);
lock_layer(reporter, &cache, layer);
@@ -129,15 +132,19 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
// Unlock the textures
for (int i = 0; i < kInitialNumLayers; ++i) {
+ int foo[2] = { picture->uniqueID(), i+1 };
+
GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1,
- SkIRect::MakeEmpty(), SkMatrix::I());
+ SkIRect::MakeEmpty(), SkMatrix::I(), foo, 2);
REPORTER_ASSERT(reporter, layer);
cache.removeUse(layer);
}
for (int i = 0; i < kInitialNumLayers; ++i) {
+ int foo[2] = { picture->uniqueID(), i+1 };
+
GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1,
- SkIRect::MakeEmpty(), SkMatrix::I());
+ SkIRect::MakeEmpty(), SkMatrix::I(), foo, 2);
REPORTER_ASSERT(reporter, layer);
// All the layers should be unlocked
@@ -161,12 +168,14 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
}
{
+ int foo[2] = { picture->uniqueID(), kInitialNumLayers+1 };
+
// Add an additional layer. Since all the layers are unlocked this
// will force out the first atlased layer
create_layers(reporter, &cache, *picture, 1, kInitialNumLayers);
GrCachedLayer* layer = cache.findLayer(picture->uniqueID(),
kInitialNumLayers+1,
- SkIRect::MakeEmpty(), SkMatrix::I());
+ SkIRect::MakeEmpty(), SkMatrix::I(), foo, 2);
REPORTER_ASSERT(reporter, layer);
lock_layer(reporter, &cache, layer);
@@ -174,8 +183,10 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
}
for (int i = 0; i < kInitialNumLayers+1; ++i) {
- GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i + 1,
- SkIRect::MakeEmpty(), SkMatrix::I());
+ int foo[2] = { picture->uniqueID(), i+1 };
+
+ GrCachedLayer* layer = cache.findLayer(picture->uniqueID(), i+1,
+ SkIRect::MakeEmpty(), SkMatrix::I(), foo, 2);
#if GR_CACHE_HOISTED_LAYERS
// 3 old layers plus the new one should be in the atlas.
if (1 == i || 2 == i || 3 == i || 5 == i) {

Powered by Google App Engine
This is Rietveld 408576698