diff options
author | Adrienne Walker <enne@chromium.org> | 2017-08-10 12:16:37 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-10 20:22:35 +0000 |
commit | ad8da8ea990d22fa717ec1ae7c3ad628d74682b8 (patch) | |
tree | 0381a40ea1c53889b52122abe3effb213ac7b052 /include/private | |
parent | 6a653a5f7dd08ceb588d82f267e84ec6523194c2 (diff) |
Expose SkPath validation as boolean
As a part of serializing SkPaths, I want to be able to know (without
asserting) whether or not a path is valid so that I can discard
potentially malicious deserialized paths.
Currently, SkPath(Ref) both just have asserting validation functions
which can't be used externally. This patch adds accessors that don't
assert.
Bug: chromium:752755 skia:6955
Change-Id: I4d0ceb31ec660b87e3fda438392ad2b60a27a0da
Reviewed-on: https://skia-review.googlesource.com/31720
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'include/private')
-rw-r--r-- | include/private/SkPathRef.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h index 0efea72a86..560d933c59 100644 --- a/include/private/SkPathRef.h +++ b/include/private/SkPathRef.h @@ -311,7 +311,8 @@ public: void addGenIDChangeListener(GenIDChangeListener* listener); - SkDEBUGCODE(void validate() const;) + bool isValid() const; + SkDEBUGCODE(void validate() const { SkASSERT(this->isValid()); } ) private: enum SerializationOffsets { |