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

Unified Diff: src/core/SkCanvas.cpp

Issue 722043005: Revert of 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
« no previous file with comments | « src/core/SkBBHFactory.cpp ('k') | src/core/SkCanvasDrawable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 31a9a7970bbb5ba296171eae0d251effa67e071e..4fda7a37b32a306aea9b229c083769acd44e0c1b 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -431,7 +431,7 @@
}
device->onAttachToCanvas(this);
fMCRec->fLayer->fDevice = SkRef(device);
- fMCRec->fRasterClip.setRect(device->getGlobalBounds());
+ fMCRec->fRasterClip.setRect(SkIRect::MakeWH(device->width(), device->height()));
}
return device;
}
@@ -453,11 +453,7 @@
class SkNoPixelsBitmapDevice : public SkBitmapDevice {
public:
- SkNoPixelsBitmapDevice(const SkIRect& bounds)
- : INHERITED(make_nopixels(bounds.width(), bounds.height()))
- {
- this->setOrigin(bounds.x(), bounds.y());
- }
+ SkNoPixelsBitmapDevice(int width, int height) : INHERITED(make_nopixels(width, height)) {}
private:
@@ -470,17 +466,16 @@
{
inc_canvas();
- this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice,
- (SkIRect::MakeWH(width, height))), kDefault_InitFlags)->unref();
-}
-
-SkCanvas::SkCanvas(const SkIRect& bounds, InitFlags flags)
+ this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, (width, height)), kDefault_InitFlags)->unref();
+}
+
+SkCanvas::SkCanvas(int width, int height, InitFlags flags)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
, fProps(SkSurfaceProps::kLegacyFontHost_InitType)
{
inc_canvas();
- this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, (bounds)), flags)->unref();
+ this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, (width, height)), flags)->unref();
}
SkCanvas::SkCanvas(SkBaseDevice* device, const SkSurfaceProps* props, InitFlags flags)
« no previous file with comments | « src/core/SkBBHFactory.cpp ('k') | src/core/SkCanvasDrawable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698