diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 02:23:49 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 02:23:49 +0000 |
commit | 47940c847f7ac66275bc3470c32134f50f10bd6c (patch) | |
tree | 2adc8ca47152a49c10ee627bb7750bcad51166e9 /content/browser/gpu | |
parent | 32cfc187ed05a324764f875ae0dada6e64c29c19 (diff) | |
download | chromium_src-47940c847f7ac66275bc3470c32134f50f10bd6c.zip chromium_src-47940c847f7ac66275bc3470c32134f50f10bd6c.tar.gz chromium_src-47940c847f7ac66275bc3470c32134f50f10bd6c.tar.bz2 |
PluginWindowHandle -> GLSurfaceHandle for GPU process rendering surfaces.
PluginWindowHandle is limited to just a native window handle, and isn't expressive enough to handle a variety of cases (present and future):
1- no render surface (offscreen)
2- a transport surface (for a renderer, requiring synchonization on swap), allocated by the browser as a native window (desktop linux, win)
3- a transport surface, without a native window handle, allocated by the GPU process (mac, linux aura)
The discrimination between some of these cases (e.g. desktop linux vs linux aura) is currently done with small hacks, which this CL cleans up.
But mostly this is to prepare for new cases:
4- a main surface (for the UI), allocated by the browser as a native window (aura) - in this CL
5- a transport surface in the form of a texture in the UI gl context (aura) - in a future CL
BUG=99516
TEST=run chrome, go to poster circle. Check that everything works, including with resizing the window.
Review URL: http://codereview.chromium.org/9353001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu')
-rw-r--r-- | content/browser/gpu/gpu_process_host.cc | 6 | ||||
-rw-r--r-- | content/browser/gpu/gpu_process_host.h | 2 | ||||
-rw-r--r-- | content/browser/gpu/gpu_process_host_ui_shim.cc | 6 | ||||
-rw-r--r-- | content/browser/gpu/gpu_surface_tracker.cc | 6 | ||||
-rw-r--r-- | content/browser/gpu/gpu_surface_tracker.h | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 8ae3879..651c157 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -431,7 +431,7 @@ void GpuProcessHost::EstablishGpuChannel( } void GpuProcessHost::CreateViewCommandBuffer( - gfx::PluginWindowHandle compositing_surface, + gfx::GLSurfaceHandle compositing_surface, int surface_id, int client_id, const GPUCreateCommandBufferConfig& init_params, @@ -448,10 +448,10 @@ void GpuProcessHost::CreateViewCommandBuffer( if (it != surface_refs_.end()) surface_ref = (*it).second; else - surface_ref.reset(new SurfaceRef(compositing_surface)); + surface_ref.reset(new SurfaceRef(compositing_surface.handle)); #endif // defined(TOOLKIT_USES_GTK) - if (compositing_surface != gfx::kNullPluginWindow && + if (!compositing_surface.is_null() && Send(new GpuMsg_CreateViewCommandBuffer( compositing_surface, surface_id, client_id, init_params))) { create_command_buffer_requests_.push(callback); diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index e0cd91b..c1394cb 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h @@ -71,7 +71,7 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate, // Tells the GPU process to create a new command buffer that draws into the // window associated with the given renderer. void CreateViewCommandBuffer( - gfx::PluginWindowHandle compositing_surface, + gfx::GLSurfaceHandle compositing_surface, int surface_id, int client_id, const GPUCreateCommandBufferConfig& init_params, diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 4f32e79..53a3ee1 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -248,14 +248,14 @@ void GpuProcessHostUIShim::OnResizeView(int32 surface_id, if (!view) return; - gfx::PluginWindowHandle handle = view->GetCompositingSurface(); + gfx::GLSurfaceHandle surface = view->GetCompositingSurface(); // Resize the window synchronously. The GPU process must not issue GL // calls on the command buffer until the window is the size it expects it // to be. #if defined(TOOLKIT_USES_GTK) GdkWindow* window = reinterpret_cast<GdkWindow*>( - gdk_xid_table_lookup(handle)); + gdk_xid_table_lookup(surface.handle)); if (window) { Display* display = GDK_WINDOW_XDISPLAY(window); gdk_window_resize(window, size.width(), size.height()); @@ -264,7 +264,7 @@ void GpuProcessHostUIShim::OnResizeView(int32 surface_id, #elif defined(OS_WIN) // Ensure window does not have zero area because D3D cannot create a zero // area swap chain. - SetWindowPos(handle, + SetWindowPos(surface.handle, NULL, 0, 0, std::max(1, size.width()), diff --git a/content/browser/gpu/gpu_surface_tracker.cc b/content/browser/gpu/gpu_surface_tracker.cc index 280f48f..8307a7c 100644 --- a/content/browser/gpu/gpu_surface_tracker.cc +++ b/content/browser/gpu/gpu_surface_tracker.cc @@ -20,7 +20,7 @@ GpuSurfaceTracker* GpuSurfaceTracker::GetInstance() { int GpuSurfaceTracker::AddSurfaceForRenderer(int renderer_id, int render_widget_id) { base::AutoLock lock(lock_); - SurfaceInfo info = { renderer_id, render_widget_id, gfx::kNullPluginWindow }; + SurfaceInfo info = { renderer_id, render_widget_id }; int surface_id = next_surface_id_++; surface_map_[surface_id] = info; return surface_id; @@ -60,14 +60,14 @@ bool GpuSurfaceTracker::GetRenderWidgetIDForSurface(int surface_id, } void GpuSurfaceTracker::SetSurfaceHandle(int surface_id, - gfx::PluginWindowHandle handle) { + gfx::GLSurfaceHandle handle) { base::AutoLock lock(lock_); DCHECK(surface_map_.find(surface_id) != surface_map_.end()); SurfaceInfo& info = surface_map_[surface_id]; info.handle = handle; } -gfx::PluginWindowHandle GpuSurfaceTracker::GetSurfaceHandle(int surface_id) { +gfx::GLSurfaceHandle GpuSurfaceTracker::GetSurfaceHandle(int surface_id) { base::AutoLock lock(lock_); DCHECK(surface_map_.find(surface_id) != surface_map_.end()); return surface_map_[surface_id].handle; diff --git a/content/browser/gpu/gpu_surface_tracker.h b/content/browser/gpu/gpu_surface_tracker.h index 17fa13a..e314a05 100644 --- a/content/browser/gpu/gpu_surface_tracker.h +++ b/content/browser/gpu/gpu_surface_tracker.h @@ -48,11 +48,11 @@ class GpuSurfaceTracker { // Sets the native handle for the given surface. // Note: This is an O(log N) lookup. - void SetSurfaceHandle(int surface_id, gfx::PluginWindowHandle handle); + void SetSurfaceHandle(int surface_id, gfx::GLSurfaceHandle handle); // Gets the native handle for the given surface. // Note: This is an O(log N) lookup. - gfx::PluginWindowHandle GetSurfaceHandle(int surface_id); + gfx::GLSurfaceHandle GetSurfaceHandle(int surface_id); // Gets the global instance of the surface tracker. Identical to Get(), but // named that way for the implementation of Singleton. @@ -62,7 +62,7 @@ class GpuSurfaceTracker { struct SurfaceInfo { int renderer_id; int render_widget_id; - gfx::PluginWindowHandle handle; + gfx::GLSurfaceHandle handle; }; typedef std::map<int, SurfaceInfo> SurfaceMap; |