Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Unified Diff: src/gpu/GrLayerHoister.cpp

Issue 844613002: Allow non-atlasable layer to still be hoisted (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: refactor Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index ab27f08493ecc261770b85947ab9464282bcbff2..7d6f5ab1b3879b4f1648d459ec6bc3111405622c 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;
}
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698