aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-04 17:55:15 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-04 17:55:15 +0000
commitdb6f36e78471f0798d1003f3e24bf0e8d2fe6b93 (patch)
tree21f89b5e31970e1b2f6b89c72981437d7975a294
parentcd3b15ca6364a04b0eeeb4f89c7daa8aefe854c8 (diff)
Remove problematic GrContext thread local instance counting
R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/104893002 git-svn-id: http://skia.googlecode.com/svn/trunk@12485 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/gpu/GrContext.h5
-rw-r--r--src/gpu/GrContext.cpp18
2 files changed, 0 insertions, 23 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 03665d7011..1770fa6ee4 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -50,11 +50,6 @@ public:
*/
static GrContext* Create(GrBackend, GrBackendContext);
- /**
- * Returns the number of GrContext instances for the current thread.
- */
- static int GetThreadInstanceCount();
-
virtual ~GrContext();
/**
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cab4414ae2..433b0bb06b 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -88,19 +88,7 @@ GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext)
}
}
-namespace {
-void* CreateThreadInstanceCount() {
- return SkNEW_ARGS(int, (0));
-}
-void DeleteThreadInstanceCount(void* v) {
- delete reinterpret_cast<int*>(v);
-}
-#define THREAD_INSTANCE_COUNT \
- (*reinterpret_cast<int*>(SkTLS::Get(CreateThreadInstanceCount, DeleteThreadInstanceCount)))
-}
-
GrContext::GrContext() {
- ++THREAD_INSTANCE_COUNT;
fDrawState = NULL;
fGpu = NULL;
fClip = NULL;
@@ -148,10 +136,6 @@ bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
return true;
}
-int GrContext::GetThreadInstanceCount() {
- return THREAD_INSTANCE_COUNT;
-}
-
GrContext::~GrContext() {
if (NULL == fGpu) {
return;
@@ -181,8 +165,6 @@ GrContext::~GrContext() {
SkSafeUnref(fPathRendererChain);
SkSafeUnref(fSoftwarePathRenderer);
fDrawState->unref();
-
- --THREAD_INSTANCE_COUNT;
}
void GrContext::contextLost() {