aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPathPriv.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-06-01 09:42:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-01 09:42:31 -0700
commitedc743a57657107b873ed2fc2efeeff1b1efcd23 (patch)
tree2d1b1434a60ef274d5a05e06c316dcfdf9a397fb /src/core/SkPathPriv.h
parent1e305ba0d6a4237020d36234e9e286d3b0489401 (diff)
Add SkPathPriv::IsSimpleClosedRect
This function looks for "simple" rect paths. Simple here means begins and ends at a corner and is closed (either manually or with a close verb). Unlike SkPath::isRect this returns the starting point index (using the same start indexing scheme as SkPath::addRect). GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2017313002 Review-Url: https://codereview.chromium.org/2017313002
Diffstat (limited to 'src/core/SkPathPriv.h')
-rw-r--r--src/core/SkPathPriv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/SkPathPriv.h b/src/core/SkPathPriv.h
index f0bab95030..8689dee197 100644
--- a/src/core/SkPathPriv.h
+++ b/src/core/SkPathPriv.h
@@ -83,6 +83,14 @@ public:
static void AddGenIDChangeListener(const SkPath& path, SkPathRef::GenIDChangeListener* listener) {
path.fPathRef->addGenIDChangeListener(listener);
}
+
+ /**
+ * This returns true for a rect that begins and ends at the same corner and has either a move
+ * followed by four lines or a move followed by 3 lines and a close. None of the parameters are
+ * optional. This does not permit degenerate line or point rectangles.
+ */
+ static bool IsSimpleClosedRect(const SkPath& path, SkRect* rect, SkPath::Direction* direction,
+ unsigned* start);
};
#endif