Android GUI system Surfaceflinger (Handlerefresh)

Source: Internet
Author: User

1.1.1 Handlerefresh

From the name, this function handles "refresh." After the difference between the old and the new version, we feel that this place should be the legacy of the old version of the "Scrap." In other words, it has no effect on the handling of Messagequeue::refresh events.

void Surfaceflinger::handlerefresh ()

{

BOOL Needinvalidate =false;

Const layervector&currentlayers (MDRAWINGSTATE.LAYERSSORTEDBYZ);

Const size_t Count =currentlayers.size ();

for (size_t i=0; i<count; i++) {

constsp<layerbase>& layer (currentlayers[i]);

if (Layer->onprecomposition ()) {

Needinvalidate =true;

}

}

if (needinvalidate) {

Signallayerupdate ();

}

}

This function is very simple, first call each layer onprecomposition, to determine whether the need for needinvalidate, the condition is layer:: mqueuedframes>0.

At the end of the function, it calls Signallayerupdate:

void Surfaceflinger::signallayerupdate () {

Meventqueue.invalidate ();

}

It can be seen that it is just directly using the Messagequeue::invalidate ():

void Messagequeue::invalidate () {

Mevents->requestnextvsync ();

}

The final requestnextvsync is used to schedule the next VSync event, which is valid only if the vsync rate is 0 o'clock. That is to say, only when we shut down the active escalation of the vsync, it does not match the previous analysis. So we can ignore Handlerefresh and believe that it will be cleaned up in the next release.

Source: From Lxs. http://blog.csdn.net/uiop78uiop78/

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.