Skip to content

Commit

Permalink
ImageTransportSurface: Get rid of multiple inheritance.
Browse files Browse the repository at this point in the history
This fixes a style guide violation where classes were inheriting from more than one non-pure interface. This refactoring is in preparation for having OSX use a similar code path.

Also some minor fixes to GLXImageTransportSurface:
- disable vsync in OnMakeCurrent because we are actually rendering offscreen via XComposite
- wait for SwapBuffersACK before processing more commands for flow control

BUG=none
TEST=3D CSS on TOUCH_UI build

Review URL: http://codereview.chromium.org/7839033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100145 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
backer@chromium.org committed Sep 8, 2011
1 parent c9b773f commit 538195f
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 129 deletions.
8 changes: 8 additions & 0 deletions content/common/gpu/gpu_channel_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ void GpuChannelManager::RemoveRoute(int32 routing_id) {
gpu_child_thread_->RemoveRoute(routing_id);
}

GpuChannel* GpuChannelManager::LookupChannel(int32 renderer_id) {
GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
if (iter == gpu_channels_.end())
return NULL;
else
return iter->second;
}

bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
bool msg_is_ok = true;
bool handled = true;
Expand Down
2 changes: 2 additions & 0 deletions content/common/gpu/gpu_channel_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class GpuChannelManager : public IPC::Channel::Listener,
void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
void RemoveRoute(int32 routing_id);

GpuChannel* LookupChannel(int32 renderer_id);

private:
// Message handlers.
void OnEstablishChannel(int renderer_id);
Expand Down
6 changes: 5 additions & 1 deletion content/common/gpu/gpu_command_buffer_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ void GpuCommandBufferStub::OnInitialize(

scoped_refptr<gfx::GLSurface> surface;
if (handle_)
surface = ImageTransportSurface::CreateSurface(this);
surface = ImageTransportSurface::CreateSurface(
channel_->gpu_channel_manager(),
render_view_id_,
renderer_id_,
route_id_);
else
surface = gfx::GLSurface::CreateOffscreenGLSurface(software_,
gfx::Size(1, 1));
Expand Down
4 changes: 1 addition & 3 deletions content/common/gpu/gpu_command_buffer_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <string>
#include <vector>

#include "base/id_map.h"
#include "base/memory/weak_ptr.h"
#include "base/process.h"
#include "base/task.h"
Expand Down Expand Up @@ -60,9 +61,6 @@ class GpuCommandBufferStub
// Get the GLContext associated with this object.
gpu::GpuScheduler* scheduler() const { return scheduler_.get(); }

// Get the GpuChannel associated with this object.
GpuChannel* channel() const { return channel_; }

// Identifies the renderer process.
int32 renderer_id() const { return renderer_id_; }

Expand Down
Loading

0 comments on commit 538195f

Please sign in to comment.