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
This commit is contained in:
robertphillips 2014-07-29 07:14:49 -07:00 committed by Commit bot
parent 3a9142437e
commit 09dde64628
3 changed files with 0 additions and 16 deletions

View File

@ -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.

View File

@ -8,8 +8,6 @@
#ifndef GrLayerCache_DEFINED
#define GrLayerCache_DEFINED
#define USE_ATLAS 0
#include "GrAtlas.h"
#include "GrPictureUtils.h"
#include "GrRect.h"

View File

@ -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
}
//--------------------------------------------------------------------