diff options
author | 2018-06-08 12:00:44 -0600 | |
---|---|---|
committer | 2018-06-08 20:15:03 +0000 | |
commit | afa11586d782c7cb3e83b8af48023ff227349516 (patch) | |
tree | 384b990836f0da6ecb3a00788fdb4e806d2daeb7 /include | |
parent | 1471df99f0c7b5d9df43e7462d68a6635c3c59be (diff) |
Make the SkPathRef GenIDChangeListener ref counted
Bug: skia:
Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325
Reviewed-on: https://skia-review.googlesource.com/133502
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/private/SkPathRef.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h index 77d031f1d0..9ce1aeef2c 100644 --- a/include/private/SkPathRef.h +++ b/include/private/SkPathRef.h @@ -306,12 +306,12 @@ public: */ uint32_t genID() const; - struct GenIDChangeListener { + struct GenIDChangeListener : SkRefCnt { virtual ~GenIDChangeListener() {} virtual void onChange() = 0; }; - void addGenIDChangeListener(GenIDChangeListener* listener); + void addGenIDChangeListener(sk_sp<GenIDChangeListener>); bool isValid() const; SkDEBUGCODE(void validate() const { SkASSERT(this->isValid()); } ) @@ -538,7 +538,7 @@ 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 + SkTDArray<GenIDChangeListener*> fGenIDChangeListeners; // pointers are reffed mutable uint8_t fBoundsIsDirty; mutable SkBool8 fIsFinite; // only meaningful if bounds are valid |