diff options
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 10 | ||||
-rw-r--r-- | src/pdf/SkPDFDevice.h | 3 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 273b958a8c..99f3ce1188 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -566,19 +566,13 @@ void GraphicStackState::updateDrawingState(const GraphicStateEntry& state) { } } -static bool not_supported_for_layers(const SkPaint& layerPaint) { +SkBaseDevice* SkPDFDevice::onCreateCompatibleDevice(const CreateInfo& cinfo) { // PDF does not support image filters, so render them on CPU. // Note that this rendering is done at "screen" resolution (100dpi), not // printer resolution. // FIXME: It may be possible to express some filters natively using PDF // to improve quality and file size (http://skbug.com/3043) - - // TODO: should we return true if there is a colorfilter? - return layerPaint.getImageFilter() != NULL; -} - -SkBaseDevice* SkPDFDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint* layerPaint) { - if (layerPaint && not_supported_for_layers(*layerPaint)) { + if (kImageFilter_Usage == cinfo.fUsage) { return SkBitmapDevice::Create(cinfo.fInfo); } SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height()); diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h index a90ea115c1..8a88314009 100644 --- a/src/pdf/SkPDFDevice.h +++ b/src/pdf/SkPDFDevice.h @@ -235,7 +235,8 @@ private: ContentEntry* getLastContentEntry(); void setLastContentEntry(ContentEntry* contentEntry); - SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) SK_OVERRIDE; + // override from SkBaseDevice + SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; void init(); void cleanUp(bool clearFontUsage); |