bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkPathRef_DEFINED |
| 9 | #define SkPathRef_DEFINED |
| 10 | |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame^] | 11 | #include "SkAtomics.h" |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 12 | #include "SkMatrix.h" |
| 13 | #include "SkPoint.h" |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 14 | #include "SkRRect.h" |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 15 | #include "SkRect.h" |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 16 | #include "SkRefCnt.h" |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame^] | 17 | #include "SkTDArray.h" |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 18 | #include "SkTemplates.h" |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame^] | 19 | #include "SkTo.h" |
| 20 | |
Mike Klein | bf45c70 | 2018-06-11 11:56:57 -0400 | [diff] [blame] | 21 | #include <limits> |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 22 | |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 23 | class SkRBuffer; |
| 24 | class SkWBuffer; |
| 25 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 26 | /** |
| 27 | * Holds the path verbs and points. It is versioned by a generation ID. None of its public methods |
| 28 | * modify the contents. To modify or append to the verbs/points wrap the SkPathRef in an |
| 29 | * SkPathRef::Editor object. Installing the editor resets the generation ID. It also performs |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 30 | * copy-on-write if the SkPathRef is shared by multiple SkPaths. The caller passes the Editor's |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 31 | * constructor a pointer to a sk_sp<SkPathRef>, which may be updated to point to a new SkPathRef |
| 32 | * after the editor's constructor returns. |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 33 | * |
| 34 | * The points and verbs are stored in a single allocation. The points are at the begining of the |
| 35 | * allocation while the verbs are stored at end of the allocation, in reverse order. Thus the points |
| 36 | * and verbs both grow into the middle of the allocation until the meet. To access verb i in the |
| 37 | * verb array use ref.verbs()[~i] (because verbs() returns a pointer just beyond the first |
| 38 | * logical verb or the last verb in memory). |
| 39 | */ |
bsalomon@google.com | ae09f2d | 2012-10-03 19:57:01 +0000 | [diff] [blame] | 40 | |
mtklein | b47cd4b | 2016-08-09 12:20:04 -0700 | [diff] [blame] | 41 | class SK_API SkPathRef final : public SkNVRefCnt<SkPathRef> { |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 42 | public: |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 43 | class Editor { |
| 44 | public: |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 45 | Editor(sk_sp<SkPathRef>* pathRef, |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 46 | int incReserveVerbs = 0, |
robertphillips@google.com | 3e292aa | 2013-09-27 17:48:49 +0000 | [diff] [blame] | 47 | int incReservePoints = 0); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 48 | |
commit-bot@chromium.org | f48e475 | 2013-06-27 18:39:39 +0000 | [diff] [blame] | 49 | ~Editor() { SkDEBUGCODE(sk_atomic_dec(&fPathRef->fEditorsAttached);) } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Returns the array of points. |
| 53 | */ |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 54 | SkPoint* points() { return fPathRef->getPoints(); } |
| 55 | const SkPoint* points() const { return fPathRef->points(); } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Gets the ith point. Shortcut for this->points() + i |
| 59 | */ |
| 60 | SkPoint* atPoint(int i) { |
| 61 | SkASSERT((unsigned) i < (unsigned) fPathRef->fPointCnt); |
| 62 | return this->points() + i; |
Mike Klein | fc6c37b | 2016-09-27 09:34:10 -0400 | [diff] [blame] | 63 | } |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 64 | const SkPoint* atPoint(int i) const { |
| 65 | SkASSERT((unsigned) i < (unsigned) fPathRef->fPointCnt); |
| 66 | return this->points() + i; |
Mike Klein | fc6c37b | 2016-09-27 09:34:10 -0400 | [diff] [blame] | 67 | } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Adds the verb and allocates space for the number of points indicated by the verb. The |
| 71 | * return value is a pointer to where the points for the verb should be written. |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 72 | * 'weight' is only used if 'verb' is kConic_Verb |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 73 | */ |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 74 | SkPoint* growForVerb(int /*SkPath::Verb*/ verb, SkScalar weight = 0) { |
robertphillips@google.com | 0308707 | 2013-10-02 16:42:21 +0000 | [diff] [blame] | 75 | SkDEBUGCODE(fPathRef->validate();) |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 76 | return fPathRef->growForVerb(verb, weight); |
robertphillips@google.com | 3e292aa | 2013-09-27 17:48:49 +0000 | [diff] [blame] | 77 | } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 78 | |
| 79 | /** |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 80 | * Allocates space for multiple instances of a particular verb and the |
| 81 | * requisite points & weights. |
| 82 | * The return pointer points at the first new point (indexed normally [<i>]). |
| 83 | * If 'verb' is kConic_Verb, 'weights' will return a pointer to the |
skia.committer@gmail.com | 96f5fa0 | 2013-12-16 07:01:40 +0000 | [diff] [blame] | 84 | * space for the conic weights (indexed normally). |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 85 | */ |
skia.committer@gmail.com | 96f5fa0 | 2013-12-16 07:01:40 +0000 | [diff] [blame] | 86 | SkPoint* growForRepeatedVerb(int /*SkPath::Verb*/ verb, |
| 87 | int numVbs, |
Ben Wagner | a93a14a | 2017-08-28 10:34:05 -0400 | [diff] [blame] | 88 | SkScalar** weights = nullptr) { |
skia.committer@gmail.com | 96f5fa0 | 2013-12-16 07:01:40 +0000 | [diff] [blame] | 89 | return fPathRef->growForRepeatedVerb(verb, numVbs, weights); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Resets the path ref to a new verb and point count. The new verbs and points are |
| 94 | * uninitialized. |
| 95 | */ |
reed@google.com | 277c3f8 | 2013-05-31 15:17:50 +0000 | [diff] [blame] | 96 | void resetToSize(int newVerbCnt, int newPointCnt, int newConicCount) { |
| 97 | fPathRef->resetToSize(newVerbCnt, newPointCnt, newConicCount); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 98 | } |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 99 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 100 | /** |
| 101 | * Gets the path ref that is wrapped in the Editor. |
| 102 | */ |
| 103 | SkPathRef* pathRef() { return fPathRef; } |
| 104 | |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 105 | void setIsOval(bool isOval, bool isCCW, unsigned start) { |
| 106 | fPathRef->setIsOval(isOval, isCCW, start); |
| 107 | } |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 108 | |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 109 | void setIsRRect(bool isRRect, bool isCCW, unsigned start) { |
| 110 | fPathRef->setIsRRect(isRRect, isCCW, start); |
| 111 | } |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 112 | |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 113 | void setBounds(const SkRect& rect) { fPathRef->setBounds(rect); } |
| 114 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 115 | private: |
| 116 | SkPathRef* fPathRef; |
| 117 | }; |
| 118 | |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 119 | class SK_API Iter { |
| 120 | public: |
| 121 | Iter(); |
| 122 | Iter(const SkPathRef&); |
| 123 | |
| 124 | void setPathRef(const SkPathRef&); |
| 125 | |
| 126 | /** Return the next verb in this iteration of the path. When all |
| 127 | segments have been visited, return kDone_Verb. |
| 128 | |
Mike Klein | 1170a55 | 2017-09-08 15:00:25 -0400 | [diff] [blame] | 129 | If any point in the path is non-finite, return kDone_Verb immediately. |
| 130 | |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 131 | @param pts The points representing the current verb and/or segment |
| 132 | This must not be NULL. |
| 133 | @return The verb for the current segment |
| 134 | */ |
| 135 | uint8_t next(SkPoint pts[4]); |
caryclark | 2028d7f | 2015-12-09 14:04:46 -0800 | [diff] [blame] | 136 | uint8_t peek() const; |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 137 | |
| 138 | SkScalar conicWeight() const { return *fConicWeights; } |
| 139 | |
| 140 | private: |
| 141 | const SkPoint* fPts; |
| 142 | const uint8_t* fVerbs; |
| 143 | const uint8_t* fVerbStop; |
| 144 | const SkScalar* fConicWeights; |
| 145 | }; |
| 146 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 147 | public: |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 148 | /** |
| 149 | * Gets a path ref with no verbs or points. |
| 150 | */ |
commit-bot@chromium.org | 1f81fd6 | 2013-10-23 14:44:08 +0000 | [diff] [blame] | 151 | static SkPathRef* CreateEmpty(); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 152 | |
| 153 | /** |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 154 | * Returns true if all of the points in this path are finite, meaning there |
| 155 | * are no infinities and no NaNs. |
| 156 | */ |
| 157 | bool isFinite() const { |
| 158 | if (fBoundsIsDirty) { |
| 159 | this->computeBounds(); |
| 160 | } |
| 161 | return SkToBool(fIsFinite); |
| 162 | } |
| 163 | |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 164 | /** |
| 165 | * Returns a mask, where each bit corresponding to a SegmentMask is |
| 166 | * set if the path contains 1 or more segments of that type. |
| 167 | * Returns 0 for an empty path (no segments). |
| 168 | */ |
| 169 | uint32_t getSegmentMasks() const { return fSegmentMask; } |
| 170 | |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 171 | /** Returns true if the path is an oval. |
| 172 | * |
| 173 | * @param rect returns the bounding rect of this oval. It's a circle |
| 174 | * if the height and width are the same. |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 175 | * @param isCCW is the oval CCW (or CW if false). |
| 176 | * @param start indicates where the contour starts on the oval (see |
| 177 | * SkPath::addOval for intepretation of the index). |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 178 | * |
| 179 | * @return true if this path is an oval. |
| 180 | * Tracking whether a path is an oval is considered an |
| 181 | * optimization for performance and so some paths that are in |
| 182 | * fact ovals can report false. |
| 183 | */ |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 184 | bool isOval(SkRect* rect, bool* isCCW, unsigned* start) const { |
| 185 | if (fIsOval) { |
| 186 | if (rect) { |
| 187 | *rect = this->getBounds(); |
| 188 | } |
| 189 | if (isCCW) { |
| 190 | *isCCW = SkToBool(fRRectOrOvalIsCCW); |
| 191 | } |
| 192 | if (start) { |
| 193 | *start = fRRectOrOvalStartIdx; |
| 194 | } |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | return SkToBool(fIsOval); |
| 198 | } |
| 199 | |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 200 | bool isRRect(SkRRect* rrect, bool* isCCW, unsigned* start) const { |
| 201 | if (fIsRRect) { |
| 202 | if (rrect) { |
| 203 | *rrect = this->getRRect(); |
| 204 | } |
| 205 | if (isCCW) { |
| 206 | *isCCW = SkToBool(fRRectOrOvalIsCCW); |
| 207 | } |
| 208 | if (start) { |
| 209 | *start = fRRectOrOvalStartIdx; |
| 210 | } |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 211 | } |
| 212 | return SkToBool(fIsRRect); |
| 213 | } |
| 214 | |
| 215 | |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 216 | bool hasComputedBounds() const { |
| 217 | return !fBoundsIsDirty; |
| 218 | } |
| 219 | |
| 220 | /** Returns the bounds of the path's points. If the path contains 0 or 1 |
| 221 | points, the bounds is set to (0,0,0,0), and isEmpty() will return true. |
| 222 | Note: this bounds may be larger than the actual shape, since curves |
| 223 | do not extend as far as their control points. |
| 224 | */ |
skia.committer@gmail.com | 65caeaf | 2013-09-27 07:01:29 +0000 | [diff] [blame] | 225 | const SkRect& getBounds() const { |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 226 | if (fBoundsIsDirty) { |
| 227 | this->computeBounds(); |
| 228 | } |
| 229 | return fBounds; |
| 230 | } |
| 231 | |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 232 | SkRRect getRRect() const; |
| 233 | |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 234 | /** |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 235 | * Transforms a path ref by a matrix, allocating a new one only if necessary. |
| 236 | */ |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 237 | static void CreateTransformedCopy(sk_sp<SkPathRef>* dst, |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 238 | const SkPathRef& src, |
robertphillips@google.com | 3e292aa | 2013-09-27 17:48:49 +0000 | [diff] [blame] | 239 | const SkMatrix& matrix); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 240 | |
commit-bot@chromium.org | fed2ab6 | 2014-01-23 15:16:05 +0000 | [diff] [blame] | 241 | static SkPathRef* CreateFromBuffer(SkRBuffer* buffer); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 242 | |
| 243 | /** |
| 244 | * Rollsback a path ref to zero verbs and points with the assumption that the path ref will be |
| 245 | * repopulated with approximately the same number of verbs and points. A new path ref is created |
| 246 | * only if necessary. |
| 247 | */ |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 248 | static void Rewind(sk_sp<SkPathRef>* pathRef); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 249 | |
mtklein | b47cd4b | 2016-08-09 12:20:04 -0700 | [diff] [blame] | 250 | ~SkPathRef(); |
Brian Osman | 03776fc | 2017-08-15 16:08:48 -0400 | [diff] [blame] | 251 | int countPoints() const { return fPointCnt; } |
| 252 | int countVerbs() const { return fVerbCnt; } |
| 253 | int countWeights() const { return fConicWeights.count(); } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 254 | |
| 255 | /** |
| 256 | * Returns a pointer one beyond the first logical verb (last verb in memory order). |
| 257 | */ |
Brian Osman | 03776fc | 2017-08-15 16:08:48 -0400 | [diff] [blame] | 258 | const uint8_t* verbs() const { return fVerbs; } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 259 | |
| 260 | /** |
| 261 | * Returns a const pointer to the first verb in memory (which is the last logical verb). |
| 262 | */ |
| 263 | const uint8_t* verbsMemBegin() const { return this->verbs() - fVerbCnt; } |
| 264 | |
| 265 | /** |
| 266 | * Returns a const pointer to the first point. |
| 267 | */ |
Brian Osman | 03776fc | 2017-08-15 16:08:48 -0400 | [diff] [blame] | 268 | const SkPoint* points() const { return fPoints; } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 269 | |
| 270 | /** |
| 271 | * Shortcut for this->points() + this->countPoints() |
| 272 | */ |
| 273 | const SkPoint* pointsEnd() const { return this->points() + this->countPoints(); } |
| 274 | |
Brian Osman | 03776fc | 2017-08-15 16:08:48 -0400 | [diff] [blame] | 275 | const SkScalar* conicWeights() const { return fConicWeights.begin(); } |
| 276 | const SkScalar* conicWeightsEnd() const { return fConicWeights.end(); } |
reed@google.com | 277c3f8 | 2013-05-31 15:17:50 +0000 | [diff] [blame] | 277 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 278 | /** |
| 279 | * Convenience methods for getting to a verb or point by index. |
| 280 | */ |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 281 | uint8_t atVerb(int index) const { |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 282 | SkASSERT((unsigned) index < (unsigned) fVerbCnt); |
| 283 | return this->verbs()[~index]; |
| 284 | } |
| 285 | const SkPoint& atPoint(int index) const { |
| 286 | SkASSERT((unsigned) index < (unsigned) fPointCnt); |
| 287 | return this->points()[index]; |
| 288 | } |
| 289 | |
robertphillips@google.com | 3e292aa | 2013-09-27 17:48:49 +0000 | [diff] [blame] | 290 | bool operator== (const SkPathRef& ref) const; |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 291 | |
| 292 | /** |
| 293 | * Writes the path points and verbs to a buffer. |
| 294 | */ |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 295 | void writeToBuffer(SkWBuffer* buffer) const; |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 296 | |
| 297 | /** |
| 298 | * Gets the number of bytes that would be written in writeBuffer() |
| 299 | */ |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 300 | uint32_t writeSize() const; |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 301 | |
caryclark | 8e7b19d | 2016-02-18 04:11:48 -0800 | [diff] [blame] | 302 | void interpolate(const SkPathRef& ending, SkScalar weight, SkPathRef* out) const; |
| 303 | |
commit-bot@chromium.org | 1ab9f73 | 2013-10-30 18:57:55 +0000 | [diff] [blame] | 304 | /** |
| 305 | * Gets an ID that uniquely identifies the contents of the path ref. If two path refs have the |
| 306 | * same ID then they have the same verbs and points. However, two path refs may have the same |
| 307 | * contents but different genIDs. |
| 308 | */ |
| 309 | uint32_t genID() const; |
| 310 | |
Chris Dalton | afa1158 | 2018-06-08 12:00:44 -0600 | [diff] [blame] | 311 | struct GenIDChangeListener : SkRefCnt { |
senorblanco | 84cd621 | 2015-08-04 10:01:58 -0700 | [diff] [blame] | 312 | virtual ~GenIDChangeListener() {} |
| 313 | virtual void onChange() = 0; |
| 314 | }; |
| 315 | |
Chris Dalton | afa1158 | 2018-06-08 12:00:44 -0600 | [diff] [blame] | 316 | void addGenIDChangeListener(sk_sp<GenIDChangeListener>); |
senorblanco | 84cd621 | 2015-08-04 10:01:58 -0700 | [diff] [blame] | 317 | |
Adrienne Walker | ad8da8e | 2017-08-10 12:16:37 -0700 | [diff] [blame] | 318 | bool isValid() const; |
| 319 | SkDEBUGCODE(void validate() const { SkASSERT(this->isValid()); } ) |
reed | 5bcbe91 | 2014-12-15 12:28:33 -0800 | [diff] [blame] | 320 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 321 | private: |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 322 | enum SerializationOffsets { |
Brian Salomon | b7d42e3 | 2017-09-21 16:59:17 -0400 | [diff] [blame] | 323 | kLegacyRRectOrOvalStartIdx_SerializationShift = 28, // requires 3 bits, ignored. |
| 324 | kLegacyRRectOrOvalIsCCW_SerializationShift = 27, // requires 1 bit, ignored. |
| 325 | kLegacyIsRRect_SerializationShift = 26, // requires 1 bit, ignored. |
| 326 | kIsFinite_SerializationShift = 25, // requires 1 bit |
| 327 | kLegacyIsOval_SerializationShift = 24, // requires 1 bit, ignored. |
Mike Reed | a3d9e21 | 2018-02-20 09:48:13 -0500 | [diff] [blame] | 328 | kSegmentMask_SerializationShift = 0 // requires 4 bits (deprecated) |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 329 | }; |
| 330 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 331 | SkPathRef() { |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 332 | fBoundsIsDirty = true; // this also invalidates fIsFinite |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 333 | fPointCnt = 0; |
| 334 | fVerbCnt = 0; |
Ben Wagner | a93a14a | 2017-08-28 10:34:05 -0400 | [diff] [blame] | 335 | fVerbs = nullptr; |
| 336 | fPoints = nullptr; |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 337 | fFreeSpace = 0; |
| 338 | fGenerationID = kEmptyGenID; |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 339 | fSegmentMask = 0; |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 340 | fIsOval = false; |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 341 | fIsRRect = false; |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 342 | // The next two values don't matter unless fIsOval or fIsRRect are true. |
senorblanco | 9c1d45d | 2016-07-22 13:51:42 -0700 | [diff] [blame] | 343 | fRRectOrOvalIsCCW = false; |
| 344 | fRRectOrOvalStartIdx = 0xAC; |
commit-bot@chromium.org | f48e475 | 2013-06-27 18:39:39 +0000 | [diff] [blame] | 345 | SkDEBUGCODE(fEditorsAttached = 0;) |
robertphillips@google.com | 0308707 | 2013-10-02 16:42:21 +0000 | [diff] [blame] | 346 | SkDEBUGCODE(this->validate();) |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 347 | } |
| 348 | |
robertphillips@google.com | 3e292aa | 2013-09-27 17:48:49 +0000 | [diff] [blame] | 349 | void copy(const SkPathRef& ref, int additionalReserveVerbs, int additionalReservePoints); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 350 | |
Mike Reed | a3d9e21 | 2018-02-20 09:48:13 -0500 | [diff] [blame] | 351 | // Doesn't read fSegmentMask, but (re)computes it from the verbs array |
| 352 | unsigned computeSegmentMask() const; |
| 353 | |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 354 | // Return true if the computed bounds are finite. |
| 355 | static bool ComputePtBounds(SkRect* bounds, const SkPathRef& ref) { |
reed | 91f283b | 2015-07-28 06:00:50 -0700 | [diff] [blame] | 356 | return bounds->setBoundsCheck(ref.points(), ref.countPoints()); |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 357 | } |
| 358 | |
| 359 | // called, if dirty, by getBounds() |
| 360 | void computeBounds() const { |
| 361 | SkDEBUGCODE(this->validate();) |
Mike Klein | 0b4cc89 | 2014-07-16 17:18:20 -0400 | [diff] [blame] | 362 | // TODO(mtklein): remove fBoundsIsDirty and fIsFinite, |
| 363 | // using an inverted rect instead of fBoundsIsDirty and always recalculating fIsFinite. |
mtklein | 5c9c9be | 2014-12-01 06:59:54 -0800 | [diff] [blame] | 364 | SkASSERT(fBoundsIsDirty); |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 365 | |
mtklein | 5c9c9be | 2014-12-01 06:59:54 -0800 | [diff] [blame] | 366 | fIsFinite = ComputePtBounds(&fBounds, *this); |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 367 | fBoundsIsDirty = false; |
| 368 | } |
| 369 | |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 370 | void setBounds(const SkRect& rect) { |
| 371 | SkASSERT(rect.fLeft <= rect.fRight && rect.fTop <= rect.fBottom); |
| 372 | fBounds = rect; |
| 373 | fBoundsIsDirty = false; |
mtklein | 5c9c9be | 2014-12-01 06:59:54 -0800 | [diff] [blame] | 374 | fIsFinite = fBounds.isFinite(); |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 375 | } |
| 376 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 377 | /** Makes additional room but does not change the counts or change the genID */ |
| 378 | void incReserve(int additionalVerbs, int additionalPoints) { |
robertphillips@google.com | 0308707 | 2013-10-02 16:42:21 +0000 | [diff] [blame] | 379 | SkDEBUGCODE(this->validate();) |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 380 | size_t space = additionalVerbs * sizeof(uint8_t) + additionalPoints * sizeof (SkPoint); |
| 381 | this->makeSpace(space); |
robertphillips@google.com | 0308707 | 2013-10-02 16:42:21 +0000 | [diff] [blame] | 382 | SkDEBUGCODE(this->validate();) |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 383 | } |
| 384 | |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 385 | /** Resets the path ref with verbCount verbs and pointCount points, all uninitialized. Also |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 386 | * allocates space for reserveVerb additional verbs and reservePoints additional points.*/ |
reed@google.com | 277c3f8 | 2013-05-31 15:17:50 +0000 | [diff] [blame] | 387 | void resetToSize(int verbCount, int pointCount, int conicCount, |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 388 | int reserveVerbs = 0, int reservePoints = 0) { |
| 389 | SkDEBUGCODE(this->validate();) |
| 390 | fBoundsIsDirty = true; // this also invalidates fIsFinite |
| 391 | fGenerationID = 0; |
| 392 | |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 393 | fSegmentMask = 0; |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 394 | fIsOval = false; |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 395 | fIsRRect = false; |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 396 | |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 397 | size_t newSize = sizeof(uint8_t) * verbCount + sizeof(SkPoint) * pointCount; |
| 398 | size_t newReserve = sizeof(uint8_t) * reserveVerbs + sizeof(SkPoint) * reservePoints; |
| 399 | size_t minSize = newSize + newReserve; |
| 400 | |
| 401 | ptrdiff_t sizeDelta = this->currSize() - minSize; |
| 402 | |
| 403 | if (sizeDelta < 0 || static_cast<size_t>(sizeDelta) >= 3 * minSize) { |
| 404 | sk_free(fPoints); |
Ben Wagner | a93a14a | 2017-08-28 10:34:05 -0400 | [diff] [blame] | 405 | fPoints = nullptr; |
| 406 | fVerbs = nullptr; |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 407 | fFreeSpace = 0; |
| 408 | fVerbCnt = 0; |
| 409 | fPointCnt = 0; |
| 410 | this->makeSpace(minSize); |
| 411 | fVerbCnt = verbCount; |
| 412 | fPointCnt = pointCount; |
| 413 | fFreeSpace -= newSize; |
| 414 | } else { |
| 415 | fPointCnt = pointCount; |
| 416 | fVerbCnt = verbCount; |
| 417 | fFreeSpace = this->currSize() - minSize; |
| 418 | } |
| 419 | fConicWeights.setCount(conicCount); |
| 420 | SkDEBUGCODE(this->validate();) |
| 421 | } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 422 | |
| 423 | /** |
skia.committer@gmail.com | 96f5fa0 | 2013-12-16 07:01:40 +0000 | [diff] [blame] | 424 | * Increases the verb count by numVbs and point count by the required amount. |
| 425 | * The new points are uninitialized. All the new verbs are set to the specified |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 426 | * verb. If 'verb' is kConic_Verb, 'weights' will return a pointer to the |
| 427 | * uninitialized conic weights. |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 428 | */ |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 429 | SkPoint* growForRepeatedVerb(int /*SkPath::Verb*/ verb, int numVbs, SkScalar** weights); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 430 | |
| 431 | /** |
| 432 | * Increases the verb count 1, records the new verb, and creates room for the requisite number |
| 433 | * of additional points. A pointer to the first point is returned. Any new points are |
| 434 | * uninitialized. |
| 435 | */ |
robertphillips@google.com | 6b8dbb6 | 2013-12-12 23:03:51 +0000 | [diff] [blame] | 436 | SkPoint* growForVerb(int /*SkPath::Verb*/ verb, SkScalar weight); |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 437 | |
| 438 | /** |
| 439 | * Ensures that the free space available in the path ref is >= size. The verb and point counts |
| 440 | * are not changed. |
| 441 | */ |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 442 | void makeSpace(size_t size) { |
| 443 | SkDEBUGCODE(this->validate();) |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 444 | if (size <= fFreeSpace) { |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 445 | return; |
| 446 | } |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 447 | size_t growSize = size - fFreeSpace; |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 448 | size_t oldSize = this->currSize(); |
| 449 | // round to next multiple of 8 bytes |
| 450 | growSize = (growSize + 7) & ~static_cast<size_t>(7); |
| 451 | // we always at least double the allocation |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 452 | if (growSize < oldSize) { |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 453 | growSize = oldSize; |
| 454 | } |
| 455 | if (growSize < kMinSize) { |
| 456 | growSize = kMinSize; |
| 457 | } |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 458 | constexpr size_t maxSize = std::numeric_limits<size_t>::max(); |
| 459 | size_t newSize; |
| 460 | if (growSize <= maxSize - oldSize) { |
| 461 | newSize = oldSize + growSize; |
| 462 | } else { |
| 463 | SK_ABORT("Path too big."); |
| 464 | } |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 465 | // Note that realloc could memcpy more than we need. It seems to be a win anyway. TODO: |
| 466 | // encapsulate this. |
| 467 | fPoints = reinterpret_cast<SkPoint*>(sk_realloc_throw(fPoints, newSize)); |
| 468 | size_t oldVerbSize = fVerbCnt * sizeof(uint8_t); |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 469 | void* newVerbsDst = SkTAddOffset<void>(fPoints, newSize - oldVerbSize); |
| 470 | void* oldVerbsSrc = SkTAddOffset<void>(fPoints, oldSize - oldVerbSize); |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 471 | memmove(newVerbsDst, oldVerbsSrc, oldVerbSize); |
Ben Wagner | ac32662 | 2017-07-31 16:57:01 -0400 | [diff] [blame] | 472 | fVerbs = SkTAddOffset<uint8_t>(fPoints, newSize); |
robertphillips@google.com | aaf3e64 | 2013-10-02 17:49:50 +0000 | [diff] [blame] | 473 | fFreeSpace += growSize; |
| 474 | SkDEBUGCODE(this->validate();) |
| 475 | } |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 476 | |
| 477 | /** |
| 478 | * Private, non-const-ptr version of the public function verbsMemBegin(). |
| 479 | */ |
| 480 | uint8_t* verbsMemWritable() { |
robertphillips@google.com | 0308707 | 2013-10-02 16:42:21 +0000 | [diff] [blame] | 481 | SkDEBUGCODE(this->validate();) |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 482 | return fVerbs - fVerbCnt; |
| 483 | } |
| 484 | |
| 485 | /** |
| 486 | * Gets the total amount of space allocated for verbs, points, and reserve. |
| 487 | */ |
| 488 | size_t currSize() const { |
| 489 | return reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPoints); |
| 490 | } |
| 491 | |
commit-bot@chromium.org | 1f81fd6 | 2013-10-23 14:44:08 +0000 | [diff] [blame] | 492 | /** |
| 493 | * Called the first time someone calls CreateEmpty to actually create the singleton. |
| 494 | */ |
mtklein | 148ec59 | 2014-10-13 13:17:56 -0700 | [diff] [blame] | 495 | friend SkPathRef* sk_create_empty_pathref(); |
commit-bot@chromium.org | 1f81fd6 | 2013-10-23 14:44:08 +0000 | [diff] [blame] | 496 | |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 497 | void setIsOval(bool isOval, bool isCCW, unsigned start) { |
| 498 | fIsOval = isOval; |
| 499 | fRRectOrOvalIsCCW = isCCW; |
Kaloyan Donev | dfffb39 | 2018-03-20 10:38:31 +0200 | [diff] [blame] | 500 | fRRectOrOvalStartIdx = SkToU8(start); |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 501 | } |
robertphillips@google.com | 466310d | 2013-12-03 16:43:54 +0000 | [diff] [blame] | 502 | |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 503 | void setIsRRect(bool isRRect, bool isCCW, unsigned start) { |
| 504 | fIsRRect = isRRect; |
| 505 | fRRectOrOvalIsCCW = isCCW; |
Kaloyan Donev | dfffb39 | 2018-03-20 10:38:31 +0200 | [diff] [blame] | 506 | fRRectOrOvalStartIdx = SkToU8(start); |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 507 | } |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 508 | |
| 509 | // called only by the editor. Note that this is not a const function. |
skia.committer@gmail.com | 96f5fa0 | 2013-12-16 07:01:40 +0000 | [diff] [blame] | 510 | SkPoint* getPoints() { |
| 511 | SkDEBUGCODE(this->validate();) |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 512 | fIsOval = false; |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 513 | fIsRRect = false; |
| 514 | return fPoints; |
| 515 | } |
| 516 | |
| 517 | const SkPoint* getPoints() const { |
| 518 | SkDEBUGCODE(this->validate();) |
skia.committer@gmail.com | 96f5fa0 | 2013-12-16 07:01:40 +0000 | [diff] [blame] | 519 | return fPoints; |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 520 | } |
| 521 | |
senorblanco | 84cd621 | 2015-08-04 10:01:58 -0700 | [diff] [blame] | 522 | void callGenIDChangeListeners(); |
| 523 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 524 | enum { |
| 525 | kMinSize = 256, |
| 526 | }; |
| 527 | |
mtklein | 5c9c9be | 2014-12-01 06:59:54 -0800 | [diff] [blame] | 528 | mutable SkRect fBounds; |
robertphillips@google.com | ca0c838 | 2013-09-26 12:18:23 +0000 | [diff] [blame] | 529 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 530 | SkPoint* fPoints; // points to begining of the allocation |
| 531 | uint8_t* fVerbs; // points just past the end of the allocation (verbs grow backwards) |
| 532 | int fVerbCnt; |
| 533 | int fPointCnt; |
| 534 | size_t fFreeSpace; // redundant but saves computation |
reed@google.com | 277c3f8 | 2013-05-31 15:17:50 +0000 | [diff] [blame] | 535 | SkTDArray<SkScalar> fConicWeights; |
| 536 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 537 | enum { |
| 538 | kEmptyGenID = 1, // GenID reserved for path ref with zero points and zero verbs. |
| 539 | }; |
commit-bot@chromium.org | 1ab9f73 | 2013-10-30 18:57:55 +0000 | [diff] [blame] | 540 | mutable uint32_t fGenerationID; |
commit-bot@chromium.org | f48e475 | 2013-06-27 18:39:39 +0000 | [diff] [blame] | 541 | SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use at any time. |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 542 | |
Chris Dalton | afa1158 | 2018-06-08 12:00:44 -0600 | [diff] [blame] | 543 | SkTDArray<GenIDChangeListener*> fGenIDChangeListeners; // pointers are reffed |
senorblanco | 84cd621 | 2015-08-04 10:01:58 -0700 | [diff] [blame] | 544 | |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 545 | mutable uint8_t fBoundsIsDirty; |
Ben Wagner | cee46e5 | 2018-06-12 16:30:29 -0400 | [diff] [blame] | 546 | mutable bool fIsFinite; // only meaningful if bounds are valid |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 547 | |
Ben Wagner | cee46e5 | 2018-06-12 16:30:29 -0400 | [diff] [blame] | 548 | bool fIsOval; |
| 549 | bool fIsRRect; |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 550 | // Both the circle and rrect special cases have a notion of direction and starting point |
| 551 | // The next two variables store that information for either. |
Ben Wagner | cee46e5 | 2018-06-12 16:30:29 -0400 | [diff] [blame] | 552 | bool fRRectOrOvalIsCCW; |
bsalomon | 78d58d1 | 2016-05-27 09:17:04 -0700 | [diff] [blame] | 553 | uint8_t fRRectOrOvalStartIdx; |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 554 | uint8_t fSegmentMask; |
| 555 | |
robertphillips@google.com | 0efb21b | 2013-12-13 19:36:25 +0000 | [diff] [blame] | 556 | friend class PathRefTest_Private; |
caryclark | da707bf | 2015-11-19 14:47:43 -0800 | [diff] [blame] | 557 | friend class ForceIsRRect_Private; // unit test isRRect |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 558 | }; |
| 559 | |
bsalomon@google.com | 1dfe88e | 2012-10-03 13:46:20 +0000 | [diff] [blame] | 560 | #endif |