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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 (*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo); | 119 (*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo); |
120 } | 120 } |
121 | 121 |
122 delete fResourceProvider; | 122 delete fResourceProvider; |
123 delete fResourceCache; | 123 delete fResourceCache; |
124 delete fBatchFontCache; | 124 delete fBatchFontCache; |
125 | 125 |
126 fGpu->unref(); | 126 fGpu->unref(); |
127 fCaps->unref(); | 127 fCaps->unref(); |
128 } | 128 } |
129 | 129 |
robertphillips
2016/03/08 18:43:10
Should we make threadSafeProxy thread safe itself?
bsalomon
2016/03/08 19:49:32
GrContext is not thread-safe so I don't think this
| |
130 GrContextThreadSafeProxy* GrContext::threadSafeProxy() { | |
131 if (!fThreadSafeProxy) { | |
132 fThreadSafeProxy.reset(new GrContextThreadSafeProxy(fCaps, this->uniqueI D())); | |
133 } | |
134 return SkRef(fThreadSafeProxy.get()); | |
135 } | |
136 | |
130 void GrContext::abandonContext() { | 137 void GrContext::abandonContext() { |
131 ASSERT_SINGLE_OWNER | 138 ASSERT_SINGLE_OWNER |
132 | 139 |
133 fResourceProvider->abandon(); | 140 fResourceProvider->abandon(); |
134 | 141 |
135 // Need to abandon the drawing manager first so all the render targets | 142 // Need to abandon the drawing manager first so all the render targets |
136 // will be released/forgotten before they too are abandoned. | 143 // will be released/forgotten before they too are abandoned. |
137 fDrawingManager->abandon(); | 144 fDrawingManager->abandon(); |
138 | 145 |
139 // abandon first to so destructors | 146 // abandon first to so destructors |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 ASSERT_SINGLE_OWNER | 669 ASSERT_SINGLE_OWNER |
663 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 670 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
664 } | 671 } |
665 | 672 |
666 ////////////////////////////////////////////////////////////////////////////// | 673 ////////////////////////////////////////////////////////////////////////////// |
667 | 674 |
668 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 675 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
669 ASSERT_SINGLE_OWNER | 676 ASSERT_SINGLE_OWNER |
670 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 677 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
671 } | 678 } |
OLD | NEW |