diff options
author | 2011-05-24 23:02:07 +0000 | |
---|---|---|
committer | 2011-05-24 23:02:07 +0000 | |
commit | 61d267879bdf85c84b05f0519eb53b9322abbf0e (patch) | |
tree | 16622555edc5a2ac2313be5b51300cbc82068169 /src/pdf | |
parent | 50108cdbfea57e983667cd1fecd97a8a9df26b20 (diff) |
[PDF] Fix regression - correct for fInitialTrnasform in form xobjects.
Chrome bug http://crbug.com/83658
Review URL: http://codereview.appspot.com/4550072
git-svn-id: http://skia.googlecode.com/svn/trunk@1415 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/SkPDFFormXObject.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp index 70f166c1a9..40a5564847 100644 --- a/src/pdf/SkPDFFormXObject.cpp +++ b/src/pdf/SkPDFFormXObject.cpp @@ -19,6 +19,7 @@ #include "SkMatrix.h" #include "SkPDFCatalog.h" #include "SkPDFDevice.h" +#include "SkPDFUtils.h" #include "SkStream.h" #include "SkTypes.h" @@ -38,6 +39,16 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) { insert("BBox", device->getMediaBox().get()); insert("Resources", device->getResourceDict().get()); + // We invert the initial transform and apply that to the xobject so that + // it doesn't get applied twice. We can't just undo it because it's + // embedded in things like shaders and images. + if (!device->initialTransform().isIdentity()) { + SkMatrix inverse; + inverse.reset(); + device->initialTransform().invert(&inverse); + insert("Matrix", SkPDFUtils::MatrixToArray(inverse))->unref(); + } + // Right now SkPDFFormXObject is only used for saveLayer, which implies // isolated blending. Do this conditionally if that changes. SkRefPtr<SkPDFDict> group = new SkPDFDict("Group"); |