| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef SkPathRef_DEFINED | 9 #ifndef SkPathRef_DEFINED |
| 10 #define SkPathRef_DEFINED | 10 #define SkPathRef_DEFINED |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 /** | 227 /** |
| 228 * Writes the path points and verbs to a buffer. | 228 * Writes the path points and verbs to a buffer. |
| 229 */ | 229 */ |
| 230 void writeToBuffer(SkWBuffer* buffer); | 230 void writeToBuffer(SkWBuffer* buffer); |
| 231 | 231 |
| 232 /** | 232 /** |
| 233 * Gets the number of bytes that would be written in writeBuffer() | 233 * Gets the number of bytes that would be written in writeBuffer() |
| 234 */ | 234 */ |
| 235 uint32_t writeSize(); | 235 uint32_t writeSize(); |
| 236 | 236 |
| 237 uint32_t getHash() const { return static_cast<uint32_t>(this->genID()); } |
| 238 |
| 237 private: | 239 private: |
| 238 enum SerializationOffsets { | 240 enum SerializationOffsets { |
| 239 kIsFinite_SerializationShift = 25, // requires 1 bit | 241 kIsFinite_SerializationShift = 25, // requires 1 bit |
| 240 }; | 242 }; |
| 241 | 243 |
| 242 SkPathRef() { | 244 SkPathRef() { |
| 243 fBoundsIsDirty = true; // this also invalidates fIsFinite | 245 fBoundsIsDirty = true; // this also invalidates fIsFinite |
| 244 fPointCnt = 0; | 246 fPointCnt = 0; |
| 245 fVerbCnt = 0; | 247 fVerbCnt = 0; |
| 246 fVerbs = NULL; | 248 fVerbs = NULL; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 enum { | 417 enum { |
| 416 kEmptyGenID = 1, // GenID reserved for path ref with zero points and zer
o verbs. | 418 kEmptyGenID = 1, // GenID reserved for path ref with zero points and zer
o verbs. |
| 417 }; | 419 }; |
| 418 mutable int32_t fGenerationID; | 420 mutable int32_t fGenerationID; |
| 419 SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use
at any time. | 421 SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use
at any time. |
| 420 | 422 |
| 421 typedef SkRefCnt INHERITED; | 423 typedef SkRefCnt INHERITED; |
| 422 }; | 424 }; |
| 423 | 425 |
| 424 #endif | 426 #endif |
| OLD | NEW |