usage = GrContext::kExact_ScratchTexMatch;
}
- SkAutoTUnref<GrTexture> tex(
- fContext->refScratchTexture(desc, usage));
-
+ SkAutoTUnref<GrTexture> tex(fContext->refScratchTexture(desc, usage));
if (!tex) {
return false;
}
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;
*srcIR = clipBounds;
}
- if (!GrLayerCache::PlausiblyAtlasable(srcIR->width(), srcIR->height())) {
- return false;
- }
-
return true;
}
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;
}