Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Side by Side Diff: content/renderer/gpu/renderer_gl_context.h

Issue 7762013: Added GPU process "echo" IPC message. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_old.h" 13 #include "base/callback_old.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 "build/build_config.h" 17 #include "build/build_config.h"
18 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
19 #include "ui/gfx/size.h" 19 #include "ui/gfx/size.h"
20 20
21 class GpuChannelHost; 21 class GpuChannelHost;
22 class MessageLoop; 22 class MessageLoop;
23 class CommandBufferProxy; 23 class CommandBufferProxy;
24 class GURL; 24 class GURL;
25 class Task;
25 class TransportTextureHost; 26 class TransportTextureHost;
26 27
27 namespace gpu { 28 namespace gpu {
28 namespace gles2 { 29 namespace gles2 {
29 class GLES2CmdHelper; 30 class GLES2CmdHelper;
30 class GLES2Implementation; 31 class GLES2Implementation;
31 } 32 }
32 } 33 }
33 34
34 class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext> { 35 class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext> {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // does not have a parent. 134 // does not have a parent.
134 uint32 GetParentTextureId(); 135 uint32 GetParentTextureId();
135 136
136 // Create a new texture in the parent's RendererGLContext. Returns zero if 137 // Create a new texture in the parent's RendererGLContext. Returns zero if
137 // RendererGLContext does not have a parent. 138 // RendererGLContext does not have a parent.
138 uint32 CreateParentTexture(const gfx::Size& size); 139 uint32 CreateParentTexture(const gfx::Size& size);
139 140
140 // Deletes a texture in the parent's RendererGLContext. 141 // Deletes a texture in the parent's RendererGLContext.
141 void DeleteParentTexture(uint32 texture); 142 void DeleteParentTexture(uint32 texture);
142 143
143 // Provides a callback that will be invoked when SwapBuffers has completed
144 // service side.
145 void SetSwapBuffersCallback(Callback0::Type* callback);
146
147 void SetContextLostCallback(Callback1<ContextLostReason>::Type* callback); 144 void SetContextLostCallback(Callback1<ContextLostReason>::Type* callback);
148 145
149 // Set the current RendererGLContext for the calling thread. 146 // Set the current RendererGLContext for the calling thread.
150 static bool MakeCurrent(RendererGLContext* context); 147 static bool MakeCurrent(RendererGLContext* context);
151 148
152 // For a view RendererGLContext, display everything that has been rendered 149 // For a view RendererGLContext, display everything that has been rendered
153 // since the last call. For an offscreen RendererGLContext, resolve everything 150 // 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 151 // that has been rendered since the last call to a copy that can be accessed
155 // by the parent RendererGLContext. 152 // by the parent RendererGLContext.
156 bool SwapBuffers(); 153 bool SwapBuffers();
157 154
155 // Run the task once the channel has been flushed. Takes care of deleting the
156 // task whether the echo succeeds or not.
157 bool Echo(Task* task);
158
158 // Create a TransportTextureHost object associated with the context. 159 // Create a TransportTextureHost object associated with the context.
159 scoped_refptr<TransportTextureHost> CreateTransportTextureHost(); 160 scoped_refptr<TransportTextureHost> CreateTransportTextureHost();
160 161
161 // TODO(gman): Remove this 162 // TODO(gman): Remove this
162 void DisableShaderTranslation(); 163 void DisableShaderTranslation();
163 164
164 // Allows direct access to the GLES2 implementation so a RendererGLContext 165 // Allows direct access to the GLES2 implementation so a RendererGLContext
165 // can be used without making it current. 166 // can be used without making it current.
166 gpu::gles2::GLES2Implementation* GetImplementation(); 167 gpu::gles2::GLES2Implementation* GetImplementation();
167 168
(...skipping 11 matching lines...) Expand all
179 180
180 bool Initialize(bool onscreen, 181 bool Initialize(bool onscreen,
181 int render_view_id, 182 int render_view_id,
182 const gfx::Size& size, 183 const gfx::Size& size,
183 RendererGLContext* share_group, 184 RendererGLContext* share_group,
184 const char* allowed_extensions, 185 const char* allowed_extensions,
185 const int32* attrib_list, 186 const int32* attrib_list,
186 const GURL& active_url); 187 const GURL& active_url);
187 void Destroy(); 188 void Destroy();
188 189
189 void OnSwapBuffers();
190 void OnContextLost(); 190 void OnContextLost();
191 191
192 scoped_refptr<GpuChannelHost> channel_; 192 scoped_refptr<GpuChannelHost> channel_;
193 base::WeakPtr<RendererGLContext> parent_; 193 base::WeakPtr<RendererGLContext> parent_;
194 scoped_ptr<Callback0::Type> swap_buffers_callback_;
195 scoped_ptr<Callback1<ContextLostReason>::Type> context_lost_callback_; 194 scoped_ptr<Callback1<ContextLostReason>::Type> context_lost_callback_;
196 uint32 parent_texture_id_; 195 uint32 parent_texture_id_;
197 CommandBufferProxy* command_buffer_; 196 CommandBufferProxy* command_buffer_;
198 gpu::gles2::GLES2CmdHelper* gles2_helper_; 197 gpu::gles2::GLES2CmdHelper* gles2_helper_;
199 int32 transfer_buffer_id_; 198 int32 transfer_buffer_id_;
200 gpu::gles2::GLES2Implementation* gles2_implementation_; 199 gpu::gles2::GLES2Implementation* gles2_implementation_;
201 Error last_error_; 200 Error last_error_;
202 int frame_number_; 201 int frame_number_;
203 202
204 DISALLOW_COPY_AND_ASSIGN(RendererGLContext); 203 DISALLOW_COPY_AND_ASSIGN(RendererGLContext);
205 }; 204 };
206 205
207 #endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_ 206 #endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.cc ('k') | content/renderer/gpu/renderer_gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698