summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorsievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 15:34:29 +0000
committersievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 15:34:29 +0000
commita52c7f7e3429aa84e2ea5362b001d7eb54063584 (patch)
tree3383aeb9053cf8251e5ca0b82196a8bed8750776 /content
parent59bc34541cc823084224f6a8e08a02d79d9f7c5e (diff)
downloadchromium_src-a52c7f7e3429aa84e2ea5362b001d7eb54063584.zip
chromium_src-a52c7f7e3429aa84e2ea5362b001d7eb54063584.tar.gz
chromium_src-a52c7f7e3429aa84e2ea5362b001d7eb54063584.tar.bz2
Add GpuSurfaceTracker::SetNativeWidget() method.
This allows renderer-side compositor contexts to create native EGL surfaces when running kInProcessGpu (i.e. the window handle is set for the RWHV's surface). Essentially, this allows for creating SurfaceTexture producer contexts on Android. Review URL: https://codereview.chromium.org/11336040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu/gpu_surface_tracker.cc8
-rw-r--r--content/browser/gpu/gpu_surface_tracker.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/gpu/gpu_surface_tracker.cc b/content/browser/gpu/gpu_surface_tracker.cc
index e117ee2..dd451ef 100644
--- a/content/browser/gpu/gpu_surface_tracker.cc
+++ b/content/browser/gpu/gpu_surface_tracker.cc
@@ -107,4 +107,12 @@ gfx::AcceleratedWidget GpuSurfaceTracker::GetNativeWidget(int surface_id) {
return it->second.native_widget;
}
+void GpuSurfaceTracker::SetNativeWidget(
+ int surface_id, gfx::AcceleratedWidget widget) {
+ base::AutoLock lock(lock_);
+ SurfaceMap::iterator it = surface_map_.find(surface_id);
+ DCHECK(it != surface_map_.end());
+ it->second.native_widget = widget;
+}
+
} // namespace content
diff --git a/content/browser/gpu/gpu_surface_tracker.h b/content/browser/gpu/gpu_surface_tracker.h
index 44735e8..cf36b72 100644
--- a/content/browser/gpu/gpu_surface_tracker.h
+++ b/content/browser/gpu/gpu_surface_tracker.h
@@ -61,6 +61,9 @@ class GpuSurfaceTracker : public GpuSurfaceLookup {
// Note: This is an O(log N) lookup.
void SetSurfaceHandle(int surface_id, const gfx::GLSurfaceHandle& handle);
+ // Sets the native widget associated with the surface_id.
+ void SetNativeWidget(int surface_id, gfx::AcceleratedWidget widget);
+
// Gets the native handle for the given surface.
// Note: This is an O(log N) lookup.
gfx::GLSurfaceHandle GetSurfaceHandle(int surface_id);