| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 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 | 9 |
| 10 #include "SkBuffer.h" | 10 #include "SkBuffer.h" |
| 11 #include "SkErrorInternals.h" | 11 #include "SkErrorInternals.h" |
| 12 #include "SkMath.h" | 12 #include "SkMath.h" |
| 13 #include "SkPath.h" | 13 #include "SkPath.h" |
| 14 #include "SkPathRef.h" | 14 #include "SkPathRef.h" |
| 15 #include "SkRRect.h" | 15 #include "SkRRect.h" |
| 16 #include "SkThread.h" | 16 #include "SkThread.h" |
| 17 | 17 |
| 18 //////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////// |
| 19 | 19 |
| 20 #if SK_DEBUG_PATH_REF | 20 #if SK_DEBUG_PATH_REF |
| 21 | 21 |
| 22 SkPath::PathRefDebugRef::PathRefDebugRef(SkPath* owner) : fOwner(owner) {} | |
| 23 | |
| 24 SkPath::PathRefDebugRef::PathRefDebugRef(SkPathRef* pr, SkPath* owner) | 22 SkPath::PathRefDebugRef::PathRefDebugRef(SkPathRef* pr, SkPath* owner) |
| 25 : fPathRef(pr) | 23 : fPathRef(pr) |
| 26 , fOwner(owner) { | 24 , fOwner(owner) |
| 25 { |
| 27 pr->addOwner(owner); | 26 pr->addOwner(owner); |
| 28 } | 27 } |
| 29 | 28 |
| 30 SkPath::PathRefDebugRef::~PathRefDebugRef() { | 29 SkPath::PathRefDebugRef::~PathRefDebugRef() { |
| 31 fPathRef->removeOwner(fOwner); | 30 fPathRef->removeOwner(fOwner); |
| 32 } | 31 } |
| 33 | 32 |
| 34 void SkPath::PathRefDebugRef::reset(SkPathRef* ref) { | 33 void SkPath::PathRefDebugRef::reset(SkPathRef* ref) { |
| 35 bool diff = (ref != fPathRef.get()); | 34 bool diff = (ref != fPathRef.get()); |
| 36 if (diff && NULL != fPathRef.get()) { | 35 if (diff && NULL != fPathRef.get()) { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 fIsFinite = false; | 236 fIsFinite = false; |
| 238 fIsOval = false; | 237 fIsOval = false; |
| 239 #ifdef SK_BUILD_FOR_ANDROID | 238 #ifdef SK_BUILD_FOR_ANDROID |
| 240 GEN_ID_INC; | 239 GEN_ID_INC; |
| 241 fSourcePath = NULL; | 240 fSourcePath = NULL; |
| 242 #endif | 241 #endif |
| 243 } | 242 } |
| 244 | 243 |
| 245 SkPath::SkPath(const SkPath& that) | 244 SkPath::SkPath(const SkPath& that) |
| 246 #if SK_DEBUG_PATH_REF | 245 #if SK_DEBUG_PATH_REF |
| 247 : fPathRef(this) | 246 : fPathRef(SkRef(that.fPathRef.get()), this) |
| 248 #else | 247 #else |
| 249 : fPathRef(SkRef(that.fPathRef.get())) | 248 : fPathRef(SkRef(that.fPathRef.get())) |
| 250 #endif | 249 #endif |
| 251 #ifdef SK_BUILD_FOR_ANDROID | 250 #ifdef SK_BUILD_FOR_ANDROID |
| 252 , fGenerationID(0) | 251 , fGenerationID(0) |
| 253 #endif | 252 #endif |
| 254 { | 253 { |
| 255 this->copyFields(that); | 254 this->copyFields(that); |
| 256 SkDEBUGCODE(that.validate();) | 255 SkDEBUGCODE(that.validate();) |
| 257 } | 256 } |
| (...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3052 switch (this->getFillType()) { | 3051 switch (this->getFillType()) { |
| 3053 case SkPath::kEvenOdd_FillType: | 3052 case SkPath::kEvenOdd_FillType: |
| 3054 case SkPath::kInverseEvenOdd_FillType: | 3053 case SkPath::kInverseEvenOdd_FillType: |
| 3055 w &= 1; | 3054 w &= 1; |
| 3056 break; | 3055 break; |
| 3057 default: | 3056 default: |
| 3058 break; | 3057 break; |
| 3059 } | 3058 } |
| 3060 return SkToBool(w); | 3059 return SkToBool(w); |
| 3061 } | 3060 } |
| OLD | NEW |