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 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 GL_EXPORT RealGLApi : public GLApiBase { | 50 class GL_EXPORT 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 GL_EXPORT TraceGLApi : public GLApi { | 62 class GL_EXPORT 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 11 matching lines...) Expand all Loading... |
75 public: | 80 public: |
76 VirtualGLApi(); | 81 VirtualGLApi(); |
77 virtual ~VirtualGLApi(); | 82 virtual ~VirtualGLApi(); |
78 void Initialize(DriverGL* driver, GLContext* real_context); | 83 void Initialize(DriverGL* driver, GLContext* real_context); |
79 | 84 |
80 // Sets the current virutal context. | 85 // Sets the current virutal context. |
81 bool MakeCurrent(GLContext* virtual_context, GLSurface* surface); | 86 bool MakeCurrent(GLContext* virtual_context, GLSurface* surface); |
82 | 87 |
83 void OnReleaseVirtuallyCurrent(GLContext* virtual_context); | 88 void OnReleaseVirtuallyCurrent(GLContext* virtual_context); |
84 | 89 |
| 90 private: |
85 // Overridden functions from GLApiBase | 91 // Overridden functions from GLApiBase |
86 virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE; | 92 virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE; |
| 93 virtual void glFinishFn() OVERRIDE; |
| 94 virtual void glFlushFn() OVERRIDE; |
87 | 95 |
88 private: | |
89 // The real context we're running on. | 96 // The real context we're running on. |
90 GLContext* real_context_; | 97 GLContext* real_context_; |
91 | 98 |
92 // The current virtual context. | 99 // The current virtual context. |
93 GLContext* current_context_; | 100 GLContext* current_context_; |
94 | 101 |
95 // The supported extensions being advertised for this virtual context. | 102 // The supported extensions being advertised for this virtual context. |
96 std::string extensions_; | 103 std::string extensions_; |
97 }; | 104 }; |
98 | 105 |
99 } // namespace gfx | 106 } // namespace gfx |
100 | 107 |
101 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 108 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |