summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/gpu_surface_tracker.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-16 00:44:34 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-16 00:44:34 +0000
commit6dff3815fda9c86c68b50fcd5d95c6c396d5e209 (patch)
tree7226dcb0a5f481f2fa56a21329d6062694f18f81 /content/browser/gpu/gpu_surface_tracker.cc
parent6cd41bde72984f096af5c92c20833322bca8e230 (diff)
downloadchromium_src-6dff3815fda9c86c68b50fcd5d95c6c396d5e209.zip
chromium_src-6dff3815fda9c86c68b50fcd5d95c6c396d5e209.tar.gz
chromium_src-6dff3815fda9c86c68b50fcd5d95c6c396d5e209.tar.bz2
Not ready for review yet.
Allow GPU process to present to the compositing surface without the involvement of the UI thread. This is to prevent a potential deadlock and so I can revert this: https://chromiumcodereview.appspot.com/9295021 BUG=111514 Review URL: http://codereview.chromium.org/9380019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_surface_tracker.cc')
-rw-r--r--content/browser/gpu/gpu_surface_tracker.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/content/browser/gpu/gpu_surface_tracker.cc b/content/browser/gpu/gpu_surface_tracker.cc
index ba15dab..909c39d 100644
--- a/content/browser/gpu/gpu_surface_tracker.cc
+++ b/content/browser/gpu/gpu_surface_tracker.cc
@@ -6,6 +6,10 @@
#include "base/logging.h"
+#if defined(OS_WIN)
+#include "ui/gfx/surface/accelerated_surface_win.h"
+#endif
+
GpuSurfaceTracker::GpuSurfaceTracker()
: next_surface_id_(1) {
}
@@ -86,3 +90,27 @@ gfx::GLSurfaceHandle GpuSurfaceTracker::GetSurfaceHandle(int surface_id) {
return surface_map_[surface_id].handle;
}
+#if defined(OS_WIN) && !defined(USE_AURA)
+
+void GpuSurfaceTracker::AsyncPresentAndAcknowledge(
+ int surface_id,
+ const gfx::Size& size,
+ int64 surface_handle,
+ const base::Closure& completion_task) {
+ base::AutoLock lock(lock_);
+
+ SurfaceMap::iterator it = surface_map_.find(surface_id);
+ if (it == surface_map_.end() || !it->second.handle.accelerated_surface) {
+ completion_task.Run();
+ return;
+ }
+
+ it->second.handle.accelerated_surface->AsyncPresentAndAcknowledge(
+ it->second.handle.handle,
+ size,
+ surface_handle,
+ completion_task);
+}
+
+#endif // OS_WIN
+