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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 644323006: Fix image filters for PDF backend. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add a comment about rendering quality, and reference appropriate skbug Created 6 years, 2 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 | « src/core/SkDeviceImageFilterProxy.h ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 736c50b9a6d8b0151ca8fbd7c1f445b545078883..8509de86fc01669fee2b43ab0298286fdb8a50b1 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -8,6 +8,7 @@
#include "SkPDFDevice.h"
#include "SkAnnotation.h"
+#include "SkBitmapDevice.h"
#include "SkColor.h"
#include "SkClipStack.h"
#include "SkData.h"
@@ -567,6 +568,15 @@ void GraphicStackState::updateDrawingState(const GraphicStateEntry& state) {
}
SkBaseDevice* SkPDFDevice::onCreateDevice(const SkImageInfo& info, Usage usage) {
+ // 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)
+ if (kImageFilter_Usage == usage) {
+ return SkBitmapDevice::Create(info);
+ }
+
SkMatrix initialTransform;
initialTransform.reset();
SkISize size = SkISize::Make(info.width(), info.height());
« no previous file with comments | « src/core/SkDeviceImageFilterProxy.h ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698