Chromium Code Reviews| Index: src/pdf/SkPDFDevice.cpp |
| =================================================================== |
| --- src/pdf/SkPDFDevice.cpp (revision 11306) |
| +++ src/pdf/SkPDFDevice.cpp (working copy) |
| @@ -632,6 +632,14 @@ |
| void init(const SkClipStack* clipStack, const SkRegion& clipRegion, |
| const SkMatrix& matrix, const SkPaint& paint, bool hasText) { |
| fDstFormXObject = NULL; |
| + if (matrix.hasPerspective() || |
|
vandebo (ex-Chrome)
2013/09/17 16:35:09
The predominate style of this file is 80col. The
edisonn
2013/09/17 17:32:04
Done.
|
| + (paint.getShader() && paint.getShader()->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; |
| + } |
| + |
| if (paint.getXfermode()) { |
| paint.getXfermode()->asMode(&fXfermode); |
| } |
| @@ -679,6 +687,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. |
| @@ -777,6 +790,14 @@ |
| if (!totalTransform.invert(&inverse)) { |
| return; |
| } |
| + |
| + if (totalTransform.hasPerspective()) { |
|
vandebo (ex-Chrome)
2013/09/17 16:35:09
This isn't needed. totalTransform is formed from
edisonn
2013/09/17 17:32:04
Done.
|
| + 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; |
| + } |
| + |
| inverse.mapRect(&bbox); |
| SkPDFUtils::AppendRectangle(bbox, &contentEntry->fContent); |
| @@ -915,11 +936,19 @@ |
| origPath.transform(*prePathMatrix, pathPtr); |
| } else { |
| if (!matrix.preConcat(*prePathMatrix)) { |
| + // TODO(edisonn): report somewhow why we failed? |
|
vandebo (ex-Chrome)
2013/09/17 16:35:09
Log statement?
edisonn
2013/09/17 17:32:04
it is a todo, not looking for an answer in this cl
|
| return; |
| } |
| } |
| } |
| + if (matrix.hasPerspective()) { |
|
vandebo (ex-Chrome)
2013/09/17 16:35:09
Not necessary, the matrix will eventually get chec
edisonn
2013/09/17 17:32:04
Done.
|
| + 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; |
| + } |
| + |
| if (paint.getPathEffect()) { |
| if (d.fClip->isEmpty()) { |
| return; |
| @@ -1902,6 +1931,14 @@ |
| scaled.postScale(SkIntToScalar(subset.width()), |
| SkIntToScalar(subset.height())); |
| scaled.postConcat(matrix); |
| + |
| + if (scaled.hasPerspective()) { |
|
vandebo (ex-Chrome)
2013/09/17 16:35:09
Not needed - scaled in passed into ScopedContentEn
edisonn
2013/09/17 17:32:04
Done.
|
| + 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; |
| + } |
| + |
| ScopedContentEntry content(this, clipStack, clipRegion, scaled, paint); |
| if (!content.entry()) { |
| return; |