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 // This API is consistent with other OpenGL setup APIs like window's WGL | 5 // This API is consistent with other OpenGL setup APIs like window's WGL |
6 // and pepper's PGL. This API is used to manage OpenGL ContentGLContexts in the | 6 // and pepper's PGL. This API is used to manage OpenGL ContentGLContexts in the |
7 // Chrome renderer process in a way that is consistent with other platforms. | 7 // Chrome renderer process in a way that is consistent with other platforms. |
8 | 8 |
9 #ifndef CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_ | 9 #ifndef CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_ |
10 #define CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_ | 10 #define CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/non_thread_safe.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "ui/gfx/gl/gpu_preference.h" | 21 #include "ui/gfx/gl/gpu_preference.h" |
22 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
23 #include "ui/gfx/size.h" | 23 #include "ui/gfx/size.h" |
24 | 24 |
25 class GpuChannelHost; | 25 class GpuChannelHost; |
26 class CommandBufferProxy; | 26 class CommandBufferProxy; |
27 class GURL; | 27 class GURL; |
28 class GpuMemoryAllocation; | 28 struct GpuMemoryAllocationForRenderer; |
29 | 29 |
30 namespace gpu { | 30 namespace gpu { |
31 class TransferBuffer; | 31 class TransferBuffer; |
32 namespace gles2 { | 32 namespace gles2 { |
33 class GLES2CmdHelper; | 33 class GLES2CmdHelper; |
34 class GLES2Implementation; | 34 class GLES2Implementation; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 class ContentGLContext : public base::SupportsWeakPtr<ContentGLContext>, | 38 class ContentGLContext : public base::SupportsWeakPtr<ContentGLContext>, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 // Run the task once the channel has been flushed. Takes care of deleting the | 160 // Run the task once the channel has been flushed. Takes care of deleting the |
161 // task whether the echo succeeds or not. | 161 // task whether the echo succeeds or not. |
162 bool Echo(const base::Closure& task); | 162 bool Echo(const base::Closure& task); |
163 | 163 |
164 // Sends an IPC message with the new state of surface visibility | 164 // Sends an IPC message with the new state of surface visibility |
165 bool SetSurfaceVisible(bool visibility); | 165 bool SetSurfaceVisible(bool visibility); |
166 | 166 |
167 // Register a callback to invoke whenever we recieve a new memory allocation. | 167 // Register a callback to invoke whenever we recieve a new memory allocation. |
168 void SetMemoryAllocationChangedCallback( | 168 void SetMemoryAllocationChangedCallback( |
169 const base::Callback<void(const GpuMemoryAllocation&)>& callback); | 169 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& |
| 170 callback); |
170 | 171 |
171 // TODO(gman): Remove this | 172 // TODO(gman): Remove this |
172 void DisableShaderTranslation(); | 173 void DisableShaderTranslation(); |
173 | 174 |
174 // Allows direct access to the GLES2 implementation so a ContentGLContext | 175 // Allows direct access to the GLES2 implementation so a ContentGLContext |
175 // can be used without making it current. | 176 // can be used without making it current. |
176 gpu::gles2::GLES2Implementation* GetImplementation(); | 177 gpu::gles2::GLES2Implementation* GetImplementation(); |
177 | 178 |
178 // Return the current error. | 179 // Return the current error. |
179 Error GetError(); | 180 Error GetError(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 gpu::gles2::GLES2CmdHelper* gles2_helper_; | 216 gpu::gles2::GLES2CmdHelper* gles2_helper_; |
216 gpu::TransferBuffer* transfer_buffer_; | 217 gpu::TransferBuffer* transfer_buffer_; |
217 gpu::gles2::GLES2Implementation* gles2_implementation_; | 218 gpu::gles2::GLES2Implementation* gles2_implementation_; |
218 Error last_error_; | 219 Error last_error_; |
219 int frame_number_; | 220 int frame_number_; |
220 | 221 |
221 DISALLOW_COPY_AND_ASSIGN(ContentGLContext); | 222 DISALLOW_COPY_AND_ASSIGN(ContentGLContext); |
222 }; | 223 }; |
223 | 224 |
224 #endif // CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_ | 225 #endif // CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_ |
OLD | NEW |