From afa11586d782c7cb3e83b8af48023ff227349516 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Fri, 8 Jun 2018 12:00:44 -0600 Subject: Make the SkPathRef GenIDChangeListener ref counted Bug: skia: Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325 Reviewed-on: https://skia-review.googlesource.com/133502 Reviewed-by: Brian Salomon Commit-Queue: Chris Dalton --- include/private/SkPathRef.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') 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); 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 fGenIDChangeListeners; // pointers are owned + SkTDArray fGenIDChangeListeners; // pointers are reffed mutable uint8_t fBoundsIsDirty; mutable SkBool8 fIsFinite; // only meaningful if bounds are valid -- cgit v1.2.3