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 #include "ui/gl/gl_export.h" | 10 #include "ui/gl/gl_export.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 }; | 50 }; |
51 | 51 |
52 // Implemenents the GL API by calling directly into the driver. | 52 // Implemenents the GL API by calling directly into the driver. |
53 class RealGLApi : public GLApiBase { | 53 class RealGLApi : public GLApiBase { |
54 public: | 54 public: |
55 RealGLApi(); | 55 RealGLApi(); |
56 virtual ~RealGLApi(); | 56 virtual ~RealGLApi(); |
57 void Initialize(DriverGL* driver); | 57 void Initialize(DriverGL* driver); |
58 | 58 |
59 private: | 59 private: |
60 virtual void glFinishFn() OVERRIDE; | 60 virtual void glFinishFn() override; |
61 virtual void glFlushFn() OVERRIDE; | 61 virtual void glFlushFn() override; |
62 }; | 62 }; |
63 | 63 |
64 // Inserts a TRACE for every GL call. | 64 // Inserts a TRACE for every GL call. |
65 class TraceGLApi : public GLApi { | 65 class TraceGLApi : public GLApi { |
66 public: | 66 public: |
67 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } | 67 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } |
68 virtual ~TraceGLApi(); | 68 virtual ~TraceGLApi(); |
69 | 69 |
70 // Include the auto-generated part of this class. We split this because | 70 // Include the auto-generated part of this class. We split this because |
71 // it means we can easily edit the non-auto generated parts right here in | 71 // it means we can easily edit the non-auto generated parts right here in |
(...skipping 25 matching lines...) Expand all Loading... |
97 virtual ~VirtualGLApi(); | 97 virtual ~VirtualGLApi(); |
98 void Initialize(DriverGL* driver, GLContext* real_context); | 98 void Initialize(DriverGL* driver, GLContext* real_context); |
99 | 99 |
100 // Sets the current virutal context. | 100 // Sets the current virutal context. |
101 bool MakeCurrent(GLContext* virtual_context, GLSurface* surface); | 101 bool MakeCurrent(GLContext* virtual_context, GLSurface* surface); |
102 | 102 |
103 void OnReleaseVirtuallyCurrent(GLContext* virtual_context); | 103 void OnReleaseVirtuallyCurrent(GLContext* virtual_context); |
104 | 104 |
105 private: | 105 private: |
106 // Overridden functions from GLApiBase | 106 // Overridden functions from GLApiBase |
107 virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE; | 107 virtual const GLubyte* glGetStringFn(GLenum name) override; |
108 virtual void glFinishFn() OVERRIDE; | 108 virtual void glFinishFn() override; |
109 virtual void glFlushFn() OVERRIDE; | 109 virtual void glFlushFn() override; |
110 | 110 |
111 // The real context we're running on. | 111 // The real context we're running on. |
112 GLContext* real_context_; | 112 GLContext* real_context_; |
113 | 113 |
114 // The current virtual context. | 114 // The current virtual context. |
115 GLContext* current_context_; | 115 GLContext* current_context_; |
116 | 116 |
117 // The supported extensions being advertised for this virtual context. | 117 // The supported extensions being advertised for this virtual context. |
118 std::string extensions_; | 118 std::string extensions_; |
119 }; | 119 }; |
120 | 120 |
121 class GL_EXPORT ScopedSetGLToRealGLApi { | 121 class GL_EXPORT ScopedSetGLToRealGLApi { |
122 public: | 122 public: |
123 ScopedSetGLToRealGLApi(); | 123 ScopedSetGLToRealGLApi(); |
124 ~ScopedSetGLToRealGLApi(); | 124 ~ScopedSetGLToRealGLApi(); |
125 | 125 |
126 private: | 126 private: |
127 GLApi* old_gl_api_; | 127 GLApi* old_gl_api_; |
128 }; | 128 }; |
129 | 129 |
130 } // namespace gfx | 130 } // namespace gfx |
131 | 131 |
132 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 132 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |