Allow non-atlasable layer to still be hoisted

The PlausiblyAtlasable check was preventing large layers from ever being hoisted in the FindLayersToHoist path.

Review URL: https://codereview.chromium.org/844613002
This commit is contained in:
robertphillips 2015-01-08 10:15:25 -08:00 committed by Commit bot
parent 3b4b66c04a
commit 57f192d4af
2 changed files with 4 additions and 10 deletions

View File

@ -253,9 +253,7 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n
usage = GrContext::kExact_ScratchTexMatch;
}
SkAutoTUnref<GrTexture> tex(
fContext->refScratchTexture(desc, usage));
SkAutoTUnref<GrTexture> tex(fContext->refScratchTexture(desc, usage));
if (!tex) {
return false;
}

View File

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