4ae94ffce5
These getRefCnt() methods are not thread safe, so Skia code should not be calling them. unique() is fine. SkDEBUG code (SkASSERTs) can still call getRefCnt() / getWeakRefCnt(). This adds tools/RefCntIs.{h,cpp}, which lets tests make their assertions in both debug and release modes. BUG=skia:2726 R=senorblanco@chromium.org, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/378643003
10 lines
195 B
C++
10 lines
195 B
C++
#include "RefCntIs.h"
|
|
|
|
bool RefCntIs(const SkRefCntBase& obj, int32_t n) {
|
|
return obj.fRefCnt == n;
|
|
}
|
|
|
|
bool WeakRefCntIs(const SkWeakRefCnt& obj, int32_t n) {
|
|
return obj.fWeakCnt == n;
|
|
}
|