Platform/GFX/APZ: Difference between revisions

From MozillaWiki
< Platform‎ | GFX
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
== AsyncPanZoomControllers ==
== AsyncPanZoomControllers ==


Inside the APZ module, every scrollable layer has an AsyncPanZoomController (APZC). Scrollable layers roughly correspond to the root document, documents in iframes, and overflow:scroll divs. See [[Platform/GFX/OffMainThreadCompositing|OMTC]] for more information about layers.
Inside the APZ module, every scrollable layer has an [https://mxr.mozilla.org/mozilla-central/source/gfx/layers/ipc/AsyncPanZoomController.h AsyncPanZoomController] (APZC). Scrollable layers roughly correspond to the root document, documents in iframes, and overflow:scroll divs. See [[Platform/GFX/OffMainThreadCompositing|OMTC]] for more information about layers.
 
The APZCs are arranged in a tree whose structure reflects the structure of the layer tree containing the layers that they correspond to, except that the APZC tree only has nodes for scrollable layers, while the layer tree has nodes for all layers. The APZC tree is managed by a class called [https://mxr.mozilla.org/mozilla-central/source/gfx/layers/composite/APZCTreeManager.h APZCTreeManager].


== Main APZ projects on the horizon ==
== Main APZ projects on the horizon ==

Revision as of 08:55, 22 October 2013

Introduction

The Async Pan/Zoom module (APZ) (formerly called "Async Pan/Zoom Controller" or "APZC") is a platform component that allows panning and zooming to be performed asynchronously (on the compositor thread rather than the main thead).

For zooming, this means that the APZ reacts to a pinch gesture immediately and instructs the compositor to scale the already-rendered layers at whatever resolution they have been rendered (so e.g. text becomes more blurry as you zoom in), and meanwhile sends a request to Gecko to re-render the content at a new resolution (with sharp text and all).

For panning, this means that the APZ asks Gecko to render a portion of a scrollable layer, called the "display port", that's larger than the visible portion. It then reacts to a pan gesture immediately, asking the compositor to render a different portion of the displayport (or, if the displayport is not large enough to cover the new visible region, then nothing in the portions it doesn't cover), and meanwhile sends a request to Gecko to render a new displayport. (The displayport can also be used when zooming out causes more content of a scrollable layer to be shown than before.)

Supported Platforms

The APZ module is currently enabled on B2G and Metro. Fennec has a Java implementation of asynchronous panning and zooming, but the plan is to port Fennec to use the APZ module as well.

The APZ module relies on OMTC, so a prerequisite for porting it to a platform is for OMTC to work on that platform.

AsyncPanZoomControllers

Inside the APZ module, every scrollable layer has an AsyncPanZoomController (APZC). Scrollable layers roughly correspond to the root document, documents in iframes, and overflow:scroll divs. See OMTC for more information about layers.

The APZCs are arranged in a tree whose structure reflects the structure of the layer tree containing the layers that they correspond to, except that the APZC tree only has nodes for scrollable layers, while the layer tree has nodes for all layers. The APZC tree is managed by a class called APZCTreeManager.

Main APZ projects on the horizon

  • Make APZ work well for Metro - bug 886321
  • Implement support for Fennec-like dynamic toolbar on B2G - bug 860812
  • Improve hit detection for the different touch-sensitive regions - bug 928833
  • Switch Fennec over from the Java version to the C++ APZ - bug 776030