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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 1040133002: Small change to move GrProcessor and GrBatch pools over to SkSpinlock (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 9 months 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 | « src/gpu/GrBatch.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProcessor.cpp
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 3b8cb679fd47b887897be5bb27262c5c9d935dbe..4bda2e18b6dd93c4fcc32f92515daf75386036d6 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -12,7 +12,7 @@
#include "GrInvariantOutput.h"
#include "GrMemoryPool.h"
#include "GrXferProcessor.h"
-#include "SkMutex.h"
+#include "SkSpinlock.h"
#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
@@ -97,17 +97,17 @@ const SkMatrix& TestMatrix(SkRandom* random) {
}
-// We use a global pool protected by a mutex. Chrome may use the same GrContext on different
-// threads. The GrContext is not used concurrently on different threads and there is a memory
-// barrier between accesses of a context on different threads. Also, there may be multiple
+// We use a global pool protected by a mutex(spinlock). Chrome may use the same GrContext on
+// different threads. The GrContext is not used concurrently on different threads and there is a
+// memory barrier between accesses of a context on different threads. Also, there may be multiple
// GrContexts and those contexts may be in use concurrently on different threads.
namespace {
-SK_DECLARE_STATIC_MUTEX(gProcessorPoolMutex);
+SK_DECLARE_STATIC_SPINLOCK(gProcessorSpinlock);
class MemoryPoolAccessor {
public:
- MemoryPoolAccessor() { gProcessorPoolMutex.acquire(); }
+ MemoryPoolAccessor() { gProcessorSpinlock.acquire(); }
- ~MemoryPoolAccessor() { gProcessorPoolMutex.release(); }
+ ~MemoryPoolAccessor() { gProcessorSpinlock.release(); }
GrMemoryPool* pool() const {
static GrMemoryPool gPool(4096, 4096);
« no previous file with comments | « src/gpu/GrBatch.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698