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

Unified Diff: src/core/SkCanvas.cpp

Issue 1201983006: Clean up usage of SkSurfaceProps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « include/effects/SkPictureImageFilter.h ('k') | src/core/SkDevice.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 f35727d6f62dcbd34e4bf05df822077acb9c10a9..fcfb6414075da44c6e5f148d5987b3deaa936241 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -536,8 +536,8 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
fSurfaceBase = NULL;
if (device) {
- // TODO: remove this - the root device & canvas should always have same surfaceProps
- device->initForRootLayer(fProps.pixelGeometry());
+ // The root device and the canvas should always have the same pixel geometry
+ SkASSERT(fProps.pixelGeometry() == device->surfaceProps().pixelGeometry());
if (device->forceConservativeRasterClip()) {
fConservativeRasterClip = true;
}
@@ -595,16 +595,6 @@ SkCanvas::SkCanvas(const SkIRect& bounds, InitFlags flags)
this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, (bounds, fProps)), flags)->unref();
}
-// TODO: remove this ctor
-SkCanvas::SkCanvas(SkBaseDevice* device, const SkSurfaceProps* props, InitFlags flags)
- : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfacePropsCopyOrDefault(props))
-{
- inc_canvas();
-
- this->init(device, flags);
-}
-
SkCanvas::SkCanvas(SkBaseDevice* device)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
, fProps(device->surfaceProps())
@@ -1256,7 +1246,7 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y,
SkImageFilter* filter = paint->getImageFilter();
SkIPoint pos = { x - iter.getX(), y - iter.getY() };
if (filter && !dstDev->canHandleImageFilter(filter)) {
- SkImageFilter::Proxy proxy(dstDev, fProps);
+ SkImageFilter::Proxy proxy(dstDev);
SkBitmap dst;
SkIPoint offset = SkIPoint::Make(0, 0);
const SkBitmap& src = srcDev->accessBitmap(false);
@@ -1308,7 +1298,7 @@ void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint*
SkImageFilter* filter = paint->getImageFilter();
SkIPoint pos = { x - iter.getX(), y - iter.getY() };
if (filter && !iter.fDevice->canHandleImageFilter(filter)) {
- SkImageFilter::Proxy proxy(iter.fDevice, fProps);
+ SkImageFilter::Proxy proxy(iter.fDevice);
SkBitmap dst;
SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix = *iter.fMatrix;
« no previous file with comments | « include/effects/SkPictureImageFilter.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698