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

Unified Diff: src/gpu/batches/GrBatch.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 | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrBatch.cpp
diff --git a/src/gpu/batches/GrBatch.cpp b/src/gpu/batches/GrBatch.cpp
index 50f94b3902fbbdbc134a0bf672359608f6283d21..6755cf94f76a788bcbdfa5a4dd0ae48a2874330f 100644
--- a/src/gpu/batches/GrBatch.cpp
+++ b/src/gpu/batches/GrBatch.cpp
@@ -23,9 +23,15 @@ namespace {
static SkSpinlock gBatchSpinlock;
class MemoryPoolAccessor {
public:
- MemoryPoolAccessor() { gBatchSpinlock.acquire(); }
+// We know in the Android framework there is only one GrContext.
+#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
+ MemoryPoolAccessor() {}
+ ~MemoryPoolAccessor() {}
+#else
+ MemoryPoolAccessor() { gBatchSpinlock.acquire(); }
~MemoryPoolAccessor() { gBatchSpinlock.release(); }
+#endif
GrMemoryPool* pool() const {
static GrMemoryPool gPool(16384, 16384);
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698