summaryrefslogtreecommitdiffstats
path: root/chrome/gpu/gpu_channel.cc
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 17:46:23 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 17:46:23 +0000
commit77e74dbed3b57987515c260b651b72cec15825dc (patch)
tree66685b53d127093075f720f99fbb0869ab74c01d /chrome/gpu/gpu_channel.cc
parent1ad13a2d0dd8d03b50e6fbadd6a26ea72712d2d9 (diff)
downloadchromium_src-77e74dbed3b57987515c260b651b72cec15825dc.zip
chromium_src-77e74dbed3b57987515c260b651b72cec15825dc.tar.gz
chromium_src-77e74dbed3b57987515c260b651b72cec15825dc.tar.bz2
Initial port of accelerated compositor to Mac OS X 10.6. Reused
infrastructure added for Pepper 3D and Core Animation plugins to render the compositor's output. The implementation allocates a fake "plugin window handle" on the browser side which is the "root" handle, containing the compositor's output, and which, if present, is drawn before any other accelerated plugin instances. Added messages from GPU process to browser process for handling window resizing and presentation of output. Added support to GGL for "view" contexts on Mac OS X, used only for the accelerated compositor, and requiring explicit resize notifications. The remainder of this port will go into the WebKit repository under https://bugs.webkit.org/show_bug.cgi?id=43398 after this for dependency reasons. Tested manually with CSS 3D and WebGL demos. Several stability and correctness issues remain and will be addressed in following CLs; however, the current code works for the majority of basic use cases including switching between accelerated compositing on and off, and scrolling of content. BUG=38969 TEST=none Review URL: http://codereview.chromium.org/3067026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_channel.cc')
-rw-r--r--chrome/gpu/gpu_channel.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc
index ed0bfc3..36dbe3a 100644
--- a/chrome/gpu/gpu_channel.cc
+++ b/chrome/gpu/gpu_channel.cc
@@ -100,6 +100,7 @@ int GpuChannel::GenerateRouteID() {
}
void GpuChannel::OnCreateViewCommandBuffer(gfx::NativeViewId view_id,
+ int32 render_view_id,
int32* route_id) {
*route_id = 0;
@@ -124,6 +125,13 @@ void GpuChannel::OnCreateViewCommandBuffer(gfx::NativeViewId view_id,
// alternative would be to add a socket/plug pair like with plugins but that
// has issues with events and focus.
gpu_thread->Send(new GpuHostMsg_GetViewXID(view_id, &handle));
+#elif defined(OS_MACOSX)
+ // On Mac OS X we currently pass a (fake) PluginWindowHandle for the
+ // NativeViewId. We could allocate fake NativeViewIds on the browser
+ // side as well, and map between those and PluginWindowHandles, but
+ // this seems excessive.
+ handle = static_cast<gfx::PluginWindowHandle>(
+ static_cast<intptr_t>(view_id));
#else
// TODO(apatrick): This needs to be something valid for mac and linux.
// Offscreen rendering will work on these platforms but not rendering to the
@@ -133,7 +141,8 @@ void GpuChannel::OnCreateViewCommandBuffer(gfx::NativeViewId view_id,
*route_id = GenerateRouteID();
scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
- this, handle, NULL, gfx::Size(), 0, *route_id));
+ this, handle, NULL, gfx::Size(), 0, *route_id,
+ renderer_id_, render_view_id));
router_.AddRoute(*route_id, stub.get());
stubs_.AddWithID(stub.release(), *route_id);
#endif // ENABLE_GPU
@@ -155,7 +164,8 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(int32 parent_route_id,
parent_stub,
size,
parent_texture_id,
- *route_id));
+ *route_id,
+ 0, 0));
router_.AddRoute(*route_id, stub.get());
stubs_.AddWithID(stub.release(), *route_id);
#else