aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/sksg/geometry/SkSGPath.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-04-25 21:43:03 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-26 02:35:10 +0000
commitcd05b196099492da8f4badd3d47a906395fc0b79 (patch)
treeb75c7b86c278d31f438ae2d3733f5c1bafd1cadb /experimental/sksg/geometry/SkSGPath.cpp
parent1366282bc2f2c9566e1ffa77bafb2ec4d8f190df (diff)
[skottie] Add support for inverse mask paths
TBR= Change-Id: I442033b2e82777c90ee497d8a5b2310af1d2e631 Reviewed-on: https://skia-review.googlesource.com/123840 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/sksg/geometry/SkSGPath.cpp')
-rw-r--r--experimental/sksg/geometry/SkSGPath.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/experimental/sksg/geometry/SkSGPath.cpp b/experimental/sksg/geometry/SkSGPath.cpp
index 8d5a25373a..230442d409 100644
--- a/experimental/sksg/geometry/SkSGPath.cpp
+++ b/experimental/sksg/geometry/SkSGPath.cpp
@@ -9,6 +9,7 @@
#include "SkCanvas.h"
#include "SkPaint.h"
+#include "SkRectPriv.h"
namespace sksg {
@@ -25,7 +26,12 @@ void Path::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
SkRect Path::onRevalidate(InvalidationController*, const SkMatrix&) {
SkASSERT(this->hasInval());
- return fPath.computeTightBounds();
+ const auto ft = fPath.getFillType();
+ return (ft == SkPath::kWinding_FillType || ft == SkPath::kEvenOdd_FillType)
+ // "Containing" fills have finite bounds.
+ ? fPath.computeTightBounds()
+ // Inverse fills are "infinite".
+ : SkRectPriv::MakeLargeS32();
}
SkPath Path::onAsPath() const {