Remove hack allowing fRefCnt of 0.

In some legacy situations users of SkRefCnt subclasses were keeping
the objects alive with a reference count of 0. Now that these users are
cleaned up, remove the hack which allowed such code to keep functioning.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3264

Change-Id: I22f63d87b6d995cad6326998284930ad9eaa2983
Reviewed-on: https://skia-review.googlesource.com/3264
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2016-10-12 11:04:25 -04:00 committed by Skia Commit-Bot
parent 96b333a9a1
commit 81f4b0d1e0

View File

@ -71,15 +71,7 @@ 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. This breaks
// the use of unique() on such objects and as such should be removed
// once the Android code is fixed.
SkASSERT(getRefCnt() >= 0);
#else
SkASSERT(getRefCnt() > 0);
#endif
// No barrier required.
(void)fRefCnt.fetch_add(+1, std::memory_order_relaxed);
}