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

Unified Diff: src/utils/debugger/SkDebugCanvas.cpp

Issue 59073008: "Fix" bug in debug canvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: switch from round to roundOut Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDebugCanvas.cpp
===================================================================
--- src/utils/debugger/SkDebugCanvas.cpp (revision 12088)
+++ src/utils/debugger/SkDebugCanvas.cpp (working copy)
@@ -35,6 +35,24 @@
fFilter = false;
fIndex = 0;
fUserMatrix.reset();
+
+ // SkPicturePlayback uses the base-class' quickReject calls to cull clipped
+ // operations. This can lead to problems in the debugger which expects all
+ // the operations in the captured skp to appear in the debug canvas. To
+ // circumvent this we create a wide open clip here (an empty clip rect
+ // is not sufficient).
+ // Internally, the SkRect passed to clipRect is converted to an SkIRect and
+ // rounded out. The following code creates a nearly maximal rect that will
+ // not get collapsed by the coming conversions (Due to precision loss the
+ // inset has to be surprisingly large).
+ SkIRect largeIRect = SkIRect::MakeLargest();
+ largeIRect.inset(1024, 1024);
+ SkRect large = SkRect::MakeFromIRect(largeIRect);
+#ifdef SK_DEBUG
+ large.roundOut(&largeIRect);
+ SkASSERT(!largeIRect.isEmpty());
+#endif
+ INHERITED::clipRect(large, SkRegion::kReplace_Op, false);
}
SkDebugCanvas::~SkDebugCanvas() {
« 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