Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: src/gpu/GrContext.cpp

Issue 104893002: Remove problematic GrContext thread local instance counting (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cab4414ae256e1a28813d55ee8957268fbdd0e16..433b0bb06b24cd14b5e363595e7b6cad54eec64f 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() {
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698