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 "GrContextPriv.h" | 9 #include "GrContextPriv.h" |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 delete fResourceProvider; | 127 delete fResourceProvider; |
128 delete fResourceCache; | 128 delete fResourceCache; |
129 delete fBatchFontCache; | 129 delete fBatchFontCache; |
130 | 130 |
131 fGpu->unref(); | 131 fGpu->unref(); |
132 fCaps->unref(); | 132 fCaps->unref(); |
133 } | 133 } |
134 | 134 |
135 GrContextThreadSafeProxy* GrContext::threadSafeProxy() { | 135 sk_sp<GrContextThreadSafeProxy> GrContext::threadSafeProxy() { |
136 if (!fThreadSafeProxy) { | 136 if (!fThreadSafeProxy) { |
137 fThreadSafeProxy.reset(new GrContextThreadSafeProxy(fCaps, this->uniqueI
D())); | 137 fThreadSafeProxy.reset(new GrContextThreadSafeProxy(sk_ref_sp(fCaps), th
is->uniqueID())); |
138 } | 138 } |
139 return SkRef(fThreadSafeProxy.get()); | 139 return fThreadSafeProxy; |
140 } | 140 } |
141 | 141 |
142 void GrContext::abandonContext() { | 142 void GrContext::abandonContext() { |
143 ASSERT_SINGLE_OWNER | 143 ASSERT_SINGLE_OWNER |
144 | 144 |
145 fResourceProvider->abandon(); | 145 fResourceProvider->abandon(); |
146 | 146 |
147 // Need to abandon the drawing manager first so all the render targets | 147 // Need to abandon the drawing manager first so all the render targets |
148 // will be released/forgotten before they too are abandoned. | 148 // will be released/forgotten before they too are abandoned. |
149 fDrawingManager->abandon(); | 149 fDrawingManager->abandon(); |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 ASSERT_SINGLE_OWNER | 834 ASSERT_SINGLE_OWNER |
835 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 835 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
836 } | 836 } |
837 | 837 |
838 ////////////////////////////////////////////////////////////////////////////// | 838 ////////////////////////////////////////////////////////////////////////////// |
839 | 839 |
840 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 840 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
841 ASSERT_SINGLE_OWNER | 841 ASSERT_SINGLE_OWNER |
842 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 842 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
843 } | 843 } |
OLD | NEW |