diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp index e521b3e323..8f6a69bcf5 100644 --- a/src/gpu/GrLayerCache.cpp +++ b/src/gpu/GrLayerCache.cpp @@ -253,9 +253,7 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n usage = GrContext::kExact_ScratchTexMatch; } - SkAutoTUnref tex( - fContext->refScratchTexture(desc, usage)); - + SkAutoTUnref tex(fContext->refScratchTexture(desc, usage)); if (!tex) { return false; } diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp index ab27f08493..7d6f5ab1b3 100644 --- a/src/gpu/GrLayerHoister.cpp +++ b/src/gpu/GrLayerHoister.cpp @@ -82,8 +82,7 @@ static void prepare_for_hoisting(GrLayerCache* layerCache, hl->fPreMat.preConcat(info.fPreMat); } -// Compute the source rect if possible and return false if further processing -// on the layer should be abandoned based on its source rect. +// Compute the source rect and return false if it is empty. static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatrix& initialMat, const SkIRect& dstIR, SkIRect* srcIR) { SkIRect clipBounds = dstIR; @@ -109,10 +108,6 @@ static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatr *srcIR = clipBounds; } - if (!GrLayerCache::PlausiblyAtlasable(srcIR->width(), srcIR->height())) { - return false; - } - return true; } @@ -170,7 +165,8 @@ void GrLayerHoister::FindLayersToAtlas(GrContext* context, SkIRect srcIR; - if (!compute_source_rect(info, initialMat, dstIR, &srcIR)) { + if (!compute_source_rect(info, initialMat, dstIR, &srcIR) || + !GrLayerCache::PlausiblyAtlasable(srcIR.width(), srcIR.height())) { continue; }