OLD | NEW |
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_GL_API_IMPLEMENTATION_H_ | 5 #ifndef UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
6 #define UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 6 #define UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 // Include the auto-generated part of this class. We split this because | 35 // Include the auto-generated part of this class. We split this because |
36 // it means we can easily edit the non-auto generated parts right here in | 36 // it means we can easily edit the non-auto generated parts right here in |
37 // this file instead of having to edit some template or the code generator. | 37 // this file instead of having to edit some template or the code generator. |
38 #include "gl_bindings_api_autogen_gl.h" | 38 #include "gl_bindings_api_autogen_gl.h" |
39 | 39 |
40 protected: | 40 protected: |
41 GLApiBase(); | 41 GLApiBase(); |
42 virtual ~GLApiBase(); | 42 virtual ~GLApiBase(); |
43 void InitializeBase(DriverGL* driver); | 43 void InitializeBase(DriverGL* driver); |
| 44 void SignalFlush(); |
44 | 45 |
45 DriverGL* driver_; | 46 DriverGL* driver_; |
46 }; | 47 }; |
47 | 48 |
48 // Implemenents the GL API by calling directly into the driver. | 49 // Implemenents the GL API by calling directly into the driver. |
49 class RealGLApi : public GLApiBase { | 50 class RealGLApi : public GLApiBase { |
50 public: | 51 public: |
51 RealGLApi(); | 52 RealGLApi(); |
52 virtual ~RealGLApi(); | 53 virtual ~RealGLApi(); |
53 void Initialize(DriverGL* driver); | 54 void Initialize(DriverGL* driver); |
| 55 |
| 56 private: |
| 57 virtual void glFinishFn() OVERRIDE; |
| 58 virtual void glFlushFn() OVERRIDE; |
54 }; | 59 }; |
55 | 60 |
56 // Inserts a TRACE for every GL call. | 61 // Inserts a TRACE for every GL call. |
57 class TraceGLApi : public GLApi { | 62 class TraceGLApi : public GLApi { |
58 public: | 63 public: |
59 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } | 64 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } |
60 virtual ~TraceGLApi(); | 65 virtual ~TraceGLApi(); |
61 | 66 |
62 // Include the auto-generated part of this class. We split this because | 67 // Include the auto-generated part of this class. We split this because |
63 // it means we can easily edit the non-auto generated parts right here in | 68 // it means we can easily edit the non-auto generated parts right here in |
(...skipping 23 matching lines...) Expand all Loading... |
87 public: | 92 public: |
88 VirtualGLApi(); | 93 VirtualGLApi(); |
89 virtual ~VirtualGLApi(); | 94 virtual ~VirtualGLApi(); |
90 void Initialize(DriverGL* driver, GLContext* real_context); | 95 void Initialize(DriverGL* driver, GLContext* real_context); |
91 | 96 |
92 // Sets the current virutal context. | 97 // Sets the current virutal context. |
93 bool MakeCurrent(GLContext* virtual_context, GLSurface* surface); | 98 bool MakeCurrent(GLContext* virtual_context, GLSurface* surface); |
94 | 99 |
95 void OnReleaseVirtuallyCurrent(GLContext* virtual_context); | 100 void OnReleaseVirtuallyCurrent(GLContext* virtual_context); |
96 | 101 |
| 102 private: |
97 // Overridden functions from GLApiBase | 103 // Overridden functions from GLApiBase |
98 virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE; | 104 virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE; |
| 105 virtual void glFinishFn() OVERRIDE; |
| 106 virtual void glFlushFn() OVERRIDE; |
99 | 107 |
100 private: | |
101 // The real context we're running on. | 108 // The real context we're running on. |
102 GLContext* real_context_; | 109 GLContext* real_context_; |
103 | 110 |
104 // The current virtual context. | 111 // The current virtual context. |
105 GLContext* current_context_; | 112 GLContext* current_context_; |
106 | 113 |
107 // The supported extensions being advertised for this virtual context. | 114 // The supported extensions being advertised for this virtual context. |
108 std::string extensions_; | 115 std::string extensions_; |
109 }; | 116 }; |
110 | 117 |
111 } // namespace gfx | 118 } // namespace gfx |
112 | 119 |
113 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 120 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |