Bug 1095754 - Rather than apply geometry updates to plugins in the content process, collect updates and stash them in the shadow layer forwarder so that on the next composite, they update with the remote layer tree. r=roc

This commit is contained in:
Jim Mathies 2015-01-29 13:41:54 -06:00
Родитель 309093d510
Коммит 7149a4e627
3 изменённых файлов: 41 добавлений и 1 удалений

Просмотреть файл

@ -3252,7 +3252,17 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
// We could instead have the compositor send back an equivalent to WillPaintWindow, // We could instead have the compositor send back an equivalent to WillPaintWindow,
// but it should be close enough to now not to matter. // but it should be close enough to now not to matter.
if (layerManager && !layerManager->NeedsWidgetInvalidation()) { if (layerManager && !layerManager->NeedsWidgetInvalidation()) {
rootPresContext->ApplyPluginGeometryUpdates(); #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
if (XRE_GetProcessType() == GeckoProcessType_Content) {
// If this is a remotely managed widget (PluginWidgetProxy in content)
// store this information in the compositor, which ships this
// over to chrome for application when we paint.
rootPresContext->CollectPluginGeometryUpdates(layerManager);
} else
#endif
{
rootPresContext->ApplyPluginGeometryUpdates();
}
} }
// We told the compositor thread not to composite when it received the transaction because // We told the compositor thread not to composite when it received the transaction because

Просмотреть файл

@ -56,6 +56,7 @@
#include "mozilla/dom/TabParent.h" #include "mozilla/dom/TabParent.h"
#include "nsRefreshDriver.h" #include "nsRefreshDriver.h"
#include "Layers.h" #include "Layers.h"
#include "ClientLayerManager.h"
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
#include "gfxPrefs.h" #include "gfxPrefs.h"
#include "nsIDOMChromeWindow.h" #include "nsIDOMChromeWindow.h"
@ -3082,6 +3083,28 @@ nsRootPresContext::ApplyPluginGeometryUpdates()
mRegisteredPlugins.EnumerateEntries(PluginDidSetGeometryEnumerator, nullptr); mRegisteredPlugins.EnumerateEntries(PluginDidSetGeometryEnumerator, nullptr);
} }
void
nsRootPresContext::CollectPluginGeometryUpdates(LayerManager* aLayerManager)
{
#ifndef XP_MACOSX
// Collect and pass plugin widget configurations down to the compositor
// for transmission to the chrome process.
NS_ASSERTION(aLayerManager, "layer manager is invalid!");
mozilla::layers::ClientLayerManager* clm = aLayerManager->AsClientLayerManager();
PluginGetGeometryUpdateClosure closure;
mRegisteredPlugins.EnumerateEntries(PluginGetGeometryUpdate, &closure);
if (closure.mConfigurations.IsEmpty()) {
mRegisteredPlugins.EnumerateEntries(PluginDidSetGeometryEnumerator, nullptr);
return;
}
SortConfigurations(&closure.mConfigurations);
if (clm) {
clm->StorePluginWidgetConfigurations(closure.mConfigurations);
}
mRegisteredPlugins.EnumerateEntries(PluginDidSetGeometryEnumerator, nullptr);
#endif // #ifndef XP_MACOSX
}
static void static void
NotifyDidPaintForSubtreeCallback(nsITimer *aTimer, void *aClosure) NotifyDidPaintForSubtreeCallback(nsITimer *aTimer, void *aClosure)
{ {

Просмотреть файл

@ -76,6 +76,7 @@ class FontFaceSet;
} }
namespace layers { namespace layers {
class ContainerLayer; class ContainerLayer;
class LayerManager;
} }
} }
@ -1483,6 +1484,12 @@ public:
*/ */
void ApplyPluginGeometryUpdates(); void ApplyPluginGeometryUpdates();
/**
* Transfer stored plugin geometry updates to the compositor. Called during
* reflow, data is shipped over with layer updates. e10s specific.
*/
void CollectPluginGeometryUpdates(mozilla::layers::LayerManager* aLayerManager);
virtual bool IsRoot() MOZ_OVERRIDE { return true; } virtual bool IsRoot() MOZ_OVERRIDE { return true; }
/** /**