OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrContext.h" | 8 #include "GrContext.h" |
9 #include "GrContextOptions.h" | 9 #include "GrContextOptions.h" |
10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 delete fResourceProvider; | 123 delete fResourceProvider; |
124 delete fResourceCache; | 124 delete fResourceCache; |
125 delete fBatchFontCache; | 125 delete fBatchFontCache; |
126 | 126 |
127 fGpu->unref(); | 127 fGpu->unref(); |
128 fCaps->unref(); | 128 fCaps->unref(); |
129 } | 129 } |
130 | 130 |
| 131 GrContextThreadSafeProxy* GrContext::threadSafeProxy() { |
| 132 if (!fThreadSafeProxy) { |
| 133 fThreadSafeProxy.reset(new GrContextThreadSafeProxy(fCaps, this->uniqueI
D())); |
| 134 } |
| 135 return SkRef(fThreadSafeProxy.get()); |
| 136 } |
| 137 |
131 void GrContext::abandonContext() { | 138 void GrContext::abandonContext() { |
132 ASSERT_SINGLE_OWNER | 139 ASSERT_SINGLE_OWNER |
133 | 140 |
134 fResourceProvider->abandon(); | 141 fResourceProvider->abandon(); |
135 | 142 |
136 // Need to abandon the drawing manager first so all the render targets | 143 // Need to abandon the drawing manager first so all the render targets |
137 // will be released/forgotten before they too are abandoned. | 144 // will be released/forgotten before they too are abandoned. |
138 fDrawingManager->abandon(); | 145 fDrawingManager->abandon(); |
139 | 146 |
140 // abandon first to so destructors | 147 // abandon first to so destructors |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 ASSERT_SINGLE_OWNER | 670 ASSERT_SINGLE_OWNER |
664 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 671 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
665 } | 672 } |
666 | 673 |
667 ////////////////////////////////////////////////////////////////////////////// | 674 ////////////////////////////////////////////////////////////////////////////// |
668 | 675 |
669 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 676 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
670 ASSERT_SINGLE_OWNER | 677 ASSERT_SINGLE_OWNER |
671 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 678 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
672 } | 679 } |
OLD | NEW |