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

Unified Diff: include/core/SkPathRef.h

Issue 25716003: Make it explicit that some validate methods are debug only ... (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 | « no previous file | include/core/SkRefCnt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPathRef.h
===================================================================
--- include/core/SkPathRef.h (revision 11569)
+++ include/core/SkPathRef.h (working copy)
@@ -64,7 +64,7 @@
* return value is a pointer to where the points for the verb should be written.
*/
SkPoint* growForVerb(int /*SkPath::Verb*/ verb) {
- fPathRef->validate();
+ SkDEBUGCODE(fPathRef->validate();)
return fPathRef->growForVerb(verb);
}
@@ -78,14 +78,14 @@
void grow(int newVerbs, int newPts, uint8_t** verbs, SkPoint** pts) {
SkASSERT(NULL != verbs);
SkASSERT(NULL != pts);
- fPathRef->validate();
+ SkDEBUGCODE(fPathRef->validate();)
int oldVerbCnt = fPathRef->fVerbCnt;
int oldPointCnt = fPathRef->fPointCnt;
SkASSERT(verbs && pts);
fPathRef->grow(newVerbs, newPts);
*verbs = fPathRef->fVerbs - oldVerbCnt;
*pts = fPathRef->fPoints + oldPointCnt;
- fPathRef->validate();
+ SkDEBUGCODE(fPathRef->validate();)
}
/**
@@ -171,7 +171,7 @@
static void Rewind(SkAutoTUnref<SkPathRef>* pathRef);
virtual ~SkPathRef() {
- this->validate();
+ SkDEBUGCODE(this->validate();)
sk_free(fPoints);
SkDEBUGCODE(fPoints = NULL;)
@@ -183,13 +183,13 @@
SkDEBUGCODE(fEditorsAttached = 0x7777777;)
}
- int countPoints() const { this->validate(); return fPointCnt; }
- int countVerbs() const { this->validate(); return fVerbCnt; }
+ int countPoints() const { SkDEBUGCODE(this->validate();) return fPointCnt; }
+ int countVerbs() const { SkDEBUGCODE(this->validate();) return fVerbCnt; }
/**
* Returns a pointer one beyond the first logical verb (last verb in memory order).
*/
- const uint8_t* verbs() const { this->validate(); return fVerbs; }
+ const uint8_t* verbs() const { SkDEBUGCODE(this->validate();) return fVerbs; }
/**
* Returns a const pointer to the first verb in memory (which is the last logical verb).
@@ -199,15 +199,15 @@
/**
* Returns a const pointer to the first point.
*/
- const SkPoint* points() const { this->validate(); return fPoints; }
+ const SkPoint* points() const { SkDEBUGCODE(this->validate();) return fPoints; }
/**
* Shortcut for this->points() + this->countPoints()
*/
const SkPoint* pointsEnd() const { return this->points() + this->countPoints(); }
- const SkScalar* conicWeights() const { this->validate(); return fConicWeights.begin(); }
- const SkScalar* conicWeightsEnd() const { this->validate(); return fConicWeights.end(); }
+ const SkScalar* conicWeights() const { SkDEBUGCODE(this->validate();) return fConicWeights.begin(); }
+ const SkScalar* conicWeightsEnd() const { SkDEBUGCODE(this->validate();) return fConicWeights.end(); }
/**
* Convenience methods for getting to a verb or point by index.
@@ -247,7 +247,7 @@
fFreeSpace = 0;
fGenerationID = kEmptyGenID;
SkDEBUGCODE(fEditorsAttached = 0;)
- this->validate();
+ SkDEBUGCODE(this->validate();)
}
void copy(const SkPathRef& ref, int additionalReserveVerbs, int additionalReservePoints);
@@ -274,10 +274,10 @@
/** Makes additional room but does not change the counts or change the genID */
void incReserve(int additionalVerbs, int additionalPoints) {
- this->validate();
+ SkDEBUGCODE(this->validate();)
size_t space = additionalVerbs * sizeof(uint8_t) + additionalPoints * sizeof (SkPoint);
this->makeSpace(space);
- this->validate();
+ SkDEBUGCODE(this->validate();)
}
/** Resets the path ref with verbCount verbs and pointCount points, all uninitialized. Also
@@ -290,14 +290,14 @@
* are uninitialized.
*/
void grow(int newVerbs, int newPoints) {
- this->validate();
+ SkDEBUGCODE(this->validate();)
size_t space = newVerbs * sizeof(uint8_t) + newPoints * sizeof (SkPoint);
this->makeSpace(space);
fVerbCnt += newVerbs;
fPointCnt += newPoints;
fFreeSpace -= space;
fBoundsIsDirty = true; // this also invalidates fIsFinite
- this->validate();
+ SkDEBUGCODE(this->validate();)
}
/**
@@ -317,7 +317,7 @@
* Private, non-const-ptr version of the public function verbsMemBegin().
*/
uint8_t* verbsMemWritable() {
- this->validate();
+ SkDEBUGCODE(this->validate();)
return fVerbs - fVerbCnt;
}
@@ -336,7 +336,7 @@
*/
int32_t genID() const;
- void validate() const;
+ SkDEBUGCODE(void validate() const;)
enum {
kMinSize = 256,
« no previous file with comments | « no previous file | include/core/SkRefCnt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698