pdf: drawPath should pass the computed matrix, instead of default matrix stored in draw.

moved cl https://codereview.chromium.org/24265006/ in git repository so I can run the trybots

R=vandebo@chromium.org

Review URL: https://codereview.chromium.org/25675011

git-svn-id: http://skia.googlecode.com/svn/trunk@11626 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
edisonn@google.com 2013-10-07 13:22:21 +00:00
parent d34f05806f
commit a9ebd161a7
2 changed files with 13 additions and 7 deletions

View File

@ -295,7 +295,8 @@ private:
#ifdef SK_PDF_USE_PATHOPS #ifdef SK_PDF_USE_PATHOPS
bool handleInversePath(const SkDraw& d, const SkPath& origPath, bool handleInversePath(const SkDraw& d, const SkPath& origPath,
const SkPaint& paint, bool pathIsMutable); const SkPaint& paint, bool pathIsMutable,
const SkMatrix* prePathMatrix = NULL);
#endif #endif
bool handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, bool handleRectAnnotation(const SkRect& r, const SkMatrix& matrix,
const SkPaint& paint); const SkPaint& paint);

View File

@ -973,16 +973,16 @@ void SkPDFDevice::drawPath(const SkDraw& d, const SkPath& origPath,
} }
#ifdef SK_PDF_USE_PATHOPS #ifdef SK_PDF_USE_PATHOPS
if (handleInversePath(d, origPath, paint, pathIsMutable)) { if (handleInversePath(d, origPath, paint, pathIsMutable, prePathMatrix)) {
return; return;
} }
#endif #endif
if (handleRectAnnotation(pathPtr->getBounds(), *d.fMatrix, paint)) { if (handleRectAnnotation(pathPtr->getBounds(), matrix, paint)) {
return; return;
} }
ScopedContentEntry content(this, d, paint); ScopedContentEntry content(this, d.fClipStack, *d.fClip, matrix, paint);
if (!content.entry()) { if (!content.entry()) {
return; return;
} }
@ -1485,7 +1485,8 @@ SkData* SkPDFDevice::copyContentToData() const {
* in the first place. * in the first place.
*/ */
bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath, 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()) { if (!origPath.isInverseFillType()) {
return false; return false;
} }
@ -1519,7 +1520,11 @@ bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath,
// (clip bounds are given in device space). // (clip bounds are given in device space).
SkRect bounds; SkRect bounds;
SkMatrix transformInverse; SkMatrix transformInverse;
if (!d.fMatrix->invert(&transformInverse)) { SkMatrix totalMatrix = *d.fMatrix;
if (prePathMatrix) {
totalMatrix.preConcat(*prePathMatrix);
}
if (!totalMatrix.invert(&transformInverse)) {
return false; return false;
} }
bounds.set(d.fClip->getBounds()); bounds.set(d.fClip->getBounds());
@ -1534,7 +1539,7 @@ bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath,
return false; return false;
} }
drawPath(d, modifiedPath, noInversePaint, NULL, true); drawPath(d, modifiedPath, noInversePaint, prePathMatrix, true);
return true; return true;
} }
#endif #endif