Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1199)

Side by Side Diff: gpu/command_buffer/client/gles2_lib.cc

Issue 566021: [GPU] GLES2 lost context recovery (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/gles2_demo_cc.cc ('k') | gpu/command_buffer/common/constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/client/gles2_lib.h" 5 #include "gpu/command_buffer/client/gles2_lib.h"
6 #include "gpu/command_buffer/common/thread_local.h" 6 #include "gpu/command_buffer/common/thread_local.h"
7 7
8 namespace gles2 { 8 namespace gles2 {
9 namespace { 9 namespace {
10 gpu::ThreadLocalKey g_gl_context_key; 10 gpu::ThreadLocalKey g_gl_context_key;
11 } // namespace anonymous 11 } // namespace anonymous
12 12
13 void Initialize() { 13 void Initialize() {
14 g_gl_context_key = gpu::ThreadLocalAlloc(); 14 g_gl_context_key = gpu::ThreadLocalAlloc();
15 } 15 }
16 16
17 void Terminate() { 17 void Terminate() {
18 gpu::ThreadLocalFree(g_gl_context_key); 18 gpu::ThreadLocalFree(g_gl_context_key);
19 g_gl_context_key = 0;
19 } 20 }
20 21
21 gpu::gles2::GLES2Implementation* GetGLContext() { 22 gpu::gles2::GLES2Implementation* GetGLContext() {
22 return static_cast<gpu::gles2::GLES2Implementation*>( 23 return static_cast<gpu::gles2::GLES2Implementation*>(
23 gpu::ThreadLocalGetValue(g_gl_context_key)); 24 gpu::ThreadLocalGetValue(g_gl_context_key));
24 } 25 }
25 26
26 void SetGLContext(gpu::gles2::GLES2Implementation* context) { 27 void SetGLContext(gpu::gles2::GLES2Implementation* context) {
27 gpu::ThreadLocalSetValue(g_gl_context_key, context); 28 gpu::ThreadLocalSetValue(g_gl_context_key, context);
28 } 29 }
29 } // namespace gles2 30 } // namespace gles2
30 31
31 32
32 33
33 34
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_demo_cc.cc ('k') | gpu/command_buffer/common/constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698