//#define SK_SUPPORT_GPU 1
-/* The PDF generation code uses Path Ops to generate inverse fills and complex
- * clipping paths, but at this time, Path Ops is not release ready yet. So,
- * the code is hidden behind this #define guard. If you are feeling adventurous
- * and want the latest and greatest PDF generation code, uncomment the #define.
+/* The PDF generation code uses Path Ops to handle complex clipping paths,
+ * but at this time, Path Ops is not release ready yet. So, the code is
+ * hidden behind this #define guard. If you are feeling adventurous and
+ * want the latest and greatest PDF generation code, uncomment the #define.
* When Path Ops is release ready, the define guards and this user config
* define should be removed entirely.
*/
-//#define SK_PDF_USE_PATHOPS
+//#define SK_PDF_USE_PATHOPS_CLIPPING
#endif
}
}
-#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).
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
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);
return;
}
-#ifdef SK_PDF_USE_PATHOPS
if (handleInversePath(d, origPath, paint, pathIsMutable, prePathMatrix)) {
return;
}
-#endif
if (handleRectAnnotation(pathPtr->getBounds(), matrix, paint)) {
return;
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,
drawPath(d, modifiedPath, noInversePaint, prePathMatrix, true);
return true;
}
-#endif
bool SkPDFDevice::handleRectAnnotation(const SkRect& r, const SkMatrix& matrix,
const SkPaint& p) {
*/
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,