summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 19:45:52 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 19:45:52 +0000
commitaa766612f25b5211ac65f40a19afe09d45c07c9a (patch)
treee404e96c940225c31b759df1227e475e4133a689 /content
parent180096e984be38d99d04f0036408a3ffd077210e (diff)
downloadchromium_src-aa766612f25b5211ac65f40a19afe09d45c07c9a.zip
chromium_src-aa766612f25b5211ac65f40a19afe09d45c07c9a.tar.gz
chromium_src-aa766612f25b5211ac65f40a19afe09d45c07c9a.tar.bz2
Remove support for switching draw surfaces on a context.This was originally intended to share canvas "back buffers" between the GPU process and the browser process. The plan is to issue all the GL calls in the GPU process now, with the browser process just doing the final present. Removing the redundant code.
Review URL: http://codereview.chromium.org/7701021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/gpu/gpu_channel.cc45
-rw-r--r--content/common/gpu/gpu_channel.h13
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc1
-rw-r--r--content/common/gpu/gpu_messages.h9
-rw-r--r--content/common/gpu/gpu_surface_stub.cc37
-rw-r--r--content/common/gpu/gpu_surface_stub.h49
-rw-r--r--content/content_common.gypi2
-rw-r--r--content/content_renderer.gypi2
-rw-r--r--content/renderer/gpu/gpu_channel_host.cc26
-rw-r--r--content/renderer/gpu/gpu_channel_host.h6
-rw-r--r--content/renderer/gpu/gpu_surface_proxy.cc30
-rw-r--r--content/renderer/gpu/gpu_surface_proxy.h47
12 files changed, 0 insertions, 267 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 287f345..0ad31501 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -172,14 +172,6 @@ void GpuChannel::OnDestroy() {
gpu_channel_manager_->RemoveChannel(renderer_id_);
}
-gfx::GLSurface* GpuChannel::LookupSurface(int surface_id) {
- GpuSurfaceStub *surface_stub = surfaces_.Lookup(surface_id);
- if (!surface_stub)
- return NULL;
-
- return surface_stub->surface();
-}
-
void GpuChannel::CreateViewCommandBuffer(
gfx::PluginWindowHandle window,
int32 render_view_id,
@@ -255,9 +247,6 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
OnCreateOffscreenCommandBuffer)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_DestroyCommandBuffer,
OnDestroyCommandBuffer)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_CreateOffscreenSurface,
- OnCreateOffscreenSurface)
- IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroySurface, OnDestroySurface)
IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateTransportTexture,
OnCreateTransportTexture)
IPC_MESSAGE_HANDLER(GpuChannelMsg_Echo, OnEcho);
@@ -360,40 +349,6 @@ void GpuChannel::OnDestroyCommandBuffer(int32 route_id,
Send(reply_message);
}
-void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size,
- IPC::Message* reply_message) {
- int route_id = MSG_ROUTING_NONE;
-
-#if defined(ENABLE_GPU)
- scoped_refptr<gfx::GLSurface> surface(
- gfx::GLSurface::CreateOffscreenGLSurface(software_, size));
- if (!surface.get())
- return;
-
- route_id = GenerateRouteID();
-
- scoped_ptr<GpuSurfaceStub> stub (new GpuSurfaceStub(this,
- route_id,
- surface.release()));
-
- router_.AddRoute(route_id, stub.get());
- surfaces_.AddWithID(stub.release(), route_id);
-#endif
-
- GpuChannelMsg_CreateOffscreenSurface::WriteReplyParams(reply_message,
- route_id);
- Send(reply_message);
-}
-
-void GpuChannel::OnDestroySurface(int route_id) {
-#if defined(ENABLE_GPU)
- if (router_.ResolveRoute(route_id)) {
- router_.RemoveRoute(route_id);
- surfaces_.Remove(route_id);
- }
-#endif
-}
-
void GpuChannel::OnCreateTransportTexture(int32 context_route_id,
int32 host_id) {
#if defined(ENABLE_GPU)
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index 4b8deb7..b6a510f 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -16,9 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "build/build_config.h"
-#include "gpu/command_buffer/service/surface_manager.h"
#include "content/common/gpu/gpu_command_buffer_stub.h"
-#include "content/common/gpu/gpu_surface_stub.h"
#include "content/common/message_router.h"
#include "ipc/ipc_sync_channel.h"
#include "ui/gfx/gl/gl_share_group.h"
@@ -43,7 +41,6 @@ class GLSurface;
// process. On the renderer side there's a corresponding GpuChannelHost.
class GpuChannel : public IPC::Channel::Listener,
public IPC::Message::Sender,
- public gpu::SurfaceManager,
public base::RefCountedThreadSafe<GpuChannel> {
public:
// Takes ownership of the renderer process handle.
@@ -112,9 +109,6 @@ class GpuChannel : public IPC::Channel::Listener,
// Destroy channel and all contained contexts.
void DestroySoon();
- // Look up a GLSurface by ID. In this case the ID is the IPC routing ID.
- virtual gfx::GLSurface* LookupSurface(int surface_id);
-
// Get the TransportTexture by ID.
TransportTexture* GetTransportTexture(int32 route_id);
@@ -144,10 +138,6 @@ class GpuChannel : public IPC::Channel::Listener,
IPC::Message* reply_message);
void OnDestroyCommandBuffer(int32 route_id, IPC::Message* reply_message);
- void OnCreateOffscreenSurface(const gfx::Size& size,
- IPC::Message* reply_message);
- void OnDestroySurface(int route_id);
-
void OnCreateTransportTexture(int32 context_route_id, int32 host_id);
void OnEcho(const IPC::Message& message);
@@ -180,9 +170,6 @@ class GpuChannel : public IPC::Channel::Listener,
#if defined(ENABLE_GPU)
typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap;
StubMap stubs_;
-
- typedef IDMap<GpuSurfaceStub, IDMapOwnPointer> SurfaceMap;
- SurfaceMap surfaces_;
#endif // defined (ENABLE_GPU)
// A collection of transport textures created.
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index bebce90..645b95a 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -144,7 +144,6 @@ void GpuCommandBufferStub::OnInitialize(
// Initialize the CommandBufferService and GpuScheduler.
if (command_buffer_->Initialize(&shared_memory, size)) {
scheduler_.reset(gpu::GpuScheduler::Create(command_buffer_.get(),
- channel_,
context_group_.get()));
#if defined(TOUCH_UI)
if (software_) {
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
index ded6b37..f96a632 100644
--- a/content/common/gpu/gpu_messages.h
+++ b/content/common/gpu/gpu_messages.h
@@ -296,15 +296,6 @@ IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_CreateOffscreenCommandBuffer,
IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer,
int32 /* instance_id */)
-// Create a surface for offscreen rendering.
-IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CreateOffscreenSurface,
- gfx::Size, /* size */
- int /* route_id */)
-
-// Destroy a surface by routing id.
-IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroySurface,
- int /* route_id */)
-
// Create a TransportTexture corresponding to |host_id|.
IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateTransportTexture,
int32, /* context_route_id */
diff --git a/content/common/gpu/gpu_surface_stub.cc b/content/common/gpu/gpu_surface_stub.cc
deleted file mode 100644
index 389c624..0000000
--- a/content/common/gpu/gpu_surface_stub.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#if defined(ENABLE_GPU)
-
-#include "content/common/gpu/gpu_surface_stub.h"
-
-#include "content/common/gpu/gpu_channel.h"
-#include "ipc/ipc_message_macros.h"
-
-GpuSurfaceStub::GpuSurfaceStub(GpuChannel* channel,
- int route_id,
- gfx::GLSurface* surface)
- : channel_(channel),
- route_id_(route_id),
- surface_(surface) {
-}
-
-GpuSurfaceStub::~GpuSurfaceStub() {
-}
-
-bool GpuSurfaceStub::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- //IPC_BEGIN_MESSAGE_MAP(GpuSurfaceStub, message)
- // IPC_MESSAGE_UNHANDLED(handled = false)
- //IPC_END_MESSAGE_MAP()
- DCHECK(handled);
- return handled;
-}
-
-bool GpuSurfaceStub::Send(IPC::Message* message) {
- return channel_->Send(message);
-}
-
-
-#endif // defined(ENABLE_GPU)
diff --git a/content/common/gpu/gpu_surface_stub.h b/content/common/gpu/gpu_surface_stub.h
deleted file mode 100644
index 8776ee0..0000000
--- a/content/common/gpu/gpu_surface_stub.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_GPU_GPU_SURFACE_STUB_H_
-#define CONTENT_COMMON_GPU_GPU_SURFACE_STUB_H_
-#pragma once
-
-#if defined(ENABLE_GPU)
-
-#include "base/memory/ref_counted.h"
-#include "ipc/ipc_channel.h"
-#include "ipc/ipc_message.h"
-#include "ui/gfx/gl/gl_surface.h"
-
-class GpuChannel;
-
-class GpuSurfaceStub
- : public IPC::Channel::Listener,
- public IPC::Message::Sender {
- public:
- // Takes ownership of surface.
- GpuSurfaceStub(GpuChannel* channel, int route_id, gfx::GLSurface* surface);
- virtual ~GpuSurfaceStub();
-
- gfx::GLSurface* surface() const { return surface_.get(); }
-
- // IPC::Channel::Listener implementation:
- virtual bool OnMessageReceived(const IPC::Message& message);
-
- // IPC::Message::Sender implementation:
- virtual bool Send(IPC::Message* msg);
-
- private:
- // Message handlers.
- // None yet.
-
- // This is a weak pointer. The GpuChannel controls the lifetime of the
- // GpuSurfaceStub and always outlives it.
- GpuChannel* channel_;
-
- int route_id_;
- scoped_refptr<gfx::GLSurface> surface_;
- DISALLOW_COPY_AND_ASSIGN(GpuSurfaceStub);
-};
-
-#endif // defined(ENABLE_GPU)
-
-#endif // CONTENT_COMMON_GPU_GPU_SURFACE_STUB_H_
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 9590b72..1124ea2 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -126,8 +126,6 @@
'common/gpu/gpu_info.h',
'common/gpu/gpu_messages.h',
'common/gpu/gpu_process_launch_causes.h',
- 'common/gpu/gpu_surface_stub.cc',
- 'common/gpu/gpu_surface_stub.h',
'common/gpu/gpu_watchdog.h',
'common/gpu/media/gpu_video_decode_accelerator.cc',
'common/gpu/media/gpu_video_decode_accelerator.h',
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index d14243a..c1ad628 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -49,8 +49,6 @@
'renderer/geolocation_dispatcher.h',
'renderer/gpu/gpu_channel_host.cc',
'renderer/gpu/gpu_channel_host.h',
- 'renderer/gpu/gpu_surface_proxy.cc',
- 'renderer/gpu/gpu_surface_proxy.h',
'renderer/gpu/gpu_video_decode_accelerator_host.cc',
'renderer/gpu/gpu_video_decode_accelerator_host.h',
'renderer/gpu/renderer_gl_context.cc',
diff --git a/content/renderer/gpu/gpu_channel_host.cc b/content/renderer/gpu/gpu_channel_host.cc
index 73bf14f..343f777 100644
--- a/content/renderer/gpu/gpu_channel_host.cc
+++ b/content/renderer/gpu/gpu_channel_host.cc
@@ -8,7 +8,6 @@
#include "content/common/child_process.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/renderer/gpu/command_buffer_proxy.h"
-#include "content/renderer/gpu/gpu_surface_proxy.h"
#include "content/renderer/gpu/transport_texture_service.h"
#include "content/renderer/render_process.h"
#include "content/renderer/render_thread.h"
@@ -298,31 +297,6 @@ void GpuChannelHost::DestroyCommandBuffer(CommandBufferProxy* command_buffer) {
#endif
}
-GpuSurfaceProxy* GpuChannelHost::CreateOffscreenSurface(
- const gfx::Size& size) {
-#if defined(ENABLE_GPU)
- AutoLock lock(context_lock_);
- int route_id;
- if (!Send(new GpuChannelMsg_CreateOffscreenSurface(size, &route_id)))
- return NULL;
-
- scoped_ptr<GpuSurfaceProxy> surface(new GpuSurfaceProxy(this, route_id));
- AddRoute(route_id, surface->AsWeakPtr());
-
- return surface.release();
-#endif
-}
-
-void GpuChannelHost::DestroySurface(GpuSurfaceProxy* surface) {
-#if defined(ENABLE_GPU)
- AutoLock lock(context_lock_);
- Send(new GpuChannelMsg_DestroySurface(surface->route_id()));
-
- RemoveRoute(surface->route_id());
- delete surface;
-#endif
-}
-
void GpuChannelHost::AddRoute(
int route_id, base::WeakPtr<IPC::Channel::Listener> listener) {
DCHECK(MessageLoopProxy::current());
diff --git a/content/renderer/gpu/gpu_channel_host.h b/content/renderer/gpu/gpu_channel_host.h
index 4bd9fbb..96c6ae4 100644
--- a/content/renderer/gpu/gpu_channel_host.h
+++ b/content/renderer/gpu/gpu_channel_host.h
@@ -101,12 +101,6 @@ class GpuChannelHost : public IPC::Message::Sender,
// Destroy a command buffer created by this channel.
void DestroyCommandBuffer(CommandBufferProxy* command_buffer);
- // Create a surface in the GPU process. Returns null on failure.
- GpuSurfaceProxy* CreateOffscreenSurface(const gfx::Size& size);
-
- // Destroy a surface in the GPU process.
- void DestroySurface(GpuSurfaceProxy* surface);
-
TransportTextureService* transport_texture_service() {
return transport_texture_service_.get();
}
diff --git a/content/renderer/gpu/gpu_surface_proxy.cc b/content/renderer/gpu/gpu_surface_proxy.cc
deleted file mode 100644
index d023b0e..0000000
--- a/content/renderer/gpu/gpu_surface_proxy.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/gpu/gpu_surface_proxy.h"
-#include "ui/gfx/size.h"
-
-GpuSurfaceProxy::GpuSurfaceProxy(
- IPC::Channel::Sender* channel,
- int route_id)
- : channel_(channel),
- route_id_(route_id) {
-}
-
-GpuSurfaceProxy::~GpuSurfaceProxy() {
-}
-
-bool GpuSurfaceProxy::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- //IPC_BEGIN_MESSAGE_MAP(GpuSurfaceProxy, message)
- // IPC_MESSAGE_UNHANDLED(handled = false)
- //IPC_END_MESSAGE_MAP()
- DCHECK(handled);
- return handled;
-}
-
-void GpuSurfaceProxy::OnChannelError() {
- // Prevent any further messages from being sent.
- channel_ = NULL;
-}
diff --git a/content/renderer/gpu/gpu_surface_proxy.h b/content/renderer/gpu/gpu_surface_proxy.h
deleted file mode 100644
index f4f8879..0000000
--- a/content/renderer/gpu/gpu_surface_proxy.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_RENDERER_GPU_GPU_SURFACE_PROXY_H_
-#define CONTENT_RENDERER_GPU_GPU_SURFACE_PROXY_H_
-#pragma once
-
-#if defined(ENABLE_GPU)
-
-#include "base/memory/weak_ptr.h"
-#include "ipc/ipc_channel.h"
-#include "ipc/ipc_message.h"
-
-namespace gfx {
-class Size;
-}
-
-// Client side proxy that forwards messages to a GpuSurfaceStub.
-class GpuSurfaceProxy : public IPC::Channel::Listener,
- public base::SupportsWeakPtr<GpuSurfaceProxy> {
- public:
- GpuSurfaceProxy(IPC::Channel::Sender* channel, int route_id);
- virtual ~GpuSurfaceProxy();
-
- // IPC::Channel::Listener implementation:
- virtual bool OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelError();
-
- int route_id() const { return route_id_; }
-
- private:
-
- // Send an IPC message over the GPU channel. This is private to fully
- // encapsulate the channel; all callers of this function must explicitly
- // verify that the channel is still available.
- bool Send(IPC::Message* msg);
-
- IPC::Channel::Sender* channel_;
- int route_id_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuSurfaceProxy);
-};
-
-#endif // ENABLE_GPU
-
-#endif // CONTENT_RENDERER_GPU_GPU_SURFACE_PROXY_H_