diff options
author | 2015-04-22 15:02:03 -0700 | |
---|---|---|
committer | 2015-04-22 15:02:04 -0700 | |
commit | 632e92fc3fa99e6a78fcbc67d6da68d5bd8334c3 (patch) | |
tree | 6859909e93f1b914942a0ec486fcca834375099a /src | |
parent | 31d36b087168486228093f0322898953072f36f2 (diff) |
[SkPDFDevice] Enable pathops-based inverse fills
Keeping the old compile guard for clipping only.
BUG=skia:3749
R=halcanary@google.com,caryclark@google.com,reed@google.com
Review URL: https://codereview.chromium.org/1099953002
Diffstat (limited to 'src')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 8 | ||||
-rw-r--r-- | src/pdf/SkPDFDevice.h | 2 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 1b16397512..b08bb174b1 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -328,7 +328,6 @@ static void emit_clip(SkPath* clipPath, SkRect* clipRect, } } -#ifdef SK_PDF_USE_PATHOPS /* Calculate an inverted path's equivalent non-inverted path, given the * canvas bounds. * outPath may alias with invPath (since this is supported by PathOps). @@ -343,6 +342,7 @@ static bool calculate_inverse_path(const SkRect& bounds, const SkPath& invPath, return Op(clipPath, invPath, kIntersect_PathOp, outPath); } +#ifdef SK_PDF_USE_PATHOPS_CLIPPING // Sanity check the numerical values of the SkRegion ops and PathOps ops // enums so region_op_to_pathops_op can do a straight passthrough cast. // If these are failing, it may be necessary to make region_op_to_pathops_op @@ -440,7 +440,7 @@ void GraphicStackState::updateClip(const SkClipStack& clipStack, SkMatrix transform; transform.setTranslate(translation.fX, translation.fY); -#ifdef SK_PDF_USE_PATHOPS +#ifdef SK_PDF_USE_PATHOPS_CLIPPING SkPath clipPath; if (get_clip_stack_path(transform, clipStack, clipRegion, &clipPath)) { emit_clip(&clipPath, NULL, fContentStream); @@ -951,11 +951,9 @@ void SkPDFDevice::drawPath(const SkDraw& d, const SkPath& origPath, return; } -#ifdef SK_PDF_USE_PATHOPS if (handleInversePath(d, origPath, paint, pathIsMutable, prePathMatrix)) { return; } -#endif if (handleRectAnnotation(pathPtr->getBounds(), matrix, paint)) { return; @@ -1363,7 +1361,6 @@ void SkPDFDevice::writeContent(SkWStream* out) const { SkPDFDevice::copyContentEntriesToData(fContentEntries.get(), out); } -#ifdef SK_PDF_USE_PATHOPS /* Draws an inverse filled path by using Path Ops to compute the positive * inverse using the current clip as the inverse bounds. * Return true if this was an inverse path and was properly handled, @@ -1429,7 +1426,6 @@ bool SkPDFDevice::handleInversePath(const SkDraw& d, const SkPath& origPath, drawPath(d, modifiedPath, noInversePaint, prePathMatrix, true); return true; } -#endif bool SkPDFDevice::handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, const SkPaint& p) { diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h index a701405241..2850cf943c 100644 --- a/src/pdf/SkPDFDevice.h +++ b/src/pdf/SkPDFDevice.h @@ -290,11 +290,9 @@ private: */ void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const; -#ifdef SK_PDF_USE_PATHOPS bool handleInversePath(const SkDraw& d, const SkPath& origPath, const SkPaint& paint, bool pathIsMutable, const SkMatrix* prePathMatrix = NULL); -#endif bool handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, const SkPaint& paint); bool handlePointAnnotation(const SkPoint* points, size_t count, |