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

Unified Diff: src/pdf/SkPDFShader.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
« src/pdf/SkPDFDevice.cpp ('K') | « src/pdf/SkPDFDevice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFShader.cpp
===================================================================
--- src/pdf/SkPDFShader.cpp (revision 11092)
+++ src/pdf/SkPDFShader.cpp (working copy)
@@ -55,6 +55,10 @@
*/
static void interpolateColorCode(SkScalar range, SkScalar* curColor,
SkScalar* prevColor, SkString* result) {
+ if (range == SkIntToScalar(0)) {
vandebo (ex-Chrome) 2013/09/12 21:37:05 This should go to a different CL. You can't just
edisonn 2013/09/17 15:14:23 Done.
+ return;
+ }
+
static const int kColorComponents = 3;
// Figure out how to scale each color component.
@@ -578,6 +582,13 @@
SkPDFObject* SkPDFShader::GetPDFShader(const SkShader& shader,
const SkMatrix& matrix,
const SkIRect& surfaceBBox) {
+ if (matrix.hasPerspective() || shader.getLocalMatrix().hasPerspective()) {
+ NOT_IMPLEMENTED(true, false); // just report that PDF does not supports perspective
+ // TODO(edisonn): update the shape when possible
+ // or dump in an image otherwise
+ return NULL;
+ }
+
SkAutoMutexAcquire lock(CanonicalShadersMutex());
return GetPDFShaderByState(
SkNEW_ARGS(State, (shader, matrix, surfaceBBox)));
« src/pdf/SkPDFDevice.cpp ('K') | « src/pdf/SkPDFDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698