Bug 1306698 - Make sure that async changes to the plugin render mode do not cause AsyncShowPluginFrame to run when doing direct drawing. r=dvander
authorDavid Parks <dparks@mozilla.com>
Tue, 10 Jan 2017 17:47:25 -0800
changeset 374733 d6574c2d76116505dbd2505764f6f474d3ab8935
parent 374732 749b7caa7b62106dd1e176b25a333b081160578c
child 374734 38b87ab25dbe4d08f5121f13c96aa2aa756cd83d
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1306698
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1306698 - Make sure that async changes to the plugin render mode do not cause AsyncShowPluginFrame to run when doing direct drawing. r=dvander
dom/plugins/ipc/PluginInstanceChild.cpp
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -4073,16 +4073,23 @@ PluginInstanceChild::ReadbackDifferenceR
 void
 PluginInstanceChild::InvalidateRectDelayed(void)
 {
     if (!mCurrentInvalidateTask) {
         return;
     }
 
     mCurrentInvalidateTask = nullptr;
+
+    // When this method is run asynchronously, we can end up switching to
+    // direct drawing before while we wait to run.  In that case, bail.
+    if (IsUsingDirectDrawing()) {
+        return;
+    }
+
     if (mAccumulatedInvalidRect.IsEmpty()) {
         return;
     }
 
     if (!ShowPluginFrame()) {
         AsyncShowPluginFrame();
     }
 }