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

Unified Diff: src/core/SkRecorder.cpp

Issue 736583004: allow pictures to have a full bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/core/SkRecorder.cpp
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 1af328afd2949a7fc3c084d995181365f63f9aeb..e5e6efe63b26cc308f3c67a925359e46363ebb6d 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -10,9 +10,19 @@
#include "SkPatchUtils.h"
#include "SkPicture.h"
robertphillips 2014/11/18 20:51:53 Add one of these to SkRect?
reed1 2014/11/18 22:05:30 Love to, but I have to clean up SkRect.h first, wh
reed1 2014/11/19 14:49:16 Done.
-// SkCanvas will fail in mysterious ways if it doesn't know the real width and height.
+static SkIRect round_out(const SkRect& r) {
+ SkIRect ir;
+ r.roundOut(&ir);
+ return ir;
+}
+
SkRecorder::SkRecorder(SkRecord* record, int width, int height)
- : SkCanvas(width, height, SkCanvas::kConservativeRasterClip_InitFlag)
+ : SkCanvas(SkIRect::MakeWH(width, height), SkCanvas::kConservativeRasterClip_InitFlag)
+ , fRecord(record)
+ , fSaveLayerCount(0) {}
+
+SkRecorder::SkRecorder(SkRecord* record, const SkRect& bounds)
+ : SkCanvas(round_out(bounds), SkCanvas::kConservativeRasterClip_InitFlag)
, fRecord(record)
, fSaveLayerCount(0) {}

Powered by Google App Engine
This is Rietveld 408576698