Android GUI system Surfaceflinger (Postframebuffer)

Source: Internet
Author: User

1.1.1 Postframebuffer

In the multiple buffer mechanism, only the display data can be written to the framebuffer to truly display on the physical screen. The output from the previous sections is backbuffers, and we need a final step to--postframebuffer.

void Surfaceflinger::p ostframebuffer ()

{...

Const DISPLAYHARDWARE&HW (graphicplane (0). Displayhardware ());

...

Hw.flip (mswapregion)//switch front and back table buffer

size_t numlayers =mvisiblelayerssortedbyz.size ();

for (size_t i = 0; I <numLayers; i++) {

Mvisiblelayerssortedbyz[i]->onlayerdisplayed ();

}

...

}

Think about this from the perspective of the OpenGL local window:

Queuebuffer

Once the "producer" completes production, it needs to re-enter the current buffer so that the "consumer" can do the next processing

Dequeuebuffer

For the "producer" to continue the next round of work, it will deque again

The basic idea is this, but the Android system encapsulates some of the steps into the displayhardware, which we'll see later.

When the Displayhardware::flip is complete, the respective notices are visible layer their contents have been shown.

void Displayhardware::flip (const region& Dirty) const

{...

Mpageflipcount++;//flip Count

if (mhwc->initcheck () = = No_error) {

Mhwc->commit ();

} else {

Eglswapbuffers (dpy, surface);

}

...

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.