From a3d9e21f0436cf7eb33dee8f060b1332f8cf1b6e Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Tue, 20 Feb 2018 09:48:13 -0500 Subject: don't trust stored segment mask Bug: skia:7604 Change-Id: I508bbdc006e1c6edce2006be0c43b037038c876b Reviewed-on: https://skia-review.googlesource.com/108360 Commit-Queue: Mike Reed Reviewed-by: Robert Phillips Reviewed-by: Mike Klein --- include/private/SkPathRef.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/private/SkPathRef.h') diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h index fa764f1a9c..b9b52d41c8 100644 --- a/include/private/SkPathRef.h +++ b/include/private/SkPathRef.h @@ -323,7 +323,7 @@ private: kLegacyIsRRect_SerializationShift = 26, // requires 1 bit, ignored. kIsFinite_SerializationShift = 25, // requires 1 bit kLegacyIsOval_SerializationShift = 24, // requires 1 bit, ignored. - kSegmentMask_SerializationShift = 0 // requires 4 bits + kSegmentMask_SerializationShift = 0 // requires 4 bits (deprecated) }; SkPathRef() { @@ -346,6 +346,9 @@ private: void copy(const SkPathRef& ref, int additionalReserveVerbs, int additionalReservePoints); + // Doesn't read fSegmentMask, but (re)computes it from the verbs array + unsigned computeSegmentMask() const; + // Return true if the computed bounds are finite. static bool ComputePtBounds(SkRect* bounds, const SkPathRef& ref) { return bounds->setBoundsCheck(ref.points(), ref.countPoints()); -- cgit v1.2.3