summaryrefslogtreecommitdiffstats
path: root/webkit/tools/pepper_test_plugin
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 23:28:43 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 23:28:43 +0000
commitcd189bdbe4ad339765549b41530b59c51973d2cf (patch)
treeebb322b7c0004526cf77f0ac44df5734015e9cab /webkit/tools/pepper_test_plugin
parentd1015f1c5bc276109b62280694ec180e62ae909f (diff)
downloadchromium_src-cd189bdbe4ad339765549b41530b59c51973d2cf.zip
chromium_src-cd189bdbe4ad339765549b41530b59c51973d2cf.tar.gz
chromium_src-cd189bdbe4ad339765549b41530b59c51973d2cf.tar.bz2
Implemented async flushes for Pepper 3D.
Added waitForProgress field to NPDeviceContext3D to select between a flush (that pushes more work to the GPU process and waits for at least some of it to have been completed) and getting the current state as quickly as possible. The previous method of checking to see if the put offset had advanced was incorrect. TEST=trybots BUG=none Review URL: http://codereview.chromium.org/561058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/pepper_test_plugin')
-rw-r--r--webkit/tools/pepper_test_plugin/plugin_object.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/webkit/tools/pepper_test_plugin/plugin_object.cc b/webkit/tools/pepper_test_plugin/plugin_object.cc
index 6880099..4c1b2a6 100644
--- a/webkit/tools/pepper_test_plugin/plugin_object.cc
+++ b/webkit/tools/pepper_test_plugin/plugin_object.cc
@@ -438,6 +438,14 @@ void PluginObject::Destroy3D() {
#endif // INDEPENDENT_PLUGIN
}
+namespace {
+void AsyncFlushCallback(NPP npp,
+ NPDeviceContext* context,
+ NPError error,
+ void* user_data) {
+}
+}
+
void PluginObject::Draw3D() {
#if !defined(INDEPENDENT_PLUGIN)
if (!pglMakeCurrent(pgl_context_) && pglGetError() == PGL_CONTEXT_LOST) {
@@ -451,6 +459,18 @@ void PluginObject::Draw3D() {
pglSwapBuffers();
pglMakeCurrent(NULL);
+ // Async flushes just to see them working.
+ context3d_.waitForProgress = true;
+ device3d_->flushContext(npp_,
+ &context3d_,
+ AsyncFlushCallback,
+ reinterpret_cast<void*>(0x3D1));
+ context3d_.waitForProgress = false;
+ device3d_->flushContext(npp_,
+ &context3d_,
+ AsyncFlushCallback,
+ reinterpret_cast<void*>(0x3D2));
+
// Schedule another call to Draw.
browser->pluginthreadasynccall(npp_, Draw3DCallback, this);
#endif // INDEPENDENT_PLUGIN