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

Unified Diff: content/browser/renderer_host/gpu_message_filter.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
Index: content/browser/renderer_host/gpu_message_filter.cc
diff --git a/content/browser/renderer_host/gpu_message_filter.cc b/content/browser/renderer_host/gpu_message_filter.cc
index 0533829c651cd278cb6d67c1e27d0b8737676748..2286b53896ae06401094962eddcea53460b2ab33 100644
--- a/content/browser/renderer_host/gpu_message_filter.cc
+++ b/content/browser/renderer_host/gpu_message_filter.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "content/browser/gpu/gpu_process_host.h"
+#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/common/gpu/gpu_messages.h"
@@ -74,16 +75,26 @@ void GpuMessageFilter::OnEstablishGpuChannel(
}
void GpuMessageFilter::OnCreateViewCommandBuffer(
- int32 render_view_id,
+ int32 surface_id,
const GPUCreateCommandBufferConfig& init_params,
IPC::Message* reply) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
+ GpuSurfaceTracker* surface_tracker = GpuSurfaceTracker::Get();
+ gfx::PluginWindowHandle compositing_surface = gfx::kNullPluginWindow;
- gfx::PluginWindowHandle compositing_surface =
- render_widget_helper_->LookupCompositingSurface(render_view_id);
+ int renderer_id = 0;
+ int render_widget_id = 0;
+ bool result = surface_tracker->GetRenderWidgetIDForSurface(
+ surface_id, &renderer_id, &render_widget_id);
+ if (result && renderer_id == render_process_id_) {
+ compositing_surface = surface_tracker->GetSurfaceHandle(surface_id);
+ } else {
+ DLOG(ERROR) << "Renderer " << render_process_id_
+ << " tried to access a surface for renderer " << renderer_id;
+ }
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
if (!host || compositing_surface == gfx::kNullPluginWindow) {
// TODO(apatrick): Eventually, this IPC message will be routed to a
// GpuProcessStub with a particular routing ID. The error will be set if
@@ -95,7 +106,7 @@ void GpuMessageFilter::OnCreateViewCommandBuffer(
host->CreateViewCommandBuffer(
compositing_surface,
- render_view_id,
+ surface_id,
render_process_id_,
init_params,
base::Bind(&GpuMessageFilter::CreateCommandBufferCallback,
« no previous file with comments | « content/browser/renderer_host/gpu_message_filter.h ('k') | content/browser/renderer_host/image_transport_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698