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
14 lines
340 B
C
14 lines
340 B
C
#ifndef RefCntIs_DEFINED
|
|
#define RefCntIs_DEFINED
|
|
|
|
// Allows tests to assert a particular value for a ref count,
|
|
// without letting Skia library code look at that value.
|
|
|
|
#include "SkRefCnt.h"
|
|
#include "SkWeakRefCnt.h"
|
|
|
|
bool RefCntIs(const SkRefCntBase&, int32_t);
|
|
bool WeakRefCntIs(const SkWeakRefCnt&, int32_t);
|
|
|
|
#endif//RefCntIs_DEFINED
|