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_GFX_GL_GL_SURFACE_H_ | 5 #ifndef UI_GL_GL_SURFACE_H_ |
6 #define UI_GFX_GL_GL_SURFACE_H_ | 6 #define UI_GL_GL_SURFACE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "ui/gfx/gl/gl_export.h" | |
12 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 #include "ui/gl/gl_export.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 | 16 |
17 class GLContext; | 17 class GLContext; |
18 | 18 |
19 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
20 class AndroidNativeWindow; | 20 class AndroidNativeWindow; |
21 #endif | 21 #endif |
22 | 22 |
23 // Encapsulates a surface that can be rendered to with GL, hiding platform | 23 // Encapsulates a surface that can be rendered to with GL, hiding platform |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 static GLSurface* GetCurrent(); | 107 static GLSurface* GetCurrent(); |
108 | 108 |
109 protected: | 109 protected: |
110 virtual ~GLSurface(); | 110 virtual ~GLSurface(); |
111 static bool InitializeOneOffInternal(); | 111 static bool InitializeOneOffInternal(); |
112 static void SetCurrent(GLSurface* surface); | 112 static void SetCurrent(GLSurface* surface); |
113 | 113 |
114 private: | 114 private: |
115 friend class base::RefCounted<GLSurface>; | 115 friend class base::RefCounted<GLSurface>; |
116 friend class GLContext; | 116 friend class GLContext; |
| 117 |
117 DISALLOW_COPY_AND_ASSIGN(GLSurface); | 118 DISALLOW_COPY_AND_ASSIGN(GLSurface); |
118 }; | 119 }; |
119 | 120 |
120 // Implementation of GLSurface that forwards all calls through to another | 121 // Implementation of GLSurface that forwards all calls through to another |
121 // GLSurface. | 122 // GLSurface. |
122 class GL_EXPORT GLSurfaceAdapter : public GLSurface { | 123 class GL_EXPORT GLSurfaceAdapter : public GLSurface { |
123 public: | 124 public: |
124 explicit GLSurfaceAdapter(GLSurface* surface); | 125 explicit GLSurfaceAdapter(GLSurface* surface); |
125 | 126 |
126 virtual bool Initialize() OVERRIDE; | 127 virtual bool Initialize() OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
140 virtual void* GetConfig() OVERRIDE; | 141 virtual void* GetConfig() OVERRIDE; |
141 virtual unsigned GetFormat() OVERRIDE; | 142 virtual unsigned GetFormat() OVERRIDE; |
142 | 143 |
143 GLSurface* surface() const { return surface_.get(); } | 144 GLSurface* surface() const { return surface_.get(); } |
144 | 145 |
145 protected: | 146 protected: |
146 virtual ~GLSurfaceAdapter(); | 147 virtual ~GLSurfaceAdapter(); |
147 | 148 |
148 private: | 149 private: |
149 scoped_refptr<GLSurface> surface_; | 150 scoped_refptr<GLSurface> surface_; |
| 151 |
150 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 152 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
151 }; | 153 }; |
152 | 154 |
153 } // namespace gfx | 155 } // namespace gfx |
154 | 156 |
155 #endif // UI_GFX_GL_GL_SURFACE_H_ | 157 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |