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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 25675011: pdf: drawPath should pass the computed matrix, instead of default matrix stored in draw. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: just re-upload Created 7 years, 2 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 | « include/pdf/SkPDFDevice.h ('k') | no next file » | 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 e4b07f04fa794bcd27373564411445a039cd4afe..538422c510ba08f4e456a4ff813bcda9d97df9d0 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -973,16 +973,16 @@ void SkPDFDevice::drawPath(const SkDraw& d, const SkPath& origPath,
}
#ifdef SK_PDF_USE_PATHOPS
- if (handleInversePath(d, origPath, paint, pathIsMutable)) {
+ if (handleInversePath(d, origPath, paint, pathIsMutable, prePathMatrix)) {
return;
}
#endif
- if (handleRectAnnotation(pathPtr->getBounds(), *d.fMatrix, paint)) {
+ if (handleRectAnnotation(pathPtr->getBounds(), matrix, paint)) {
return;
}
- ScopedContentEntry content(this, d, paint);
+ ScopedContentEntry content(this, d.fClipStack, *d.fClip, matrix, paint);
if (!content.entry()) {
return;
}
@@ -1485,7 +1485,8 @@ SkData* SkPDFDevice::copyContentToData() const {
* in the first place.
*/
bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath,
- const SkPaint& paint, bool pathIsMutable) {
+ const SkPaint& paint, bool pathIsMutable,
+ const SkMatrix* prePathMatrix) {
if (!origPath.isInverseFillType()) {
return false;
}
@@ -1519,7 +1520,11 @@ bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath,
// (clip bounds are given in device space).
SkRect bounds;
SkMatrix transformInverse;
- if (!d.fMatrix->invert(&transformInverse)) {
+ SkMatrix totalMatrix = *d.fMatrix;
+ if (prePathMatrix) {
+ totalMatrix.preConcat(*prePathMatrix);
+ }
+ if (!totalMatrix.invert(&transformInverse)) {
return false;
}
bounds.set(d.fClip->getBounds());
@@ -1534,7 +1539,7 @@ bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath,
return false;
}
- drawPath(d, modifiedPath, noInversePaint, NULL, true);
+ drawPath(d, modifiedPath, noInversePaint, prePathMatrix, true);
return true;
}
#endif
« no previous file with comments | « include/pdf/SkPDFDevice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698