aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/convexpaths.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-17 17:55:02 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-17 17:55:02 +0000
commit2ab1ba055536825552d6b49f0210c4e1531f02f0 (patch)
treeeb9064b98d3cf57316bd1586c4ba09f41f432aea /gm/convexpaths.cpp
parent7322893af0f94c68401bc01677e9dcfca586d5b4 (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 when Skia is built as a static library. Having SK_DECLARE_INST_COUNT without SK_DEFINE_INST_COUNT relies on static variables in member functions declared in the header files. These might be duplicated in the clients of the library when Skia is built as a dynamic library, producing incorrect operation. 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 R=robertphillips@google.com, mtklein@google.com, bsalomon@google.com, bungeman@google.com, djsollen@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/99483003 git-svn-id: http://skia.googlecode.com/svn/trunk@13120 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/convexpaths.cpp')
-rw-r--r--gm/convexpaths.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp
index 8eb4cba49d..91afbfeba3 100644
--- a/gm/convexpaths.cpp
+++ b/gm/convexpaths.cpp
@@ -9,9 +9,9 @@
#include "SkRandom.h"
#include "SkTArray.h"
-class SkOnce : SkNoncopyable {
+class SkDoOnce : SkNoncopyable {
public:
- SkOnce() { fDidOnce = false; }
+ SkDoOnce() { fDidOnce = false; }
bool needToDo() const { return !fDidOnce; }
bool alreadyDone() const { return fDidOnce; }
@@ -27,7 +27,7 @@ private:
namespace skiagm {
class ConvexPathsGM : public GM {
- SkOnce fOnce;
+ SkDoOnce fOnce;
public:
ConvexPathsGM() {
this->setBGColor(0xFF000000);