Bug 1253052. Only schedule paint when apz aware event listener is added if event regions/apz are enabled. r=kats

Bug 1210057 added this, we should only do it if apz/event regions are enabled.
This commit is contained in:
Timothy Nikkel 2016-03-03 15:52:09 -06:00
parent 159d69538f
commit cd3746d910
3 changed files with 16 additions and 3 deletions

View File

@ -49,6 +49,7 @@
#include "nsSandboxFlags.h"
#include "xpcpublic.h"
#include "nsIFrame.h"
#include "nsDisplayList.h"
namespace mozilla {
@ -457,7 +458,7 @@ EventListenerManager::ProcessApzAwareEventListenerAdd()
}
}
if (doc) {
if (doc && nsDisplayListBuilder::LayerEventRegionsEnabled()) {
nsIPresShell* ps = doc->GetShell();
if (ps) {
nsIFrame* f = ps->GetRootFrame();

View File

@ -1420,14 +1420,25 @@ bool
nsDisplayListBuilder::IsBuildingLayerEventRegions()
{
if (mMode == PAINTING) {
// Note: this is the only place that gets to query LayoutEventRegionsEnabled
// 'directly' - other code should call this function.
// Note: this function and LayerEventRegionsEnabled are the only places
// that get to query LayoutEventRegionsEnabled 'directly' - other code
// should call this function.
return gfxPrefs::LayoutEventRegionsEnabledDoNotUseDirectly() ||
mAsyncPanZoomEnabled;
}
return false;
}
/* static */ bool
nsDisplayListBuilder::LayerEventRegionsEnabled()
{
// Note: this function and IsBuildingLayerEventRegions are the only places
// that get to query LayoutEventRegionsEnabled 'directly' - other code
// should call this function.
return gfxPrefs::LayoutEventRegionsEnabledDoNotUseDirectly() ||
gfxPlatform::AsyncPanZoomEnabled();
}
void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
{
aDestination.BorderBackground()->AppendToTop(BorderBackground());

View File

@ -435,6 +435,7 @@ public:
mLayerEventRegions = aItem;
}
bool IsBuildingLayerEventRegions();
static bool LayerEventRegionsEnabled();
bool IsInsidePointerEventsNoneDoc()
{
return CurrentPresShellState()->mInsidePointerEventsNoneDoc;