Tiled backing Store (iii)

Source: Internet
Author: User

3.the Qt WebKitQgraphicswebviewThis section describes how to use Qt'sQgraphicswebview implements the Shard backing store (Tiled backing store).


As shown in the static class diagram above, only the implementation of theThe interface of the Shard Underlay store client (tiledbackingstoreclient) Webcore::frame only hasShard backing Store Instances。 Other classes can only be accessed byWebcore::frame sent a message toShard backing Store。

Qgraphicswebview is a subclass of Qgraphicswidget. It is used to display visible content on the screen.
3.1 Reset the size of the Qgraphicswebview (Resize to content) by contentsThe Resizestocontents (boolean variable) is the Qgraphicswebview property. When using a shard policy, Qgraphicswebview is used to act as our content, and it should follow the main frame contentReset your size now。
As the Qt4.7 document says, if you set this property, Qgraphicswebview will automatically set its size according to the size of the main frame. As a result, the top-level frame never has a scroll bar. This makes the fixed-point positioning of the CSS (fixed positioning) look like absolute positioning (absolute positioning)-element relative to the document instead of the view portpositioning.
If Resizestocontents is set to True, Webcore::frameview will notify Qgraphicswebview to update its size once the content of the frame changes.

3.2 Drawing Process

Here are the steps required to draw Qgraphicswebview:

  • According toQgraphicswebview coordinatesCalculates the visible area rectangle. Because Qgraphicswebview resets its size according to the size of the frame content, whenQgraphicswebview the visible area rectangle changes when scrolling or zooming。Shard backing store creating tiles requires such a visible area。

  • Make sure the entire visible area is covered by tiles. For visible areas that are not covered by tiles, it will repeatedly create tiles that are the center of the view port, until all visible areas are overwritten. The distance is calculated based onManhattan distance algorithm (Manhattan distance).
    In order to not block drawing operations as much as possible, tile creation takes the form of asynchronous execution, reflected inThe Shard Underlay store, asynchronously, is a shard backing store implemented by starting the Shard Underlay store timer:Starttilecreationtimer.

  • The content of the frame is drawn to the back buffer of each tile, and the tile is updated in such a way that the update is also asynchronous.

  • The drawpixmap function of the QT brush draws the back buffer

Original: http://xbfp2b2n.blog.sohu.com/196617339.html

Tiled backing Store (iii)

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.