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 <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2017-07-19 14:19:14 -04:00 committed by Skia Commit-Bot
parent edfe4a5ca0
commit fc3afa921b

View File

@ -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;