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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 23654036: pdf: report NYI features, and fail gracefully when something is not supported in pdf. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
===================================================================
--- src/pdf/SkPDFDevice.cpp (revision 11353)
+++ src/pdf/SkPDFDevice.cpp (working copy)
@@ -632,6 +632,16 @@
void init(const SkClipStack* clipStack, const SkRegion& clipRegion,
const SkMatrix& matrix, const SkPaint& paint, bool hasText) {
fDstFormXObject = NULL;
+ if (matrix.hasPerspective() ||
+ (paint.getShader() &&
+ paint.getShader()->getLocalMatrix().hasPerspective())) {
+ // Just report that PDF does not supports perspective
+ // TODO(edisonn): update the shape when possible
+ // or dump in an image otherwise
+ NOT_IMPLEMENTED(true, false);
+ return;
+ }
+
if (paint.getXfermode()) {
paint.getXfermode()->asMode(&fXfermode);
}
@@ -679,6 +689,11 @@
fLastMarginContentEntry(NULL),
fClipStack(NULL),
fEncoder(NULL) {
+ // just report that PDF does not supports perspective
+ // TODO(edisonn): update the shape when possible
+ // or dump in an image otherwise
+ NOT_IMPLEMENTED(initialTransform.hasPerspective(), true);
+
// Skia generally uses the top left as the origin but PDF natively has the
// origin at the bottom left. This matrix corrects for that. But that only
// needs to be done once, we don't do it when layering.
@@ -915,6 +930,7 @@
origPath.transform(*prePathMatrix, pathPtr);
} else {
if (!matrix.preConcat(*prePathMatrix)) {
+ // TODO(edisonn): report somehow why we failed?
return;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698