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

Unified Diff: include/core/SkPathRef.h

Issue 1114353004: Implement vertex buffer caching in the tessellated path renderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Merge resource cache fix, leak fix, inverse winding fix Created 5 years, 4 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/gpu/GrResourceKey.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPathRef.h
diff --git a/include/core/SkPathRef.h b/include/core/SkPathRef.h
index e7cc31cff43ef6d2947c822626a0709a034c6077..c09f6e87e471c1d8320a11156ef9dc64d0dbb92a 100644
--- a/include/core/SkPathRef.h
+++ b/include/core/SkPathRef.h
@@ -180,19 +180,7 @@ public:
*/
static void Rewind(SkAutoTUnref<SkPathRef>* pathRef);
- virtual ~SkPathRef() {
- SkDEBUGCODE(this->validate();)
- sk_free(fPoints);
-
- SkDEBUGCODE(fPoints = NULL;)
- SkDEBUGCODE(fVerbs = NULL;)
- SkDEBUGCODE(fVerbCnt = 0x9999999;)
- SkDEBUGCODE(fPointCnt = 0xAAAAAAA;)
- SkDEBUGCODE(fPointCnt = 0xBBBBBBB;)
- SkDEBUGCODE(fGenerationID = 0xEEEEEEEE;)
- SkDEBUGCODE(fEditorsAttached = 0x7777777;)
- }
-
+ virtual ~SkPathRef();
int countPoints() const { SkDEBUGCODE(this->validate();) return fPointCnt; }
int countVerbs() const { SkDEBUGCODE(this->validate();) return fVerbCnt; }
int countWeights() const { SkDEBUGCODE(this->validate();) return fConicWeights.count(); }
@@ -251,6 +239,13 @@ public:
*/
uint32_t genID() const;
+ struct GenIDChangeListener {
+ virtual ~GenIDChangeListener() {}
+ virtual void onChange() = 0;
+ };
+
+ void addGenIDChangeListener(GenIDChangeListener* listener);
+
SkDEBUGCODE(void validate() const;)
private:
@@ -422,6 +417,8 @@ private:
return fPoints;
}
+ void callGenIDChangeListeners();
+
enum {
kMinSize = 256,
};
@@ -446,6 +443,8 @@ private:
mutable uint32_t fGenerationID;
SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use at any time.
+ SkTDArray<GenIDChangeListener*> fGenIDChangeListeners; // pointers are owned
+
friend class PathRefTest_Private;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « no previous file | include/gpu/GrResourceKey.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698