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

Unified Diff: src/core/SkPath.cpp

Issue 18029006: Remove SK_DEBUG_PATH_REF (Closed) Base URL: https://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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkPathRef.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 7497ab2591a787bb42c6c87b9f516e2bce2a4859..4ff62878b9d94d7ec6ce0415ca15033e9d603700 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -15,59 +15,6 @@
#include "SkRRect.h"
#include "SkThread.h"
-////////////////////////////////////////////////////////////////////////////
-
-#if SK_DEBUG_PATH_REF
-
-SkPath::PathRefDebugRef::PathRefDebugRef(SkPathRef* pr, SkPath* owner)
- : fPathRef(pr)
- , fOwner(owner)
-{
- pr->addOwner(owner);
-}
-
-SkPath::PathRefDebugRef::~PathRefDebugRef() {
- fPathRef->removeOwner(fOwner);
-}
-
-void SkPath::PathRefDebugRef::reset(SkPathRef* ref) {
- bool diff = (ref != fPathRef.get());
- if (diff && NULL != fPathRef.get()) {
- fPathRef.get()->removeOwner(fOwner);
- }
- fPathRef.reset(ref);
- if (diff && NULL != fPathRef.get()) {
- fPathRef.get()->addOwner(fOwner);
- }
-}
-
-void SkPath::PathRefDebugRef::swap(SkPath::PathRefDebugRef* other) {
- if (other->fPathRef.get() != fPathRef.get()) {
- other->fPathRef->removeOwner(other->fOwner);
- other->fPathRef->addOwner(fOwner);
-
- fPathRef->removeOwner(fOwner);
- fPathRef->addOwner(other->fOwner);
- }
-
- fPathRef.swap(&other->fPathRef);
-}
-
-SkPathRef* SkPath::PathRefDebugRef::get() const { return fPathRef.get(); }
-
-SkAutoTUnref<SkPathRef>::BlockRefType *SkPath::PathRefDebugRef::operator->() const {
- return fPathRef.operator->();
-}
-
-SkPath::PathRefDebugRef::operator SkPathRef*() {
- return fPathRef.operator SkPathRef *();
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////
-
-
SK_DEFINE_INST_COUNT(SkPath);
// This value is just made-up for now. When count is 4, calling memset was much
@@ -213,11 +160,7 @@ static bool compute_pt_bounds(SkRect* bounds, const SkPathRef& ref) {
#define INITIAL_LASTMOVETOINDEX_VALUE ~0
SkPath::SkPath()
-#if SK_DEBUG_PATH_REF
- : fPathRef(SkPathRef::CreateEmpty(), this)
-#else
: fPathRef(SkPathRef::CreateEmpty())
-#endif
#ifdef SK_BUILD_FOR_ANDROID
, fGenerationID(0)
#endif
@@ -242,11 +185,7 @@ void SkPath::resetFields() {
}
SkPath::SkPath(const SkPath& that)
-#if SK_DEBUG_PATH_REF
- : fPathRef(SkRef(that.fPathRef.get()), this)
-#else
: fPathRef(SkRef(that.fPathRef.get()))
-#endif
#ifdef SK_BUILD_FOR_ANDROID
, fGenerationID(0)
#endif
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkPathRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698