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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 732723004: Make sure pictures draw Clears even when the clip is empty. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Decouple Created 6 years, 1 month 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 | tests/PictureBBHTest.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 626dd6d792e6ff0a210b72d5938c99711f945006..0fa5c78b4dce5773487bbeb6428d31ec62542e31 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -22,8 +22,12 @@ void SkRecordDraw(const SkRecord& record,
// 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 query = { 0, 0, 0, 0 };
- (void)canvas->getClipBounds(&query);
+ SkRect query;
+ if (!canvas->getClipBounds(&query)) {
+ // We want to make sure our query rectangle is never totally empty.
+ // Clear ignores the clip, so it must draw even if the clip is logically empty.
+ query = SkRect::MakeWH(SK_ScalarNearlyZero, SK_ScalarNearlyZero);
+ }
SkTDArray<unsigned> ops;
bbh->search(query, &ops);
« no previous file with comments | « no previous file | tests/PictureBBHTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698