Bug 1123734 - Notify global VsyncSource in hwc. r=mwu, r=mchang

This commit is contained in:
JerryShih 2015-01-20 08:21:00 -05:00
parent fe956ab5f2
commit 9614ef8ceb
3 changed files with 4 additions and 18 deletions

View File

@ -30,7 +30,8 @@
#include "mozilla/StaticPtr.h"
#include "cutils/properties.h"
#include "gfx2DGlue.h"
#include "nsWindow.h"
#include "gfxPlatform.h"
#include "VsyncSource.h"
#if ANDROID_VERSION >= 17
#include "libdisplay/FramebufferSurface.h"
@ -227,7 +228,8 @@ HwcComposer2D::Vsync(int aDisplay, nsecs_t aVsyncTimestamp)
LOGE("Non-uniform vsync interval: %lld\n", vsyncInterval);
}
mLastVsyncTime = aVsyncTimestamp;
nsWindow::NotifyVsync(vsyncTime);
gfxPlatform::GetPlatform()->GetHardwareVsync()->GetGlobalDisplay().NotifyVsync(vsyncTime);
}
// Called on the "invalidator" thread (run from HAL).

View File

@ -215,21 +215,6 @@ nsWindow::DoDraw(void)
}
}
/* static */ void
nsWindow::NotifyVsync(TimeStamp aVsyncTimestamp)
{
if (!gFocusedWindow) {
return;
}
CompositorVsyncDispatcher* vsyncDispatcher = gFocusedWindow->GetCompositorVsyncDispatcher();
// During bootup, there is a delay between when the nsWindow is created
// and when the Compositor is created, but vsync is already turned on
if (vsyncDispatcher) {
vsyncDispatcher->NotifyVsync(aVsyncTimestamp);
}
}
/*static*/ nsEventStatus
nsWindow::DispatchInputEvent(WidgetGUIEvent& aEvent)
{

View File

@ -50,7 +50,6 @@ public:
nsWindow();
virtual ~nsWindow();
static void NotifyVsync(mozilla::TimeStamp aVsyncTimestamp);
static void DoDraw(void);
static nsEventStatus DispatchInputEvent(mozilla::WidgetGUIEvent& aEvent);
static void DispatchTouchInput(mozilla::MultiTouchInput& aInput);