Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/core/SkPath.cpp

Issue 17902003: Fix PathRefDebugRef (SK_DEBUG_PATH_REF) case for SkPath copy constructor. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkPath.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkPath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698