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

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

Issue 2024953002: Move GL one-off initialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_x11
Patch Set: Delete GLInitializer class. Created 4 years, 6 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
« no previous file with comments | « ui/gl/gl_implementation.h ('k') | ui/gl/gl_surface.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_SURFACE_H_ 5 #ifndef UI_GL_GL_SURFACE_H_
6 #define UI_GL_GL_SURFACE_H_ 6 #define UI_GL_GL_SURFACE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // overlays account for all the damage. 121 // overlays account for all the damage.
122 virtual gfx::SwapResult CommitOverlayPlanes(); 122 virtual gfx::SwapResult CommitOverlayPlanes();
123 123
124 // Show overlay planes but don't swap the front and back buffers. On some 124 // Show overlay planes but don't swap the front and back buffers. On some
125 // platforms, we want to send SwapBufferAck only after the overlays are 125 // platforms, we want to send SwapBufferAck only after the overlays are
126 // displayed on screen. The callback can be used to delay sending 126 // displayed on screen. The callback can be used to delay sending
127 // SwapBufferAck till that data is available. The callback should be run on 127 // SwapBufferAck till that data is available. The callback should be run on
128 // the calling thread (i.e. same thread CommitOverlayPlanesAsync is called). 128 // the calling thread (i.e. same thread CommitOverlayPlanesAsync is called).
129 virtual void CommitOverlayPlanesAsync(const SwapCompletionCallback& callback); 129 virtual void CommitOverlayPlanesAsync(const SwapCompletionCallback& callback);
130 130
131 // Initialize GL bindings.
132 // DEPRECATED(kylechar): Use gl::init::InitializeGLOneOff from gl_factory.h.
133 static bool InitializeOneOff();
134
135 // Called after a context is made current with this surface. Returns false 131 // Called after a context is made current with this surface. Returns false
136 // on error. 132 // on error.
137 virtual bool OnMakeCurrent(GLContext* context); 133 virtual bool OnMakeCurrent(GLContext* context);
138 134
139 // Used for explicit buffer management. 135 // Used for explicit buffer management.
140 virtual bool SetBackbufferAllocation(bool allocated); 136 virtual bool SetBackbufferAllocation(bool allocated);
141 virtual void SetFrontbufferAllocation(bool allocated); 137 virtual void SetFrontbufferAllocation(bool allocated);
142 138
143 // Get a handle used to share the surface with another process. Returns null 139 // Get a handle used to share the surface with another process. Returns null
144 // if this is not possible. 140 // if this is not possible.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( 215 static scoped_refptr<GLSurface> CreateOffscreenGLSurface(
220 const gfx::Size& size); 216 const gfx::Size& size);
221 217
222 static GLSurface* GetCurrent(); 218 static GLSurface* GetCurrent();
223 219
224 // Called when the swap interval for the associated context changes. 220 // Called when the swap interval for the associated context changes.
225 virtual void OnSetSwapInterval(int interval); 221 virtual void OnSetSwapInterval(int interval);
226 222
227 protected: 223 protected:
228 virtual ~GLSurface(); 224 virtual ~GLSurface();
229 static bool InitializeOneOffImplementation(GLImplementation impl, 225
230 bool fallback_to_osmesa,
231 bool gpu_service_logging,
232 bool disable_gl_drawing);
233 static bool InitializeOneOffInternal();
234 static void SetCurrent(GLSurface* surface); 226 static void SetCurrent(GLSurface* surface);
235 227
236 static bool ExtensionsContain(const char* extensions, const char* name); 228 static bool ExtensionsContain(const char* extensions, const char* name);
237 229
238 private: 230 private:
239 friend class base::RefCounted<GLSurface>; 231 friend class base::RefCounted<GLSurface>;
240 friend class GLContext; 232 friend class GLContext;
241 friend class GLSurfaceTestSupport;
242 233
243 DISALLOW_COPY_AND_ASSIGN(GLSurface); 234 DISALLOW_COPY_AND_ASSIGN(GLSurface);
244 }; 235 };
245 236
246 // Implementation of GLSurface that forwards all calls through to another 237 // Implementation of GLSurface that forwards all calls through to another
247 // GLSurface. 238 // GLSurface.
248 class GL_EXPORT GLSurfaceAdapter : public GLSurface { 239 class GL_EXPORT GLSurfaceAdapter : public GLSurface {
249 public: 240 public:
250 explicit GLSurfaceAdapter(GLSurface* surface); 241 explicit GLSurfaceAdapter(GLSurface* surface);
251 242
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 289
299 private: 290 private:
300 scoped_refptr<GLSurface> surface_; 291 scoped_refptr<GLSurface> surface_;
301 292
302 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); 293 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter);
303 }; 294 };
304 295
305 } // namespace gl 296 } // namespace gl
306 297
307 #endif // UI_GL_GL_SURFACE_H_ 298 #endif // UI_GL_GL_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation.h ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698