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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 2293633003: Skip spinlock overhead on Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comments Created 4 years, 4 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 | « no previous file | src/gpu/batches/GrBatch.cpp » ('j') | 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 29482ccc63f90a154cd5bc5bc025c34721e82e22..b945b027f20986d0348d5699f85524e418e10550 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -84,9 +84,15 @@ namespace {
static SkSpinlock gProcessorSpinlock;
class MemoryPoolAccessor {
public:
- MemoryPoolAccessor() { gProcessorSpinlock.acquire(); }
+// We know in the Android framework there is only one GrContext.
+#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
+ MemoryPoolAccessor() {}
+ ~MemoryPoolAccessor() {}
+#else
+ MemoryPoolAccessor() { gProcessorSpinlock.acquire(); }
~MemoryPoolAccessor() { gProcessorSpinlock.release(); }
+#endif
GrMemoryPool* pool() const {
static GrMemoryPool gPool(4096, 4096);
« no previous file with comments | « no previous file | src/gpu/batches/GrBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698