| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrProcessor.h" | 8 #include "GrProcessor.h" |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 #include "GrGeometryProcessor.h" | 10 #include "GrGeometryProcessor.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 #endif | 76 #endif |
| 77 | 77 |
| 78 | 78 |
| 79 // We use a global pool protected by a mutex(spinlock). Chrome may use the same
GrContext on | 79 // We use a global pool protected by a mutex(spinlock). Chrome may use the same
GrContext on |
| 80 // different threads. The GrContext is not used concurrently on different thread
s and there is a | 80 // different threads. The GrContext is not used concurrently on different thread
s and there is a |
| 81 // memory barrier between accesses of a context on different threads. Also, ther
e may be multiple | 81 // memory barrier between accesses of a context on different threads. Also, ther
e may be multiple |
| 82 // GrContexts and those contexts may be in use concurrently on different threads
. | 82 // GrContexts and those contexts may be in use concurrently on different threads
. |
| 83 namespace { | 83 namespace { |
| 84 static SkSpinlock gProcessorSpinlock; | 84 //static SkSpinlock gProcessorSpinlock; |
| 85 class MemoryPoolAccessor { | 85 class MemoryPoolAccessor { |
| 86 public: | 86 public: |
| 87 MemoryPoolAccessor() { gProcessorSpinlock.acquire(); } | 87 MemoryPoolAccessor() { /*gProcessorSpinlock.acquire();*/ } |
| 88 | 88 |
| 89 ~MemoryPoolAccessor() { gProcessorSpinlock.release(); } | 89 ~MemoryPoolAccessor() { /*gProcessorSpinlock.release();*/ } |
| 90 | 90 |
| 91 GrMemoryPool* pool() const { | 91 GrMemoryPool* pool() const { |
| 92 static GrMemoryPool gPool(4096, 4096); | 92 static GrMemoryPool gPool(4096, 4096); |
| 93 return &gPool; | 93 return &gPool; |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 } | 96 } |
| 97 | 97 |
| 98 int32_t GrProcessor::gCurrProcessorClassID = GrProcessor::kIllegalProcessorClass
ID; | 98 int32_t GrProcessor::gCurrProcessorClassID = GrProcessor::kIllegalProcessorClass
ID; |
| 99 | 99 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 return true; | 136 return true; |
| 137 } | 137 } |
| 138 | 138 |
| 139 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 139 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 140 | 140 |
| 141 // Initial static variable from GrXPFactory | 141 // Initial static variable from GrXPFactory |
| 142 int32_t GrXPFactory::gCurrXPFClassID = | 142 int32_t GrXPFactory::gCurrXPFClassID = |
| 143 GrXPFactory::kIllegalXPFClassID; | 143 GrXPFactory::kIllegalXPFClassID; |
| OLD | NEW |