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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 2197623002: SkPDF: flip saveLayer rightside up (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | src/pdf/SkPDFFormXObject.h » ('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 92f190732f748a3cfaf3dc49bef18e1e9fd3e65f..1720cd8df2c8664539b61a9dc84acfb0b15411f2 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1588,9 +1588,16 @@ void SkPDFDevice::appendDestinations(SkPDFDict* dict, SkPDFObject* page) const {
}
sk_sp<SkPDFObject> SkPDFDevice::makeFormXObjectFromDevice() {
+ SkMatrix inverseTransform = SkMatrix::I();
+ if (!this->initialTransform().isIdentity()) {
+ if (!this->initialTransform().invert(&inverseTransform)) {
+ SkDEBUGFAIL("Layer initial transform should be invertible.");
+ inverseTransform.reset();
+ }
+ }
sk_sp<SkPDFObject> xobject =
SkPDFMakeFormXObject(this->content(), this->copyMediaBox(),
- this->makeResourceDict(), nullptr);
+ this->makeResourceDict(), inverseTransform, nullptr);
// We always draw the form xobjects that we create back into the device, so
// we simply preserve the font usage instead of pulling it out and merging
// it back in later.
« no previous file with comments | « no previous file | src/pdf/SkPDFFormXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698