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

Side by Side Diff: ui/gl/gl_context.h

Issue 221433004: gpu: Bind dummy GL API when no context is current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix two gpu unittests Created 6 years, 8 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 | « ui/gl/generate_bindings.py ('k') | ui/gl/gl_context.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_GL_GL_CONTEXT_H_ 5 #ifndef UI_GL_GL_CONTEXT_H_
6 #define UI_GL_GL_CONTEXT_H_ 6 #define UI_GL_GL_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // Returns the GL version string. The context must be current. 111 // Returns the GL version string. The context must be current.
112 virtual std::string GetGLVersion(); 112 virtual std::string GetGLVersion();
113 113
114 // Returns the GL renderer string. The context must be current. 114 // Returns the GL renderer string. The context must be current.
115 virtual std::string GetGLRenderer(); 115 virtual std::string GetGLRenderer();
116 116
117 protected: 117 protected:
118 virtual ~GLContext(); 118 virtual ~GLContext();
119 119
120 // Will release the current context when going out of scope, unless canceled.
121 class ScopedReleaseCurrent {
122 public:
123 ScopedReleaseCurrent();
124 ~ScopedReleaseCurrent();
125
126 void Cancel();
127
128 private:
129 bool canceled_;
130 };
131
120 // Sets the GL api to the real hardware API (vs the VirtualAPI) 132 // Sets the GL api to the real hardware API (vs the VirtualAPI)
121 static void SetRealGLApi(); 133 static void SetRealGLApi();
122 virtual void SetCurrent(GLSurface* surface); 134 virtual void SetCurrent(GLSurface* surface);
123 135
124 // Initialize function pointers to functions where the bound version depends 136 // Initialize function pointers to functions where the bound version depends
125 // on GL version or supported extensions. Should be called immediately after 137 // on GL version or supported extensions. Should be called immediately after
126 // this context is made current. 138 // this context is made current.
127 bool InitializeDynamicBindings(); 139 bool InitializeDynamicBindings();
128 140
129 // Returns the last real (non-virtual) GLContext made current. 141 // Returns the last real (non-virtual) GLContext made current.
(...skipping 22 matching lines...) Expand all
152 164
153 virtual void SetCurrent(GLSurface* surface) OVERRIDE; 165 virtual void SetCurrent(GLSurface* surface) OVERRIDE;
154 166
155 private: 167 private:
156 DISALLOW_COPY_AND_ASSIGN(GLContextReal); 168 DISALLOW_COPY_AND_ASSIGN(GLContextReal);
157 }; 169 };
158 170
159 } // namespace gfx 171 } // namespace gfx
160 172
161 #endif // UI_GL_GL_CONTEXT_H_ 173 #endif // UI_GL_GL_CONTEXT_H_
OLDNEW
« no previous file with comments | « ui/gl/generate_bindings.py ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698