| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrContextFactory.h" | 9 #include "GrContextFactory.h" |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 Context& context = fContexts.push_back(); | 145 Context& context = fContexts.push_back(); |
| 146 context.fGLContext = glCtx.detach(); | 146 context.fGLContext = glCtx.detach(); |
| 147 context.fGrContext = SkRef(grCtx.get()); | 147 context.fGrContext = SkRef(grCtx.get()); |
| 148 context.fType = type; | 148 context.fType = type; |
| 149 context.fOptions = options; | 149 context.fOptions = options; |
| 150 return ContextInfo(context.fGrContext, context.fGLContext); | 150 return ContextInfo(context.fGrContext, context.fGLContext); |
| 151 } | 151 } |
| 152 |
| 153 void GrContextFactory::ReleaseGpuAPIsInThread() { |
| 154 #if SK_ANGLE |
| 155 SkANGLEGLContext::ReleaseGpuAPIsInThread(); |
| 156 #endif |
| 157 #if SK_COMMAND_BUFFER |
| 158 SkCommandBufferGLContext::ReleaseGpuAPIsInThread(); |
| 159 #endif |
| 160 #if SK_MESA |
| 161 SkMesaGLContext::ReleaseGpuAPIsInThread(); |
| 162 #endif |
| 163 // Call platform release the last, since the emulated APIs like command buff
er might use the |
| 164 // real APIs in this thread, too. |
| 165 SkReleasePlatformGLAPIsInThread(); |
| 166 } |
| OLD | NEW |