Hi All:


    The method onFrameAvailable In FrameBufferSurface.cpp of Android:

------------------------------------------------------------
void FramebufferSurface::onFrameAvailable() {
    sp<GraphicBuffer> buf;
    sp<Fence> acquireFence;
    status_t err = nextBuffer(buf, acquireFence);
    if (err != NO_ERROR) {
        ALOGE("error latching nnext FramebufferSurface buffer: %s (%d)",
                strerror(-err), err);
        return;
    }
    err = mHwc.fbPost(mDisplayType, acquireFence, buf);
    if (err != NO_ERROR) {
        ALOGE("error posting framebuffer: %d", err);
    }
}
-------------------------------------------------------------

    fbPost be executed here, but in B2G, the fbPost is executed in 
GonkDisplayJB::SwapBuffers, not in 
gecko/widget/gonk/libdisplay/FramebufferSurface.cpp

--------------------------------------------------------------
bool
GonkDisplayJB::SwapBuffers(EGLDisplay dpy, EGLSurface sur)
{
    StopBootAnimation();
    mBootAnimBuffer = nullptr;

    // Should be called when composition rendering is complete for a frame.
    // Only HWC v1.0 needs this call.
    // HWC > v1.0 case, do not call compositionComplete().
    // mFBDevice is present only when HWC is v1.0.
    if (mFBDevice && mFBDevice->compositionComplete) {
        mFBDevice->compositionComplete(mFBDevice);
    }

#if ANDROID_VERSION == 17
    mList->dpy = dpy;
    mList->sur = sur;
#else
    mList->outbuf = nullptr;
    mList->outbufAcquireFenceFd = -1;
#endif
    eglSwapBuffers(dpy, sur);
    return Post(mFBSurface->lastHandle, mFBSurface->lastFenceFD);
}
--------------------------------------------------------------



I'm wondering why there's such a difference ?

on my device, the views on screen will be torn, especially when views change 
quickly.

But if I move the method {Post(mFBSurface->lastHandle, 
mFBSurface->lastFenceFD);} to 
gecko/widget/gonk/libdisplay/FramebufferSurface.cpp::onFrameAvailable() , this 
problem is resolved.

Any body could explain the reason ?  thanks in advance! 
_______________________________________________
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to