summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 21:53:38 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 21:53:38 +0000
commit0b7a2fff445beb2c5de1e2a632540a4107e00708 (patch)
tree759f7a9d489b6bf44c9f5de081d7bf335233028d /content
parent72ab1b792dbddfb680490153984b1865b725d8f4 (diff)
downloadchromium_src-0b7a2fff445beb2c5de1e2a632540a4107e00708.zip
chromium_src-0b7a2fff445beb2c5de1e2a632540a4107e00708.tar.gz
chromium_src-0b7a2fff445beb2c5de1e2a632540a4107e00708.tar.bz2
Revert 87371 - Broke Compile - Support for glSetSurfaceCHROMIUM.
This command allows a previously created GPU surface to be made current for a command buffer. There are no surfaces registered at this point so this command is currently a no-op. Review URL: http://codereview.chromium.org/7077001 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7027008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/gpu/gpu_channel.cc10
-rw-r--r--content/common/gpu/gpu_channel.h9
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc4
-rw-r--r--content/common/gpu/gpu_surface_stub.h10
-rw-r--r--content/gpu/gpu_info_collector.cc18
5 files changed, 16 insertions, 35 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 5423544..338d426 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -126,14 +126,6 @@ void GpuChannel::LoseAllContexts() {
gpu_channel_manager_->LoseAllContexts();
}
-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,
@@ -267,7 +259,7 @@ void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size,
*route_id = MSG_ROUTING_NONE;
#if defined(ENABLE_GPU)
- scoped_refptr<gfx::GLSurface> surface(
+ scoped_ptr<gfx::GLSurface> surface(
gfx::GLSurface::CreateOffscreenGLSurface(size));
if (!surface.get())
return;
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index 0e39636..da12ecd 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -14,7 +14,6 @@
#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"
@@ -32,15 +31,10 @@ class MessageLoopProxy;
class WaitableEvent;
}
-namespace gfx {
-class GLSurface;
-}
-
// Encapsulates an IPC channel between the GPU process and one renderer
// 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.
@@ -92,9 +86,6 @@ class GpuChannel : public IPC::Channel::Listener,
void LoseAllContexts();
- // Look up a GLSurface by ID. In this case the ID is the IPC routing ID.
- gfx::GLSurface* LookupSurface(int surface_id);
-
// Get the TransportTexture by ID.
TransportTexture* GetTransportTexture(int32 route_id);
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 0593b7ec..600cab2 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -134,9 +134,7 @@ void GpuCommandBufferStub::OnInitialize(
if (command_buffer_->Initialize(&shared_memory, size)) {
gpu::GpuScheduler* parent_processor =
parent_ ? parent_->scheduler_.get() : NULL;
- scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(),
- channel_,
- NULL));
+ scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), NULL));
if (scheduler_->Initialize(
handle_,
initial_size_,
diff --git a/content/common/gpu/gpu_surface_stub.h b/content/common/gpu/gpu_surface_stub.h
index 8776ee0..1a9deb6 100644
--- a/content/common/gpu/gpu_surface_stub.h
+++ b/content/common/gpu/gpu_surface_stub.h
@@ -8,7 +8,8 @@
#if defined(ENABLE_GPU)
-#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_message.h"
#include "ui/gfx/gl/gl_surface.h"
@@ -17,14 +18,13 @@ class GpuChannel;
class GpuSurfaceStub
: public IPC::Channel::Listener,
- public IPC::Message::Sender {
+ public IPC::Message::Sender,
+ public base::SupportsWeakPtr<GpuSurfaceStub> {
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);
@@ -40,7 +40,7 @@ class GpuSurfaceStub
GpuChannel* channel_;
int route_id_;
- scoped_refptr<gfx::GLSurface> surface_;
+ scoped_ptr<gfx::GLSurface> surface_;
DISALLOW_COPY_AND_ASSIGN(GpuSurfaceStub);
};
diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc
index 2e4630b..80c98fa 100644
--- a/content/gpu/gpu_info_collector.cc
+++ b/content/gpu/gpu_info_collector.cc
@@ -18,20 +18,20 @@
namespace {
-scoped_refptr<gfx::GLSurface> InitializeGLSurface() {
- scoped_refptr<gfx::GLSurface> surface(
- gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
+gfx::GLSurface* InitializeGLSurface() {
+ scoped_ptr<gfx::GLSurface> surface(gfx::GLSurface::CreateOffscreenGLSurface(
+ gfx::Size(1, 1)));
if (!surface.get()) {
LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed";
return NULL;
}
- return surface;
+ return surface.release();
}
-scoped_refptr<gfx::GLContext> InitializeGLContext(gfx::GLSurface* surface) {
+gfx::GLContext* InitializeGLContext(gfx::GLSurface* surface) {
- scoped_refptr<gfx::GLContext> context(gfx::GLContext::CreateGLContext(NULL,
+ scoped_ptr<gfx::GLContext> context(gfx::GLContext::CreateGLContext(NULL,
surface));
if (!context.get()) {
LOG(ERROR) << "gfx::GLContext::CreateGLContext failed";
@@ -43,7 +43,7 @@ scoped_refptr<gfx::GLContext> InitializeGLContext(gfx::GLSurface* surface) {
return NULL;
}
- return context;
+ return context.release();
}
std::string GetGLString(unsigned int pname) {
@@ -84,11 +84,11 @@ bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
return false;
}
- scoped_refptr<gfx::GLSurface> surface(InitializeGLSurface());
+ scoped_ptr<gfx::GLSurface> surface(InitializeGLSurface());
if (!surface.get())
return false;
- scoped_refptr<gfx::GLContext> context(InitializeGLContext(surface.get()));
+ scoped_ptr<gfx::GLContext> context(InitializeGLContext(surface.get()));
if (!context.get())
return false;