aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-13 08:46:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-13 08:46:12 -0700
commitf7076a13e2d4269903b34ef2780e1c84723e4477 (patch)
tree0341a3d6020bf1d0153f9a882d74080d42435e90 /src/utils
parentfd45079314b739979492601fc7a242aff24c58a3 (diff)
Revert of Revert of Change device creation to see the (optional) layer-paint (patchset #1 id:1 of https://codereview.chromium.org/1008863002/)
Reason for revert: guard in chrome has landed Original issue's description: > Revert of Change device creation to see the (optional) layer-paint (patchset #9 id:160001 of https://codereview.chromium.org/988413003/) > > Reason for revert: > need to have chrome opt-in for the older API before this can land (in chrome) > > Original issue's description: > > Change device creation to see the (optional) layer-paint > > > > Motivation: > > > > PDFDevice currently relies on 1) being told that the layer's paint has an imagefilter, and in the case, it creates a rasterdevice. It then relies on (2) canvas itself sniffing the layer's paint and offering to apply-the-imagefilter to call drawSprite instead of drawDevice. > > > > This subtle interchange is fragile, and also does not support other unsupported PDF features like colorfilters. This CL is a step toward making this use-raster-instead-of-native approach to layers more completely in the subclass' hands. > > > > Committed: https://skia.googlesource.com/skia/+/1182d9a96b80bd12183ee7c81325a979a51ee0c0 > > TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/0e040f7da2fdfeb49aa60d24117306e3b1e6ea90 TBR=halcanary@google.com,senorblanco@google.com,robertphillips@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1006923002
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkDeferredCanvas.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 8fe9f8a4b5..647105d757 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -162,7 +162,7 @@ public:
GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
- SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE;
+ SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) SK_OVERRIDE;
SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE;
@@ -231,9 +231,6 @@ protected:
void lockPixels() SK_OVERRIDE {}
void unlockPixels() SK_OVERRIDE {}
- bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE {
- return false;
- }
bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE {
return false;
}
@@ -461,16 +458,13 @@ const SkBitmap& SkDeferredDevice::onAccessBitmap() {
return immediateDevice()->accessBitmap(false);
}
-SkBaseDevice* SkDeferredDevice::onCreateCompatibleDevice(const CreateInfo& cinfo) {
- // Save layer usage not supported, and not required by SkDeferredCanvas.
- SkASSERT(cinfo.fUsage != kSaveLayer_Usage);
-
+SkBaseDevice* SkDeferredDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint* layerPaint) {
// Create a compatible non-deferred device.
// We do not create a deferred device because we know the new device
// will not be used with a deferred canvas (there is no API for that).
// And connecting a SkDeferredDevice to non-deferred canvas can result
// in unpredictable behavior.
- return immediateDevice()->onCreateCompatibleDevice(cinfo);
+ return immediateDevice()->onCreateDevice(cinfo, layerPaint);
}
SkSurface* SkDeferredDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {