bug 1087048. Dispatch touch events after vsync aligned composites. r=benwa

This commit is contained in:
Mason Chang 2014-10-30 08:48:42 -07:00
parent f3b4fd4499
commit 06b697f7a6
2 changed files with 17 additions and 0 deletions

View File

@ -65,6 +65,10 @@
#endif
#include "mozilla/VsyncDispatcher.h"
#ifdef MOZ_WIDGET_GONK
#include "GeckoTouchDispatcher.h"
#endif
namespace mozilla {
namespace layers {
@ -273,6 +277,8 @@ CompositorVsyncObserver::Composite(TimeStamp aVsyncTimestamp)
// unregister the vsync.
UnobserveVsync();
}
DispatchTouchEvents(aVsyncTimestamp);
}
bool
@ -302,6 +308,16 @@ CompositorVsyncObserver::UnobserveVsync()
mIsObservingVsync = false;
}
void
CompositorVsyncObserver::DispatchTouchEvents(TimeStamp aVsyncTimestamp)
{
#ifdef MOZ_WIDGET_GONK
if (gfxPrefs::TouchResampling()) {
GeckoTouchDispatcher::NotifyVsync(aVsyncTimestamp);
}
#endif
}
void CompositorParent::StartUp()
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on the main Thread!");

View File

@ -113,6 +113,7 @@ private:
void NotifyCompositeTaskExecuted();
void ObserveVsync();
void UnobserveVsync();
void DispatchTouchEvents(TimeStamp aVsyncTimestamp);
bool mNeedsComposite;
bool mIsObservingVsync;