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

Unified Diff: src/core/SkCanvas.cpp

Issue 1565203002: Revert of add backdrop option to SaveLayerRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « samplecode/SampleLayers.cpp ('k') | src/core/SkPictureFlat.h » ('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 bc354ab3c34d86fa891c54aaa9cc8e50f5a15a99..e5ca9ce6c13f4edd40a2c2da396bdba99f6e35fa 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -114,6 +114,7 @@
// experimental for faster tiled drawing...
//#define SK_ENABLE_CLIP_QUICKREJECT
+
//#define SK_TRACE_SAVERESTORE
#ifdef SK_TRACE_SAVERESTORE
@@ -480,7 +481,7 @@
// Make rawBounds include all paint outsets except for those due to image filters.
rawBounds = &apply_paint_to_bounds_sans_imagefilter(*fPaint, *rawBounds, &storage);
}
- (void)canvas->internalSaveLayer(SkCanvas::SaveLayerRec(rawBounds, &tmp),
+ (void)canvas->internalSaveLayer(SkCanvas::SaveLayerRec(rawBounds, &tmp, 0),
SkCanvas::kFullLayer_SaveLayerStrategy);
fTempLayerForImageFilter = true;
// we remove the imagefilter/xfermode inside doNext()
@@ -1172,8 +1173,7 @@
return this->getSaveCount() - 1;
}
-static void draw_filter_into_device(SkBaseDevice* src, const SkImageFilter* filter,
- SkBaseDevice* dst, const SkMatrix& ctm) {
+static void draw_filter_into_device(SkBaseDevice* src, SkImageFilter* filter, SkBaseDevice* dst) {
SkBitmap srcBM;
@@ -1198,12 +1198,9 @@
SkCanvas c(dst);
- SkAutoTUnref<SkImageFilter> localF(filter->newWithLocalMatrix(ctm));
SkPaint p;
- p.setImageFilter(localF);
- const SkScalar x = SkIntToScalar(src->getOrigin().x());
- const SkScalar y = SkIntToScalar(src->getOrigin().y());
- c.drawBitmap(srcBM, x, y, &p);
+ p.setImageFilter(filter);
+ c.drawBitmap(srcBM, 0, 0, &p);
}
void SkCanvas::internalSaveLayer(const SaveLayerRec& rec, SaveLayerStrategy strategy) {
@@ -1271,10 +1268,11 @@
}
device = newDev;
}
+
device->setOrigin(ir.fLeft, ir.fTop);
- if (rec.fBackdrop) {
- draw_filter_into_device(fMCRec->fTopLayer->fDevice, rec.fBackdrop, device, fMCRec->fMatrix);
+ if (0) {
+ draw_filter_into_device(fMCRec->fTopLayer->fDevice, nullptr, device);
}
DeviceCM* layer =
« no previous file with comments | « samplecode/SampleLayers.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698