diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-14 18:42:26 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-14 18:42:26 +0000 |
commit | 46de153d4e887d82b5309316ed2e26e5cdc291f0 (patch) | |
tree | 8820c146416978a32d3ec5b50e70ba58e7b292e1 /gm/colormatrix.cpp | |
parent | d0c53f1d51f75e56b2e48fe5596ef4671aaa6302 (diff) |
Make leak counters thread-safe and turn them on by default for Debug
Make leak counters implemented with SK_DECLARE_INST_COUNT thread-safe.
Enable the leak counting for Debug builds.
Protect the instance counter initialization step (initStep) by
using SkOnce.
Makes SkOnce.h part of the public API, since SkInstCnt is public.
Protect the per-class child list shared variable with a per-class mutex.
Changes the behavior in the way that if the child list has been
"cleaned up", it will still try to create subsequent child lists.
BUG=skia:1219
Committed: http://code.google.com/p/skia/source/detail?r=12635
R=robertphillips@google.com, mtklein@google.com, bsalomon@google.com, bungeman@google.com
Author: kkinnunen@nvidia.com
Review URL: https://codereview.chromium.org/99483003
git-svn-id: http://skia.googlecode.com/svn/trunk@13068 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/colormatrix.cpp')
-rw-r--r-- | gm/colormatrix.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gm/colormatrix.cpp b/gm/colormatrix.cpp index 9ab6563040..2f98693da2 100644 --- a/gm/colormatrix.cpp +++ b/gm/colormatrix.cpp @@ -12,9 +12,9 @@ #define WIDTH 500 #define HEIGHT 500 -class SkOnce { +class SkDoOnce { public: - SkOnce() : fOnce(false) {}; + SkDoOnce() : fOnce(false) {}; bool once() const { if (fOnce) { @@ -39,7 +39,7 @@ static void setArray(SkPaint* paint, const SkScalar array[]) { namespace skiagm { class ColorMatrixGM : public GM { - SkOnce fOnce; + SkDoOnce fOnce; void init() { if (fOnce.once()) { fSolidBitmap = this->createSolidBitmap(64, 64); |