aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GpuLayerCacheTest.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-12-03 07:33:57 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-03 07:33:57 -0800
commite99d499caa7dbc80b58e0faf5ce137e7d30cc5d0 (patch)
tree51fbc4f33ad173c3504998826e6333d99cb67f3f /tests/GpuLayerCacheTest.cpp
parent2dd1ae016d7f297b433c3ea3a771ef8e01657c1f (diff)
Fuse GrReplacements and GrLayerCache
The conversion step from GrCachedLayer to ReplacementInfo isn't necessary. Review URL: https://codereview.chromium.org/769533004
Diffstat (limited to 'tests/GpuLayerCacheTest.cpp')
-rw-r--r--tests/GpuLayerCacheTest.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp
index 43a845b11d..cba331f8b4 100644
--- a/tests/GpuLayerCacheTest.cpp
+++ b/tests/GpuLayerCacheTest.cpp
@@ -15,7 +15,7 @@
class TestingAccess {
public:
- static int NumLayers(GrLayerCache* cache) {
+ static unsigned NumLayers(GrLayerCache* cache) {
return cache->numLayers();
}
static void Purge(GrLayerCache* cache, uint32_t pictureID) {
@@ -25,7 +25,8 @@ public:
return layer->uses();
}
static GrCachedLayer* Find(GrLayerCache* cache, uint32_t pictureID,
- const SkMatrix& initialMat, const int* key, int keySize) {
+ const SkMatrix& initialMat,
+ const unsigned* key, int keySize) {
return cache->findLayer(pictureID, initialMat, key, keySize);
}
};
@@ -34,11 +35,11 @@ public:
static void create_layers(skiatest::Reporter* reporter,
GrLayerCache* cache,
const SkPicture& picture,
- int numToAdd,
- int idOffset) {
+ unsigned numToAdd,
+ unsigned idOffset) {
- for (int i = 0; i < numToAdd; ++i) {
- int indices[1] = { idOffset+i+1 };
+ for (unsigned i = 0; i < numToAdd; ++i) {
+ unsigned indices[1] = { idOffset+i+1 };
GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(),
idOffset+i+1, idOffset+i+2,
SkIRect::MakeEmpty(),
@@ -116,8 +117,8 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
create_layers(reporter, &cache, *picture, kInitialNumLayers, 0);
- for (int i = 0; i < kInitialNumLayers; ++i) {
- int indices[1] = { i + 1 };
+ for (unsigned i = 0; i < kInitialNumLayers; ++i) {
+ unsigned indices[1] = { i + 1 };
GrCachedLayer* layer = TestingAccess::Find(&cache, picture->uniqueID(), SkMatrix::I(),
indices, 1);
REPORTER_ASSERT(reporter, layer);
@@ -135,8 +136,8 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
}
// Unlock the textures
- for (int i = 0; i < kInitialNumLayers; ++i) {
- int indices[1] = { i+1 };
+ for (unsigned i = 0; i < kInitialNumLayers; ++i) {
+ unsigned indices[1] = { i+1 };
GrCachedLayer* layer = TestingAccess::Find(&cache, picture->uniqueID(), SkMatrix::I(),
indices, 1);
@@ -144,8 +145,8 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
cache.removeUse(layer);
}
- for (int i = 0; i < kInitialNumLayers; ++i) {
- int indices[1] = { i+1 };
+ for (unsigned i = 0; i < kInitialNumLayers; ++i) {
+ unsigned indices[1] = { i+1 };
GrCachedLayer* layer = TestingAccess::Find(&cache, picture->uniqueID(), SkMatrix::I(),
indices, 1);
@@ -172,7 +173,7 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
}
{
- int indices[1] = { kInitialNumLayers+1 };
+ unsigned indices[1] = { kInitialNumLayers+1 };
// Add an additional layer. Since all the layers are unlocked this
// will force out the first atlased layer
@@ -185,8 +186,8 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
cache.removeUse(layer);
}
- for (int i = 0; i < kInitialNumLayers+1; ++i) {
- int indices[1] = { i+1 };
+ for (unsigned i = 0; i < kInitialNumLayers+1; ++i) {
+ unsigned indices[1] = { i+1 };
GrCachedLayer* layer = TestingAccess::Find(&cache, picture->uniqueID(), SkMatrix::I(),
indices, 1);