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_API_IMPLEMENTATION_H_ | 5 #ifndef UI_GL_GL_API_IMPLEMENTATION_H_ |
6 #define UI_GL_GL_API_IMPLEMENTATION_H_ | 6 #define UI_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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 }; | 42 }; |
43 | 43 |
44 // Implemenents the GL API by calling directly into the driver. | 44 // Implemenents the GL API by calling directly into the driver. |
45 class GL_EXPORT RealGLApi : public GLApiBase { | 45 class GL_EXPORT RealGLApi : public GLApiBase { |
46 public: | 46 public: |
47 RealGLApi(); | 47 RealGLApi(); |
48 virtual ~RealGLApi(); | 48 virtual ~RealGLApi(); |
49 void Initialize(DriverGL* driver); | 49 void Initialize(DriverGL* driver); |
50 }; | 50 }; |
51 | 51 |
| 52 // Inserts a TRACE for every GL call. |
| 53 class GL_EXPORT TraceGLApi : public GLApi { |
| 54 public: |
| 55 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } |
| 56 virtual ~TraceGLApi(); |
| 57 |
| 58 // Include the auto-generated part of this class. We split this because |
| 59 // it means we can easily edit the non-auto generated parts right here in |
| 60 // this file instead of having to edit some template or the code generator. |
| 61 #include "gl_bindings_api_autogen_gl.h" |
| 62 |
| 63 private: |
| 64 GLApi* gl_api_; |
| 65 }; |
| 66 |
52 // Implementents the GL API using co-operative state restoring. | 67 // Implementents the GL API using co-operative state restoring. |
53 // Assumes there is only one real GL context and that multiple virtual contexts | 68 // Assumes there is only one real GL context and that multiple virtual contexts |
54 // are implemented above it. Restores the needed state from the current context. | 69 // are implemented above it. Restores the needed state from the current context. |
55 class GL_EXPORT VirtualGLApi : public GLApiBase { | 70 class GL_EXPORT VirtualGLApi : public GLApiBase { |
56 public: | 71 public: |
57 VirtualGLApi(); | 72 VirtualGLApi(); |
58 virtual ~VirtualGLApi(); | 73 virtual ~VirtualGLApi(); |
59 void Initialize(DriverGL* driver, GLContext* real_context); | 74 void Initialize(DriverGL* driver, GLContext* real_context); |
60 | 75 |
61 // Sets the current virutal context. | 76 // Sets the current virutal context. |
(...skipping 11 matching lines...) Expand all Loading... |
73 // The current virtual context. | 88 // The current virtual context. |
74 GLContext* current_context_; | 89 GLContext* current_context_; |
75 | 90 |
76 // The supported extensions being advertised for this virtual context. | 91 // The supported extensions being advertised for this virtual context. |
77 std::string extensions_; | 92 std::string extensions_; |
78 }; | 93 }; |
79 | 94 |
80 } // namespace gfx | 95 } // namespace gfx |
81 | 96 |
82 #endif // UI_GL_GL_API_IMPLEMENTATION_H_ | 97 #endif // UI_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |