From fc3afa921bc42a357120e1e7856b3c256bfe1a6a Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Wed, 19 Jul 2017 14:19:14 -0400 Subject: [PATCH] SkPDF: more paths as rects Motivation: Content streams are marginally smaller and easier to read (for debugging). Change-Id: Idb82276f512408c083a1001da217707fd2d48e49 Reviewed-on: https://skia-review.googlesource.com/24744 Reviewed-by: Cary Clark Commit-Queue: Hal Canary --- src/pdf/SkPDFUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pdf/SkPDFUtils.cpp b/src/pdf/SkPDFUtils.cpp index af18432eb2..c9f5806211 100644 --- a/src/pdf/SkPDFUtils.cpp +++ b/src/pdf/SkPDFUtils.cpp @@ -129,7 +129,9 @@ void SkPDFUtils::EmitPath(const SkPath& path, SkPaint::Style paintStyle, bool isClosed; // Both closure and direction need to be checked. SkPath::Direction direction; if (path.isRect(&rect, &isClosed, &direction) && - isClosed && SkPath::kCW_Direction == direction) + isClosed && + (SkPath::kCW_Direction == direction || + SkPath::kEvenOdd_FillType == path.getFillType())) { SkPDFUtils::AppendRectangle(rect, content); return;