diff --git a/widget/gonk/libdisplay/GonkDisplayJB.cpp b/widget/gonk/libdisplay/GonkDisplayJB.cpp index 130c6e8609b..336bb42874d 100644 --- a/widget/gonk/libdisplay/GonkDisplayJB.cpp +++ b/widget/gonk/libdisplay/GonkDisplayJB.cpp @@ -167,9 +167,8 @@ GonkDisplayJB::~GonkDisplayJB() ANativeWindow* GonkDisplayJB::GetNativeWindow() { - if (!mBootAnimBuffer.get()) { - StopBootAnimation(); - } + StopBootAnim(); + return mSTClient.get(); } @@ -235,10 +234,7 @@ GonkDisplayJB::GetDispSurface() bool GonkDisplayJB::SwapBuffers(EGLDisplay dpy, EGLSurface sur) { - if (mBootAnimBuffer.get()) { - StopBootAnimation(); - mBootAnimBuffer = nullptr; - } + StopBootAnim(); // Should be called when composition rendering is complete for a frame. // Only HWC v1.0 needs this call. @@ -337,10 +333,8 @@ GonkDisplayJB::QueueBuffer(ANativeWindowBuffer* buf) void GonkDisplayJB::UpdateDispSurface(EGLDisplay dpy, EGLSurface sur) { - if (mBootAnimBuffer.get()) { - StopBootAnimation(); - mBootAnimBuffer = nullptr; - } + StopBootAnim(); + eglSwapBuffers(dpy, sur); } @@ -356,6 +350,15 @@ GonkDisplayJB::GetPrevDispAcquireFd() return mDispSurface->GetPrevDispAcquireFd(); } +void +GonkDisplayJB::StopBootAnim() +{ + if (mBootAnimBuffer.get()) { + mBootAnimBuffer = nullptr; + } + StopBootAnimation(); +} + __attribute__ ((visibility ("default"))) GonkDisplay* GetGonkDisplay() diff --git a/widget/gonk/libdisplay/GonkDisplayJB.h b/widget/gonk/libdisplay/GonkDisplayJB.h index 76f1ee4da81..481a0bf468c 100644 --- a/widget/gonk/libdisplay/GonkDisplayJB.h +++ b/widget/gonk/libdisplay/GonkDisplayJB.h @@ -55,6 +55,8 @@ public: bool Post(buffer_handle_t buf, int fence); private: + void StopBootAnim(); + hw_module_t const* mModule; hw_module_t const* mFBModule; hwc_composer_device_1_t* mHwc;