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:
parent
3b4b66c04a
commit
57f192d4af
@ -253,9 +253,7 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n
|
|||||||
usage = GrContext::kExact_ScratchTexMatch;
|
usage = GrContext::kExact_ScratchTexMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkAutoTUnref<GrTexture> tex(
|
SkAutoTUnref<GrTexture> tex(fContext->refScratchTexture(desc, usage));
|
||||||
fContext->refScratchTexture(desc, usage));
|
|
||||||
|
|
||||||
if (!tex) {
|
if (!tex) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -82,8 +82,7 @@ static void prepare_for_hoisting(GrLayerCache* layerCache,
|
|||||||
hl->fPreMat.preConcat(info.fPreMat);
|
hl->fPreMat.preConcat(info.fPreMat);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute the source rect if possible and return false if further processing
|
// Compute the source rect and return false if it is empty.
|
||||||
// on the layer should be abandoned based on its source rect.
|
|
||||||
static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatrix& initialMat,
|
static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatrix& initialMat,
|
||||||
const SkIRect& dstIR, SkIRect* srcIR) {
|
const SkIRect& dstIR, SkIRect* srcIR) {
|
||||||
SkIRect clipBounds = dstIR;
|
SkIRect clipBounds = dstIR;
|
||||||
@ -109,10 +108,6 @@ static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatr
|
|||||||
*srcIR = clipBounds;
|
*srcIR = clipBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GrLayerCache::PlausiblyAtlasable(srcIR->width(), srcIR->height())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +165,8 @@ void GrLayerHoister::FindLayersToAtlas(GrContext* context,
|
|||||||
|
|
||||||
SkIRect srcIR;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user