Chromium Code Reviews| Index: include/core/SkRefCnt.h |
| diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h |
| index bf97dc8560529a4d5aa09d635043e4369d0cc5a2..94df80935a90d48d3a39a915f9a89e6b91077aa5 100644 |
| --- a/include/core/SkRefCnt.h |
| +++ b/include/core/SkRefCnt.h |
| @@ -57,7 +57,13 @@ public: |
| /** Increment the reference count. Must be balanced by a call to unref(). |
| */ |
| void ref() const { |
| +#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| + // Android employs some special subclasses that enable the fRefCnt to |
| + // go to zero, but not below, prior to reusing the object. |
|
bungeman-skia
2015/08/21 21:44:35
So after much back and forth and looking into this
djsollen
2015/08/24 12:25:43
Done.
|
| + SkASSERT(fRefCnt >= 0); |
| +#else |
| SkASSERT(fRefCnt > 0); |
| +#endif |
| (void)sk_atomic_fetch_add(&fRefCnt, +1, sk_memory_order_relaxed); // No barrier required. |
| } |