| 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 RendererGLContexts in the | 6 // and pepper's PGL. This API is used to manage OpenGL RendererGLContexts 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_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ | 9 #ifndef CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ |
| 10 #define CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ | 10 #define CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "ui/gfx/gl/gl_surface.h" |
| 19 #include "ui/gfx/gl/gpu_preference.h" | 20 #include "ui/gfx/gl/gpu_preference.h" |
| 20 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 21 #include "ui/gfx/size.h" | 22 #include "ui/gfx/size.h" |
| 22 | 23 |
| 23 class GpuChannelHost; | 24 class GpuChannelHost; |
| 24 class CommandBufferProxy; | 25 class CommandBufferProxy; |
| 25 class GURL; | 26 class GURL; |
| 26 | 27 |
| 27 namespace gpu { | 28 namespace gpu { |
| 28 namespace gles2 { | 29 namespace gles2 { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // For a view RendererGLContext, display everything that has been rendered | 153 // For a view RendererGLContext, display everything that has been rendered |
| 153 // since the last call. For an offscreen RendererGLContext, resolve everything | 154 // since the last call. For an offscreen RendererGLContext, resolve everything |
| 154 // that has been rendered since the last call to a copy that can be accessed | 155 // that has been rendered since the last call to a copy that can be accessed |
| 155 // by the parent RendererGLContext. | 156 // by the parent RendererGLContext. |
| 156 bool SwapBuffers(); | 157 bool SwapBuffers(); |
| 157 | 158 |
| 158 // Run the task once the channel has been flushed. Takes care of deleting the | 159 // Run the task once the channel has been flushed. Takes care of deleting the |
| 159 // task whether the echo succeeds or not. | 160 // task whether the echo succeeds or not. |
| 160 bool Echo(const base::Closure& task); | 161 bool Echo(const base::Closure& task); |
| 161 | 162 |
| 162 // Sends an IPC message with the new state of surface visibility | 163 // Sends an IPC message with the new state of resource usage |
| 163 bool SetSurfaceVisible(bool visibility); | 164 bool SetResourceUsage(gfx::GLSurface::ResourceUsage resourceUsage); |
| 164 | 165 |
| 165 // TODO(gman): Remove this | 166 // TODO(gman): Remove this |
| 166 void DisableShaderTranslation(); | 167 void DisableShaderTranslation(); |
| 167 | 168 |
| 168 // Allows direct access to the GLES2 implementation so a RendererGLContext | 169 // Allows direct access to the GLES2 implementation so a RendererGLContext |
| 169 // can be used without making it current. | 170 // can be used without making it current. |
| 170 gpu::gles2::GLES2Implementation* GetImplementation(); | 171 gpu::gles2::GLES2Implementation* GetImplementation(); |
| 171 | 172 |
| 172 // Return the current error. | 173 // Return the current error. |
| 173 Error GetError(); | 174 Error GetError(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 201 gpu::gles2::GLES2CmdHelper* gles2_helper_; | 202 gpu::gles2::GLES2CmdHelper* gles2_helper_; |
| 202 int32 transfer_buffer_id_; | 203 int32 transfer_buffer_id_; |
| 203 gpu::gles2::GLES2Implementation* gles2_implementation_; | 204 gpu::gles2::GLES2Implementation* gles2_implementation_; |
| 204 Error last_error_; | 205 Error last_error_; |
| 205 int frame_number_; | 206 int frame_number_; |
| 206 | 207 |
| 207 DISALLOW_COPY_AND_ASSIGN(RendererGLContext); | 208 DISALLOW_COPY_AND_ASSIGN(RendererGLContext); |
| 208 }; | 209 }; |
| 209 | 210 |
| 210 #endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ | 211 #endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ |
| OLD | NEW |