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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 485703002: Counterproposal for skirting the BBH when the query fully contains the picture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: explain Created 6 years, 4 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/core/SkPicture.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index bc5e7eb63feef19b231e4834f6c5a0ef3a8a1949..fda848835f37bc5fc5e2a7de99d4c0487ef76989 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -17,13 +17,15 @@ void SkRecordDraw(const SkRecord& record,
if (NULL != bbh) {
// Draw only ops that affect pixels in the canvas's current clip.
SkIRect query;
-#if 1 // TODO: Why is this the right way to make the query? I'd think it'd be the else branch.
- SkRect clipBounds;
- canvas->getClipBounds(&clipBounds);
+
+ // The SkRecord and BBH were recorded in identity space. This canvas
+ // is not necessarily in that same space. getClipBounds() returns us
+ // this canvas' clip bounds transformed back into identity space, which
+ // lets us query the BBH.
+ SkRect clipBounds = { 0, 0, 0, 0 };
+ (void)canvas->getClipBounds(&clipBounds);
clipBounds.roundOut(&query);
-#else
- canvas->getClipDeviceBounds(&query);
-#endif
+
SkTDArray<void*> ops;
bbh->search(query, &ops);
« no previous file with comments | « src/core/SkPicture.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698