summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-18 18:58:33 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-18 18:58:33 +0000
commita3d2afafd83015159573e1bcf19dd7b0964ecb77 (patch)
tree699f336951d08ad37e8161673adcd3b1fc5f104b /content/renderer
parent6fd22c9bd81dcb9ecb488f5b99ea7f1e7cf15ae2 (diff)
downloadchromium_src-a3d2afafd83015159573e1bcf19dd7b0964ecb77.zip
chromium_src-a3d2afafd83015159573e1bcf19dd7b0964ecb77.tar.gz
chromium_src-a3d2afafd83015159573e1bcf19dd7b0964ecb77.tar.bz2
Revert 81965 - Progress towards fixing 77536This first thing this CL does is plumbs through the surface that the GPU will eventually render to very early on (with the ViewMsg_New and ViewMsg_CreateNew IPCs). Previously, these surfaces were acquired at the time that GPU got a request for a command buffer. This required mediation by the browser UI thread. With this CL, we pre-acquire the surfaces so that they can be passed with the request for the command buffer. This will allow us to handle the request on the browser IO thread.The second thing this CL does is change the surface management a bit. When surfaces were acquired and released when command buffers were created and destroyed, the GPU process host was natural manager of surfaces. This pushes the management further down into the RWHV level and GtkNativeViewManager (on Linux). It fixes a minor resource leak.BUG=first stage of 77536TEST=By hand WebGL, 3D CSS, Pepper 3D on Linux, Windows, and Mac.Review URL: http://codereview.chromium.org/6840060
TBR=backer@chromium.org Review URL: http://codereview.chromium.org/6878021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/gpu_channel_host.cc3
-rw-r--r--content/renderer/gpu_channel_host.h1
-rw-r--r--content/renderer/render_thread.cc1
-rw-r--r--content/renderer/render_view.cc6
-rw-r--r--content/renderer/render_view.h2
-rw-r--r--content/renderer/render_widget.cc10
-rw-r--r--content/renderer/render_widget.h17
-rw-r--r--content/renderer/render_widget_fullscreen_pepper.cc1
-rw-r--r--content/renderer/renderer_gl_context.cc20
-rw-r--r--content/renderer/renderer_gl_context.h2
-rw-r--r--content/renderer/webgraphicscontext3d_command_buffer_impl.cc1
11 files changed, 12 insertions, 52 deletions
diff --git a/content/renderer/gpu_channel_host.cc b/content/renderer/gpu_channel_host.cc
index 97fd549..7630462 100644
--- a/content/renderer/gpu_channel_host.cc
+++ b/content/renderer/gpu_channel_host.cc
@@ -101,7 +101,6 @@ bool GpuChannelHost::Send(IPC::Message* message) {
}
CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer(
- gfx::PluginWindowHandle compositing_surface,
int render_view_id,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
@@ -118,7 +117,7 @@ CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer(
int32 route_id;
if (!RenderThread::current()->Send(
new GpuHostMsg_CreateViewCommandBuffer(
- compositing_surface, render_view_id, init_params, &route_id))) {
+ render_view_id, init_params, &route_id))) {
return NULL;
}
diff --git a/content/renderer/gpu_channel_host.h b/content/renderer/gpu_channel_host.h
index 4e50881..fa1d60d 100644
--- a/content/renderer/gpu_channel_host.h
+++ b/content/renderer/gpu_channel_host.h
@@ -67,7 +67,6 @@ class GpuChannelHost : public IPC::Channel::Listener,
// Create and connect to a command buffer in the GPU process.
CommandBufferProxy* CreateViewCommandBuffer(
- gfx::PluginWindowHandle compositing_surface,
int render_view_id,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc
index 1a77c3f..625ebbc 100644
--- a/content/renderer/render_thread.cc
+++ b/content/renderer/render_thread.cc
@@ -428,7 +428,6 @@ void RenderThread::OnCreateNewView(const ViewMsg_New_Params& params) {
RenderView::Create(
this,
params.parent_window,
- params.compositing_surface,
MSG_ROUTING_NONE,
params.renderer_preferences,
params.web_preferences,
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 8065f5a..ec7bb75 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -345,7 +345,6 @@ struct RenderView::PendingFileChooser {
RenderView::RenderView(RenderThreadBase* render_thread,
gfx::NativeViewId parent_hwnd,
- gfx::PluginWindowHandle compositing_surface,
int32 opener_id,
const RendererPreferences& renderer_prefs,
const WebPreferences& webkit_prefs,
@@ -415,7 +414,7 @@ RenderView::RenderView(RenderThreadBase* render_thread,
// completing initialization. Otherwise, we can finish it now.
if (opener_id == MSG_ROUTING_NONE) {
did_show_ = true;
- CompleteInit(parent_hwnd, compositing_surface);
+ CompleteInit(parent_hwnd);
}
host_window_ = parent_hwnd;
@@ -489,7 +488,6 @@ RenderView* RenderView::FromWebView(WebView* webview) {
RenderView* RenderView::Create(
RenderThreadBase* render_thread,
gfx::NativeViewId parent_hwnd,
- gfx::PluginWindowHandle compositing_surface,
int32 opener_id,
const RendererPreferences& renderer_prefs,
const WebPreferences& webkit_prefs,
@@ -501,7 +499,6 @@ RenderView* RenderView::Create(
return new RenderView(
render_thread,
parent_hwnd,
- compositing_surface,
opener_id,
renderer_prefs,
webkit_prefs,
@@ -1271,7 +1268,6 @@ WebView* RenderView::createView(
RenderView* view = RenderView::Create(render_thread_,
0,
- gfx::kNullPluginWindow,
routing_id_,
renderer_preferences_,
webkit_preferences_,
diff --git a/content/renderer/render_view.h b/content/renderer/render_view.h
index 3363cac..3292a37 100644
--- a/content/renderer/render_view.h
+++ b/content/renderer/render_view.h
@@ -176,7 +176,6 @@ class RenderView : public RenderWidget,
static RenderView* Create(
RenderThreadBase* render_thread,
gfx::NativeViewId parent_hwnd,
- gfx::PluginWindowHandle compositing_surface,
int32 opener_id,
const RendererPreferences& renderer_prefs,
const WebPreferences& webkit_prefs,
@@ -662,7 +661,6 @@ class RenderView : public RenderWidget,
RenderView(RenderThreadBase* render_thread,
gfx::NativeViewId parent_hwnd,
- gfx::PluginWindowHandle compositing_surface,
int32 opener_id,
const RendererPreferences& renderer_prefs,
const WebPreferences& webkit_prefs,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 26f3f99..8cd6f35 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -148,12 +148,10 @@ void RenderWidget::DoInit(int32 opener_id,
// This is used to complete pending inits and non-pending inits. For non-
// pending cases, the parent will be the same as the current parent. This
// indicates we do not need to reparent or anything.
-void RenderWidget::CompleteInit(gfx::NativeViewId parent_hwnd,
- gfx::PluginWindowHandle compositing_surface) {
+void RenderWidget::CompleteInit(gfx::NativeViewId parent_hwnd) {
DCHECK(routing_id_ != MSG_ROUTING_NONE);
host_window_ = parent_hwnd;
- compositing_surface_ = compositing_surface;
Send(new ViewHostMsg_RenderViewReady(routing_id_));
}
@@ -198,12 +196,10 @@ bool RenderWidget::Send(IPC::Message* message) {
// Got a response from the browser after the renderer decided to create a new
// view.
-void RenderWidget::OnCreatingNewAck(
- gfx::NativeViewId parent,
- gfx::PluginWindowHandle compositing_surface) {
+void RenderWidget::OnCreatingNewAck(gfx::NativeViewId parent) {
DCHECK(routing_id_ != MSG_ROUTING_NONE);
- CompleteInit(parent, compositing_surface);
+ CompleteInit(parent);
}
void RenderWidget::OnClose() {
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 63580c7..b6cf16e 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -74,13 +74,6 @@ class RenderWidget : public IPC::Channel::Listener,
// Creates a WebWidget based on the popup type.
static WebKit::WebWidget* CreateWebWidget(RenderWidget* render_widget);
- // The compositing surface assigned by the RenderWidgetHost
- // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet,
- // in which case we should not create any GPU command buffers with it.
- gfx::PluginWindowHandle compositing_surface() const {
- return compositing_surface_;
- }
-
// The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if
// not yet assigned a view ID, in which case, the process MUST NOT send
// messages with this ID to the parent.
@@ -151,8 +144,7 @@ class RenderWidget : public IPC::Channel::Listener,
IPC::SyncMessage* create_widget_message);
// Finishes creation of a pending view started with Init.
- void CompleteInit(gfx::NativeViewId parent,
- gfx::PluginWindowHandle compositing_surface);
+ void CompleteInit(gfx::NativeViewId parent);
// Paints the given rectangular region of the WebWidget into canvas (a
// shared memory segment returned by AllocPaintBuf on Windows). The caller
@@ -177,8 +169,7 @@ class RenderWidget : public IPC::Channel::Listener,
// RenderWidget IPC message handlers
void OnClose();
- void OnCreatingNewAck(gfx::NativeViewId parent,
- gfx::PluginWindowHandle compositing_surface);
+ void OnCreatingNewAck(gfx::NativeViewId parent);
virtual void OnResize(const gfx::Size& new_size,
const gfx::Rect& resizer_rect);
virtual void OnWasHidden();
@@ -376,10 +367,6 @@ class RenderWidget : public IPC::Channel::Listener,
// compositor.
bool is_accelerated_compositing_active_;
- // Handle to a surface that is drawn to when accelerated compositing is
- // active.
- gfx::PluginWindowHandle compositing_surface_;
-
base::Time animation_floor_time_;
bool animation_update_pending_;
bool animation_task_posted_;
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc
index bbe80bc..d3e2e20 100644
--- a/content/renderer/render_widget_fullscreen_pepper.cc
+++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -318,7 +318,6 @@ void RenderWidgetFullscreenPepper::CreateContext() {
};
context_ = RendererGLContext::CreateViewContext(
host,
- compositing_surface(),
routing_id(),
"GL_OES_packed_depth_stencil GL_OES_depth24",
attribs,
diff --git a/content/renderer/renderer_gl_context.cc b/content/renderer/renderer_gl_context.cc
index 3e8612d..f913a3b 100644
--- a/content/renderer/renderer_gl_context.cc
+++ b/content/renderer/renderer_gl_context.cc
@@ -156,7 +156,6 @@ RendererGLContext::~RendererGLContext() {
RendererGLContext* RendererGLContext::CreateViewContext(
GpuChannelHost* channel,
- gfx::PluginWindowHandle render_surface,
int render_view_id,
const char* allowed_extensions,
const int32* attrib_list,
@@ -165,7 +164,6 @@ RendererGLContext* RendererGLContext::CreateViewContext(
scoped_ptr<RendererGLContext> context(new RendererGLContext(channel, NULL));
if (!context->Initialize(
true,
- render_surface,
render_view_id,
gfx::Size(),
allowed_extensions,
@@ -198,7 +196,6 @@ RendererGLContext* RendererGLContext::CreateOffscreenContext(
scoped_ptr<RendererGLContext> context(new RendererGLContext(channel, parent));
if (!context->Initialize(
false,
- gfx::kNullPluginWindow,
0,
size,
allowed_extensions,
@@ -369,7 +366,6 @@ RendererGLContext::RendererGLContext(GpuChannelHost* channel,
}
bool RendererGLContext::Initialize(bool onscreen,
- gfx::PluginWindowHandle render_surface,
int render_view_id,
const gfx::Size& size,
const char* allowed_extensions,
@@ -422,17 +418,11 @@ bool RendererGLContext::Initialize(bool onscreen,
// Create a proxy to a command buffer in the GPU process.
if (onscreen) {
- if (render_surface == gfx::kNullPluginWindow) {
- LOG(ERROR) << "Invalid surface handle for onscreen context.";
- command_buffer_ = NULL;
- } else {
- command_buffer_ = channel_->CreateViewCommandBuffer(
- render_surface,
- render_view_id,
- allowed_extensions,
- attribs,
- active_url);
- }
+ command_buffer_ = channel_->CreateViewCommandBuffer(
+ render_view_id,
+ allowed_extensions,
+ attribs,
+ active_url);
} else {
CommandBufferProxy* parent_command_buffer =
parent_.get() ? parent_->command_buffer_ : NULL;
diff --git a/content/renderer/renderer_gl_context.h b/content/renderer/renderer_gl_context.h
index 26a6d00..a40f5e1 100644
--- a/content/renderer/renderer_gl_context.h
+++ b/content/renderer/renderer_gl_context.h
@@ -91,7 +91,6 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext> {
// more cross-platform.
static RendererGLContext* CreateViewContext(
GpuChannelHost* channel,
- gfx::PluginWindowHandle render_surface,
int render_view_id,
const char* allowed_extensions,
const int32* attrib_list,
@@ -206,7 +205,6 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext> {
RendererGLContext* parent);
bool Initialize(bool onscreen,
- gfx::PluginWindowHandle render_surface,
int render_view_id,
const gfx::Size& size,
const char* allowed_extensions,
diff --git a/content/renderer/webgraphicscontext3d_command_buffer_impl.cc b/content/renderer/webgraphicscontext3d_command_buffer_impl.cc
index 2ff2b98..57a66fa 100644
--- a/content/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -100,7 +100,6 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
web_view_ = web_view;
context_ = RendererGLContext::CreateViewContext(
host,
- renderview->compositing_surface(),
renderview->routing_id(),
kWebGraphicsContext3DPerferredGLExtensions,
attribs,