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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 267293007: Fix rendering artifacts in pull-saveLayers-forward mode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix bug in unit test Created 6 years, 7 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/GrPictureUtils.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
===================================================================
--- src/gpu/SkGpuDevice.cpp (revision 14658)
+++ src/gpu/SkGpuDevice.cpp (working copy)
@@ -1997,12 +1997,19 @@
}
} else {
// In this case there is no BBH associated with the picture. Pre-render
- // all the layers
- // TODO: intersect the bounds of each layer with the clip region to
- // reduce the number of pre-rendered layers
+ // all the layers that intersect the drawn region
for (int j = 0; j < gpuData->numSaveLayers(); ++j) {
const GPUAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(j);
+ SkIRect layerRect = SkIRect::MakeXYWH(info.fOffset.fX,
+ info.fOffset.fY,
+ info.fSize.fWidth,
+ info.fSize.fHeight);
+
+ if (!SkIRect::Intersects(query, layerRect)) {
+ continue;
+ }
+
// TODO: once this code is more stable unsuitable layers can
// just be omitted during the optimization stage
if (!info.fValid ||
« no previous file with comments | « src/gpu/GrPictureUtils.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698