Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 9194005: gpu: reference target surfaces through a globally unique surface id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix more tests Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/gpu/gpu_process_host_ui_shim.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index a9b3c15f2d019599e5fcb8eea97ee9f519fce0bc..1b157807c49d7d0e8738974c33b6b8fce2b2a63a 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -403,21 +403,19 @@ void GpuProcessHost::EstablishGpuChannel(
void GpuProcessHost::CreateViewCommandBuffer(
gfx::PluginWindowHandle compositing_surface,
- int32 render_view_id,
- int32 client_id,
+ int surface_id,
+ int client_id,
const GPUCreateCommandBufferConfig& init_params,
const CreateCommandBufferCallback& callback) {
DCHECK(CalledOnValidThread());
#if defined(TOOLKIT_USES_GTK)
- ViewID view_id(client_id, render_view_id);
-
// There should only be one such command buffer (for the compositor). In
// practice, if the GPU process lost a context, GraphicsContext3D with
// associated command buffer and view surface will not be gone until new
// one is in place and all layers are reattached.
linked_ptr<SurfaceRef> surface_ref;
- SurfaceRefMap::iterator it = surface_refs_.find(view_id);
+ SurfaceRefMap::iterator it = surface_refs_.find(surface_id);
if (it != surface_refs_.end())
surface_ref = (*it).second;
else
@@ -426,11 +424,10 @@ void GpuProcessHost::CreateViewCommandBuffer(
if (compositing_surface != gfx::kNullPluginWindow &&
Send(new GpuMsg_CreateViewCommandBuffer(
- compositing_surface, render_view_id, client_id, init_params))) {
+ compositing_surface, surface_id, client_id, init_params))) {
create_command_buffer_requests_.push(callback);
#if defined(TOOLKIT_USES_GTK)
- surface_refs_.insert(std::pair<ViewID, linked_ptr<SurfaceRef> >(
- view_id, surface_ref));
+ surface_refs_.insert(std::make_pair(surface_id, surface_ref));
#endif
} else {
CreateCommandBufferError(callback, MSG_ROUTING_NONE);
@@ -478,12 +475,9 @@ void GpuProcessHost::OnCommandBufferCreated(const int32 route_id) {
}
}
-void GpuProcessHost::OnDestroyCommandBuffer(
- gfx::PluginWindowHandle window, int32 client_id,
- int32 render_view_id) {
+void GpuProcessHost::OnDestroyCommandBuffer(int32 surface_id) {
#if defined(TOOLKIT_USES_GTK)
- ViewID view_id(client_id, render_view_id);
- SurfaceRefMap::iterator it = surface_refs_.find(view_id);
+ SurfaceRefMap::iterator it = surface_refs_.find(surface_id);
if (it != surface_refs_.end())
surface_refs_.erase(it);
#endif // defined(TOOLKIT_USES_GTK)
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/gpu/gpu_process_host_ui_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698