mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1120753 - Fallback to software vsync if hardware vsync fails to initialize on b2g. r=kats,mwu
This commit is contained in:
parent
d8cde2ed0d
commit
5ee7bd3f46
@ -65,10 +65,9 @@ public:
|
||||
void RemoveCompositorVsyncDispatcher(CompositorVsyncDispatcher* aCompositorVsyncDispatcher);
|
||||
|
||||
nsRefPtr<RefreshTimerVsyncDispatcher> GetRefreshTimerVsyncDispatcher();
|
||||
|
||||
protected:
|
||||
virtual Display& GetGlobalDisplay() = 0; // Works across all displays
|
||||
|
||||
protected:
|
||||
virtual ~VsyncSource() {}
|
||||
};
|
||||
|
||||
|
@ -437,7 +437,6 @@ public:
|
||||
return mGlobalDisplay;
|
||||
}
|
||||
|
||||
protected:
|
||||
class GonkDisplay MOZ_FINAL : public VsyncSource::Display
|
||||
{
|
||||
public:
|
||||
@ -486,6 +485,10 @@ gfxAndroidPlatform::CreateHardwareVsyncSource()
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
nsRefPtr<VsyncSource> vsyncSource = new GonkVsyncSource();
|
||||
if (!vsyncSource->GetGlobalDisplay().IsVsyncEnabled()) {
|
||||
NS_WARNING("Error enabling gonk vsync. Falling back to software vsync\n");
|
||||
return gfxPlatform::CreateHardwareVsyncSource();
|
||||
}
|
||||
return vsyncSource.forget();
|
||||
#else
|
||||
NS_WARNING("Hardware vsync not supported on android yet");
|
||||
|
@ -116,6 +116,9 @@ HwcComposer2D::HwcComposer2D()
|
||||
, mHasHWVsync(false)
|
||||
, mLock("mozilla.HwcComposer2D.mLock")
|
||||
{
|
||||
#if ANDROID_VERSION >= 17
|
||||
RegisterHwcEventCallback();
|
||||
#endif
|
||||
}
|
||||
|
||||
HwcComposer2D::~HwcComposer2D() {
|
||||
@ -154,8 +157,6 @@ HwcComposer2D::Init(hwc_display_t dpy, hwc_surface_t sur, gl::GLContext* aGLCont
|
||||
mColorFill = false;
|
||||
mRBSwapSupport = false;
|
||||
}
|
||||
|
||||
RegisterHwcEventCallback();
|
||||
#else
|
||||
char propValue[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.display.colorfill", propValue, "0");
|
||||
@ -196,6 +197,8 @@ HwcComposer2D::EnableVsync(bool aEnable)
|
||||
|
||||
device->eventControl(device, HWC_DISPLAY_PRIMARY, HWC_EVENT_VSYNC, aEnable);
|
||||
return aEnable;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user