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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 942853002: Fix layer hoisting bug in SkCanvas::drawPicture path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 9760968e54970f8259fda84585b560b4575ac9b2..5781a58cf7b8320724909f39fe5b9a84e560ed65 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1861,16 +1861,21 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
return false;
}
- SkRect clipBounds;
- if (!mainCanvas->getClipBounds(&clipBounds)) {
- return true;
+ const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data);
+ if (0 == gpuData->numBlocks()) {
+ return false;
}
- SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRect());
+ SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
+
+ SkIRect iBounds;
+ if (!mainCanvas->getClipDeviceBounds(&iBounds)) {
+ return false;
+ }
- const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
+ SkRect clipBounds = SkRect::Make(iBounds);
- SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
+ SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
GrLayerHoister::FindLayersToAtlas(fContext, mainPicture,
initialMatrix,
@@ -1882,6 +1887,8 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
SkTDArray<GrHoistedLayer> needRendering, recycled;
+ SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRect());
+
GrLayerHoister::FindLayersToHoist(fContext, mainPicture,
initialMatrix,
clipBounds,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698