From 09dde64628fcbf611891fa293c144835c7dfa644 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Tue, 29 Jul 2014 07:14:49 -0700 Subject: [PATCH] Now always use Atlas for layer cache This is setup for running cluster telemetry tests R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/429593002 --- src/gpu/GrLayerCache.cpp | 2 -- src/gpu/GrLayerCache.h | 2 -- tests/GpuLayerCacheTest.cpp | 12 ------------ 3 files changed, 16 deletions(-) diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp index 2a57dccb4c..58994790b7 100644 --- a/src/gpu/GrLayerCache.cpp +++ b/src/gpu/GrLayerCache.cpp @@ -155,7 +155,6 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrTextureDesc& desc) { return true; } -#if USE_ATLAS if (layer->isAtlased()) { // Hooray it is still in the atlas - make sure it stays there layer->setLocked(true); @@ -195,7 +194,6 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrTextureDesc& desc) { } } } -#endif // The texture wouldn't fit in the cache - give it it's own texture. // This path always uses a new scratch texture and (thus) doesn't cache anything. diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h index e66d3330a6..c5fa236388 100644 --- a/src/gpu/GrLayerCache.h +++ b/src/gpu/GrLayerCache.h @@ -8,8 +8,6 @@ #ifndef GrLayerCache_DEFINED #define GrLayerCache_DEFINED -#define USE_ATLAS 0 - #include "GrAtlas.h" #include "GrPictureUtils.h" #include "GrRect.h" diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp index d14711633f..8ca7b2bdfb 100644 --- a/tests/GpuLayerCacheTest.cpp +++ b/tests/GpuLayerCacheTest.cpp @@ -100,18 +100,14 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) { lock_layer(reporter, &cache, layer); -#if USE_ATLAS // The first 4 layers should be in the atlas (and thus have non-empty // rects) if (i < 4) { REPORTER_ASSERT(reporter, layer->isAtlased()); } else { -#endif // The 5th layer couldn't fit in the atlas REPORTER_ASSERT(reporter, !layer->isAtlased()); -#if USE_ATLAS } -#endif } // Unlock the textures @@ -127,19 +123,15 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) { REPORTER_ASSERT(reporter, NULL != layer); REPORTER_ASSERT(reporter, !layer->locked()); -#if USE_ATLAS // The first 4 layers should still be in the atlas. if (i < 4) { REPORTER_ASSERT(reporter, NULL != layer->texture()); REPORTER_ASSERT(reporter, layer->isAtlased()); } else { -#endif // The final layer should be unlocked. REPORTER_ASSERT(reporter, NULL == layer->texture()); REPORTER_ASSERT(reporter, !layer->isAtlased()); -#if USE_ATLAS } -#endif } { @@ -155,7 +147,6 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) { for (int i = 0; i < kInitialNumLayers+1; ++i) { GrCachedLayer* layer = cache.findLayer(picture, i); -#if USE_ATLAS // 3 old layers plus the new one should be in the atlas. if (1 == i || 2 == i || 3 == i || 5 == i) { REPORTER_ASSERT(reporter, NULL != layer); @@ -163,18 +154,15 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) { REPORTER_ASSERT(reporter, NULL != layer->texture()); REPORTER_ASSERT(reporter, layer->isAtlased()); } else if (4 == i) { -#endif // The one that was never atlased should still be around REPORTER_ASSERT(reporter, NULL != layer); REPORTER_ASSERT(reporter, NULL == layer->texture()); REPORTER_ASSERT(reporter, !layer->isAtlased()); -#if USE_ATLAS } else { // The one bumped out of the atlas (i.e., 0) should be gone REPORTER_ASSERT(reporter, NULL == layer); } -#endif } //--------------------------------------------------------------------