SlideShare a Scribd company logo
1 of 52
Download to read offline
Firefox OS Graphics inside
16/Dec/2015
about:me
Sotaro Ikeda (池田総太郎)
•Mozilla Corporation (Since 2013)
•Current Work :
• Graphics and Media
•Software Diagrams
• Firefox-diagrams
• https://github.com/sotaroikeda/firefox-diagrams/wiki/Firefox-Diagrams
• Android Diagrams
• https://github.com/sotaroikeda/android-diagrams/wiki/Android-Diagrams
about:document
• Explains about internal software structures of Firefox
OS graphics mainly about Layers and Compositing
• Diagrams are based on latest master gecko (gecko 45)
on 16/Dec/2015
• More detailed diagrams are at
• https://github.com/sotaroikeda/firefox-diagrams/wiki/Firefox-Diagrams
• Platform/GFX mozilla wiki
• https://wiki.mozilla.org/Platform/GFX/
• Doxygen extracted from mozilla-central gfx
• http://people.mozilla.org/~bgirard/doxygen/gfx/index.html
Rendering data flow
https://developer.mozilla.org/ja/docs/Introduction_to_Layout_in_Mozilla
Rendering data flow(added gfx steps)
Parse
Construct
Frame
Build
DisplayList
Create
Layer
Paint
to Layer Composite
Render
to Screen
Boundary between Layout and Graphics
FrameLayerBuilder nsDisplayItem
nsDisplayList
PaintedLayer
nsIFrame
nsDisplayListBuilder
create
build
LayerManager
CreatePaintedLayer()
create
DrawTarget
create
buffer
Allocate
DrawPaintedLayer()
Paint()
Paint To Graphics
Layout
Other Layers
create
Moz2D
thebes
gfxContext
Font
Paint To
Paint To
Boundary between Layout and Graphics
• nsDisplayListBuilder
• Manages a display list
• Contains the parameters that don't change from frame to frame
• nsIFrame can have many different visual parts. Constructs a display
list for a frame tree that contains one item for each visual part
• Display list could improve performance than traversing frame tree
directly
• nsDisplayList
• Manages a singly-linked list of display list items
• The display list items are sorted by z-order
• Can be used to paint the frames, to determine which frame is the
target of a mouse event, and to determine what areas need to be
repainted when scrolling
• Role is similar to 'scene graph'
• nsDisplayItem
• Unit of rendering and event testing
• Each instance represents an entity that can be drawn on the screen
e.g., a frame's CSS background, or a frame's text string
Boundary between Layout and Graphics
• FrameLayerBuilder
• Responsible for converting display lists into layer trees
• Every LayerManager needs an unique FrameLayerBuilder to build layers
• LayerManager
• Controls a tree of layers
• Uses transaction to update layers and painting of
• PaintedLayers
• A state of the layer tree at the end of a transaction is rendered to the target
• Layer
• Represents anything that can be rendered onto a destination surface
• Layers are primarily used to minimize invalidating and repainting
• PaintedLayer
• A Layer which we can paint into
• DrawTarget
• Class used for all drawing of Moz2D
• Layout paints into it directly or indirectly via gfxContext
Boundary between Layout and Graphics
• Moz2D
• Cross-platform interface onto the various graphics backends that
Gecko uses for rendering
• Mostly stateless—better suited to CSS rendering and eliminates
overhead
• Floating-point—better suits platform APIs
• API methods line up with HTML canvas
• https://wiki.mozilla.org/Platform/GFX/Moz2D
• Thebes
• C++ wrapper around Moz2D/Cairo, along with some Gecko-specific
utility code, and a text API that uses platform text handling.
• Cairo dependencies are going to be replaced by Moz2D
• Predecessor of Moz2D, but still in use
• Named after Cairo
LayerManager
Controls a tree of layers and uses transaction to update layers
• ClientLayerManager
• Used for off main thread composition for widget(screen)
• Handles only active layers
• Final composition is done by compositor on compositor thread
• BasicLayerManager
• Used for the following use cases
• Paints Inactive layers in PaintInactiveLayer()
• Off screen document rendering
• Main thread composition of widget (Not supported on Firefox
OS)
• During the drawing phase, each PaintedLayer is painted directly into
the target
Layers
Represents anything that can be rendered onto a destination surface.
Primarily used to minimize invalidating and repainting
• PaintedLayer
• A Layer which we can paint into
• ImageLayer
• A Layer which renders Images or video frames
• From ClientLayerManager point of view, majority of Images are rendered
into PaintedLayer
• ContainerLayer
• A Layer which other layers render into. It holds references to its children
• ColorLayer
• A Layer which just renders a solid color in its visible region
• CanvasLayer
• A Layer for HTML Canvas elements
• RefLayer
• ContainerLayer that refers to a "foreign" layer tree, through an ID.
• Used to refer to a tree in a different process
• ReadbackLayer
• It is created only by nsPluginFrame. Firefox OS does not use it
Compositing
https://wiki.mozilla.org/Gecko:Overview#Compositing
ClientLayerManagerLayerManagerComposite
Layer
create
LayerComposite
create
CompositableClient
create
CompositableHost
create
Compositor
DrawQuad()
TextureClientTextureHost
use
BindTexture()
use
Draw Buffer
use
use
forward
CompositingRenderTarget
create
forward
Child sideParent side
TextureData
use
Compositing
Action of flattening Layers into the final image that is shown on the
screen. ContainerLayers might be painted to intermediate surfaces
during Compositing
• Compositor
• An object that can draw quads on the screen (or on an off-screen render
target)
• Texture:
• An object that contains image data
• By Bug 1200595 fix, TextureClient's platform specific parts were split to
TextureData
• Compositable
• An object that can manipulate one or several textures, and knows how to
present them to the compositor
• Handle all the logic around texture transfer
• Layer
• A layer usually doesn't know much about compositing. It uses a
compositable to do the work
Compositors on Firefox OS
Two compositors are available on Firefox OS.
• CompositorOGL
• Use OpenGL for Compositing
• Firefox OS on gonk use it by default
• BasicCompositor
• Use Moz2D for Compositing
• Used when CompositorOGL is disabled
• Can be used when platform does not have GPU
• Can be tested by pref("layers.acceleration.disabled", true);
CompositorOGL
CompositableHost
CompositorOGL
(Compositor)
DrawQuad()
nsWindow
(nsIWidget)
nsScreenGonk
(nsIScreen)
ANativeWindow
GLContextEGL
(GLContext)
EGLSurfacedequeueBuffer()
queueBuffer()
libGLESv2.so
libEGL.so
create
SwapBuffers()
nsScreenManagerGonk
(nsIScreenManager)
create
GonkDisplay
create
TextureSourceOGL
BindTexture() TextureHost
create
LayerManagerComposite
BeginFrame()
EndFrame()
CompositorOGL
Uses OpenGL for Compositing. Its compositing is controlled by
LayerManagerComposite. BeginFrame() starts a new frame compositing
and EndFrame() flushes the current frame to the screen and tidy up
• nsWindow
• Gonk’s implementation of nsIWidget. nsIWidget is a wrapper of OS
platform related things. Roles of nsIWidget are different between os
platforms. On gonk, it handles touch inputs and screen
• ANativeWindow
• Android's struct to provide access to a native window and window
buffers.
• nsScreenGonk
• Gonk’s implementation of nsIScreen
• It wraps android’s display surface
• GonkDisplay
• Creates android’s display surface and renders boot animation
• It exits to start boot animation as soon as possible before xpcom
initialization
• After boot completes, its roles are superseded by nsScreenGonk and
HwcComposer2D
BasicCompositor
CompositableHost
BasicCompositor
DrawQuad()
nsWindow
(nsIWidget)
nsScreenGonk
DequeueBuffer()
QueueBuffer()
ANativeWindow
dequeueBuffer()
queueBuffer()
StartRemoteDrawingInRegion()
EndRemoteDrawingInRegion()
nsScreenManagerGonk
create
GonkDisplay
create
TextureSourceBasic
GetSurface()
TextureHost
create
DrawTarget
create FillRect()
SourceSurface
create
use
LayerManagerComposite
BasicCompositor
BeginFrame()
EndFrame()
BasicCompositor
• Uses Moz2D for compositing
• On gonk, there is no valid use case except no GPU devices
• BasicCompositor gets DrawTarget from nsWindow
• Extra color conversions might happen during compositing on
current gonk (like Flame)
• Android applications draw with RGB color. But gecko draws contents
with BGR
Types of TexutureData/TextureHost on Firefox OS
• GrallocTextureData/GrallocTextureHostOGL
• A wrapper of android gralloc buffer
• Always use GrallocTextureData if gralloc could be allocated
• Disable gralloc for gfx::SurfaceFormat::A8
• Disable gralloc if width/height is more than 4096. Many devices do
not support more than 4096
• GrallocTextureHostOGL is used when CompositorOGL is used
• ShmemTextureData/ShmemTextureHost
• A wrapper of Shmem
• Used when TextureClient is not in chrome process
• Shmem is gecko's platform independent memory for cross process
• On gonk, android's ashmem is used for Shmem
• MemoryTextureData/MemoryTextureHost
• A Wrapper of raw memory
• Used when TextureClient is in chrome process
• GrallocTextureHostBasic
• GrallocTextureHostBasic is used when BasicCompositor is used
• Used with GrallocTextureData
GrallocTextureData/GrallocTextureHostOGL
DrawQuad()
BindTexture()
CompositableClientCompositableHost
TextureClientGrallocTextureHostOGL
use use
use
forward
Child sideParent side
GrallocTextureData
use
SharedBuffer
ManagerChild
SharedBuffer
ManagerParent
IPC
allocate
GraphicBuffer
ISurfaceAllocator
AllocGrallocBuffer()
AllocGrallocBuffer()
CompositorOGL
EGLImage
GL Texture
GLTextureSource
GrallocTextureData/GrallocTextureHostOGL
• Gralloc (android::GraphicBuffer) is shared between
GrallocTextureData and GrallocTextureHostOGL
• gralloc could be directly bounded to Open GL texture by using
EGLImage
• SharedBufferManagerParent allocates gralloc in chrome
process and delivers it to child side
• SharedBufferManagerParent/Child pairs is allocated for
chrome process and for each content process
• SharedBufferManagerParent/Child owns a thread to handle
gralloc allocation, since the allocation takes a long time
Off-main-thread compositing (OMTC)
Child sideParent side
nsWindow
(nsIWidget)
CompositorParent
create
CompositorChild
create
IPC
Compositor
LayerManager
Composite
create
ClientLayerManager
create
forward
Thread
create
create
LayerTransaction
Child
create
LayerTransaction
Parent
LayerManager
Composite
CompositorChild
IPC
create
forward
LayerComposite
create
Layer
create
Off-main-thread compositing (OMTC)
CompositorParent creates a thread for compositing(compositor
thread) and run compositing tasks and related IPC on the thread
• PCompositor protocol
• Used to manage communication between the main thread
(CompositorChild side) and the compositor thread
(CompositorParent side). It's primary purpose is to manage the
PLayerTransaction sub protocol
• PLayerTransaction protocol
• Atomically publishes layer subtrees from main thread
(LayerTransactionChild side) to a "shadow“(LayerTransactionParent
side) and atomically updating a published subtree. ("Atomic" in this
sense is wrt painting)
Compositing of child process layers
Chrome process
CompositorParent
LayerManager
Composite
TabChildTabParent
IPC
ClientLayer
Manager
PuppetWidget
(nsIWidget)
Child process
create
create
ClientLayer
Manager
forward
RefLayerComposite
LayerComposite
create
nsSubDocument
Frame
RenderFrame
Child
RenderFrame
Parent
IPC
create create
nsFrame
Loader
CreateRefLayer()
ClientRefLayer
create
CrossProcess
CompositorParent
CompositorChild
IPC
LayerTransaction
Child
create
LayerTransaction
Parent
CompositorChild
IPC
create
create
create
forward
forward
nsDisplayRemote
create
Layer
create
Compositing of child process layers
• When a document is loaded in child process (like by <iframe>), layers
are created in the process
• nsSubDocumentFrame could be created by several tags like <iframe> by
NS_NewSubDocumentFrame()
• PRenderFrame (in the layout sense of "frame") represents one web
"page". It's used to graft content processes' layer trees into chrome's
rendering path. RenderFrameParent is for chrome side
• ClientRefLayer and RefLayerComposite are created for the
RenderFrameParent. RefLayer refers to a layer tree in child process
through an ID.
• LayerComposites of the layer trees are created by
LayerManagerComposite via CrossProcessCompositorParent
• The LayerComposites are connected to RefLayerComposite only during
compositing by using AutoResolveRefLayers
PaintedLayer (scrollable)
TextureClient
TileClient TileClient
Child sideParent side
LayerManager
Composite
ClientLayerManager
LayerManager
Composite
forward
ClientTiledPaintedLayerPaintedLayerComposite
create create
TiledContentHost MultiTiledContentClient
TextureClientTextureHost
TiledLayerBufferComposite
(TiledLayerBuffer)
TileHost
gfxShmSharedReadLock
(gfxSharedReadLock)
ShmemSection
TileClient
gfxShmSharedReadLock
(gfxSharedReadLock)
ClientMultiTiledLayerBuffer
(TiledLayerBuffer)
TextureClientPool
GetTextureClient()
TextureClient
alloc
PaintedLayer (scrollable)
ClientTiledPaintedLayer is always created as PaintedLayer on gonk.
If ClientTiledPaintedLayer is scrollable, MultiTiledContentClient is
created as CompositableClient. Tile size is choosen so that there are
between 2 and 4 tiles per screen width (tile size max: 1024)
• ClientTiledPaintedLayer
• An implementation of PaintedLayer that only supports remote
composition that is backed by tiles
• MultiTiledContentClient
• An implementation of TiledContentClient that supports multiple tiles
and a low precision buffer
• TileClient
• Represent a single tile in tiled buffer. The buffer keeps tiles, each tile
keeps a reference to a texture client and a read-lock. This read-lock is
used to help implement a copy-on-write mechanism
• TextureClientPool
• Caches TextureClients to improve performance
• Used by TileClient
PaintedLayer (non scrollable)
Child sideParent side
LayerManager
Composite
ClientLayerManager
LayerManager
Composite
forward
ClientTiledPaintedLayerPaintedLayerComposite
create create
TiledContentHost SingleTiledContentClient
TextureClientTextureHost
TiledLayerBufferComposite
(TiledLayerBuffer)
TileHost
gfxShmSharedReadLock
(gfxSharedReadLock)
ShmemSection
TileClient
gfxShmSharedReadLock
(gfxSharedReadLock)
ClientSingleTiledLayerBuffer
PaintedLayer (non scrollable)
If ClientTiledPaintedLayer is non scrollable,
SingleTiledContentClient is created as CompositableClient. Host
side works same to MultiTiledContentClient
• SingleTiledContentClient
• Allocate one tile for whole PaintedLayer
• Does not use TextureClientPool
ImageLayer (synchronous)
Child sideParent side
LayerManager
Composite
ClientLayerManager
LayerManager
Composite
forward
ClientImageLayerCanvasLayerComposite
create create
ImageHost
create
ImageClientSingle
TextureClientTextureHost
ImageContainer
Image
ImageLayer (synchronous)
• On Firefox OS, all ImageContainers uses synchronous mode except
video frame renderings.
• Delivers images to Compositor side via main thread
• In the majority of cases, ClientImageLayer is not used for image
rendering. Instead, they are painted into PaintedLayer
• ClientImageLayers are typically created for animated images
ImageLayer (asynchronous)
TextureHost TextureClient
Image
Child sideParent side
ImageBridgeChildImageBridgeParent
IPC
LayerManager
Composite
ClientLayerManager
LayerManager
Composite
forward
ClientImageLayerImageLayerComposite
create create
ImageClientBridgeImageHost
ImageContainer
ImageClientSingle
ImageContainerChildImageContainerParent
IPC
create
create
create
SendAsyncDelete()
CreateImageClient()
VideoFrameContainer
SetCurrentImages()AppendImageCompositeNotification()
NotifyComposite()
GetAsyncContainerID()
Image
TextureClientTextureHost
CompositorParent
ExtractImageCompositeNotifications()
NotifyImageComposites()
ImageLayer (asynchronous)
• On Firefox OS, asynchronous mode of ImageComtainer is used for video
frames renderings. TextureClients are delivered to Compositor side via
ImageBridge thread
• To reduce video frames drops, ImageContainer, ImageClientSingle and
ImageHost could hold multiple images with timestamps(Bug 1143575).
ImageHost renders Images based on timestamps.
• Image
• Represents a buffer of pixel data. The data can be in one of various
formats including YCbCr
• If the buffer is not TextureClient, its content is copied to
TextureClient at ImageClientSingle
• PImageBridge protocol
• Used to allow isolated threads or processes to push frames directly
to the compositor thread/process without relying on the main
thread which might be too busy dealing with content script.
• ImageBridgeChild is child side object that run on ImageBridge
thread. ImageBridgeParent is parent side object that run on
Compositor thread
2D Canvas (with GPU)
Child sideParent side
LayerManager
Composite
ClientLayerManager
LayerManager
Composite
forward
ClientImageLayerCanvasLayerComposite
create create
ImageHost
create
CanvasClientSharedSurface
SharedSurfaceTextureClient
(TextureClient)
CanvasRenderingContext2D
HTMLCanvasElement
DrawTargetSkia
(DrawTarget)
GL Texture
SharedSurface_Basic
(SharedSurface)
GrallocTextureData
(TextureData)
SharedSurfaceTextureData
(TextureData)
TextureClient
SharedSurfaceGralloc
(SharedSurface)
ProdCopy()
GrallocTextureHostOGL
2D Canvas (with GPU)
• CanvasRenderingContext2D renders to DrawTargetSkia. It
actually renders to OpenGL texture
• CanvasClientSharedSurface gets the OpenGL texture as
SharedSurface_Basic
• The texture is copied from SharedSurface_Basic to
SharedSurfaceGralloc by using GPU
• SharedSurfaceGralloc is wrapped by
SharedSurfaceTextureClient. But SharedSurfaceGralloc wraps
TextureClient. It is sad. It might be changed in future
WebGL
Child sideParent side
LayerManager
Composite
ClientLayerManager
LayerManager
Composite
forward
ClientImageLayerCanvasLayerComposite
create create
ImageHost
create
CanvasClientSharedSurface
SharedSurfaceTextureClient
(TextureClient)
HTMLCanvasElement
GrallocTextureData
(TextureData)
SharedSurfaceTextureData
(TextureData)
TextureClient
GrallocTextureHostOGL
WebGLContext1
(WebGLContext)
GLContextEGL
(GLContext)
create
GLScreenBuffer
EGLImage
GL Texture
GraphicBuffer
Front()
SharedSurfaceGralloc
(SharedSurface)
SurfaceFactory_Gralloc
(SurfaceFactory)
create
NewTexClient()
create
WebGL
• WebGLContext renders to GLScreenBuffer
• CanvasClientSharedSurface gets front
buffer(SharedSurfaceTextureClient) by GLScreenBuffer::Front()
• The SharedSurfaceTextureClient is sent to Compositor side for
composition
• GLScreenBuffer
• Abstraction for the "default framebuffer" used by an offscreen
GLContext
• Rendering is published as SharedSurfaceTextureClient by
GLScreenBuffer::PublishFrame()
• OffscreenCanvas is wip
• Bug 709490, Bug 801176, Bug 1172796, Bug 1203382
• https://wiki.whatwg.org/wiki/OffscreenCanvas
Render to screen
CompositorOGL
(Compositor)
nsWindow
(nsIWidget)
nsScreenGonk
Surface
(ANativeWindow)
LayerManagerComposite
BeginFrame()
EndFrame()
HwcComposer2D
TryRenderWithHwc()
Render()
hwc hal
pepare()
set()
GetScreen()
FramebufferSurface
(DisplaySurface)
GetDisplaySurface()
GLContextEGL
EGLSurface
SwapBuffers()
dequeueBuffer()
queueBuffer()
onFrameAvailable()
lastHandle
GetPrevDispAcquireFd()
setReleaseFenceFd()
Surface
(ANativeWindow)
Display
Render to screen(with CompositorOGL)
• On gonk, Compositing and "render to screen" are different
steps. Hwc (hardware compooser) does "render to screen".
Hwc also supports 2d compositing for limited number of layers
• https://source.android.com/devices/graphics/architecture.html#hwc
omposer
• When compositing is done only by CompositorOGL, resultant buffers
are delivered to FrameBufferSurface via ANativeWindow
• When Composer2D::Render() is called, Composer2D gets the buffer
from FrameBufferSurface and renders it to screen via hwc hal.
Types of Compositing on gonk
Compositing by using Compositor is not the only compositing on
gonk. LayerManagerComposite::Render() tries ‘Full hwc
composition’ at first. If it failed, then fallbacks to ‘ using OpenGL
for compositing’. The fallback could be ‘OpenGL compositing’ or
‘Hwc and OpenGL mixed compositing’
• Full hwc compositing
• All layers are composed by hwc. Open GL composition does not happen
• Open GL Compositing
• All layers are composed by Open GL
• Hwc just renders the composed result
• Hwc and OpenGL mixed compositing
• Some layers are composed by hwc and another layers are composed by
OpenGL
• Supported only by overlay hwc
• Uses it mainly for performance and power consumption especially of
video rendering
• Android uses it also for rendering DRM protected contents. Firefox OS
does not supports it. It is going to be added to Firefox OS(Bug 1049296)
Types of HWC
• Copybit HWC
• Majority of Firefox OS mobile products use it
• Use copybit hw for composition
• Does not have much power consumption advantage to OpenGL. If
over drawing exceed a specific level(150%), it fallbacks to OpenGL
composition
• Can handle multiple rectangles for each layer
• Does not support OpenGL+HWC mixed composition
• Overlay HWC
• Fx0 use it
• Better performance
• Not good at handling multiple rectangles in a layer
• Support OpenGL+HWC mixed composition
VsyncSource
https://wiki.mozilla.org/Project_Silk
HwcComposer2D
Vsync()
hwc hal
GonkVsyncSource
(VsyncSource)
NotifyVsync()
GonkDisplay
(VsyncSource::Display)
create
Content processChrome process
CompositorParent
CompositorVsync
Scheduler
GeckoTouch
Dispatcher
CompositeToTarget()
CompositorVsync
Dispatcher
NotifyVsync()
NotifyVsync()
SetNeedsComposite()
LayerManager
Composite
BeginTransaction()
EndTransaction()
RefreshTimerVsync
Dispatcher
NotifyVsync()
VsyncChildVsyncParent
IPCNotifyVsync()
RefreshDriverVsyncObserver
(VsyncObserver)
nsRefreshDriver
VsyncRefreshDriver
Timer
NotifyVsync()
NotifyVsync()
create
SetVsyncObserver()
VsyncChild
create
VsyncRefreshDriver
Timer
Tick()
nsViewManager
ProcessPendingUpdates()
PresShell
Paint()
VsyncSource
• VsyncSource is used to deliver vsync timing to
CompositorVsyncScheduler, nsRefreshDriver and
GeckoTouchDispatcher
• CompositorVsyncScheduler schedules CompositorParent's
compositing
• nsRefreshDriver schedules PresShell's painting or other
layout’s tasks like requestAnimationFrame(rAF).
• GeckoTouchDispatcher resamples touch events whenever a
vsync event occurs for smooth scrolling
• GonkVsyncSource uses hwc hal's vsync callback as vsync
source. If it is disabled, SoftwareVsyncSource is used.
Off-main-thread Animation(OMTA)
• Allows css animation to be performed asynchronously (on the
compositor thread rather than the main thread)
• Also referred as “Async Animations”
• Only supports opacity and transform of animations
• Implemented by Bug 768440 and Bug 1166173
Off-main-thread Animation(OMTA)
nsDisplayListBuilder
nsDisplayOpacity
nsDisplayTransform
nsDisplayItem
CanUseAsyncAnimations()
Child sideParent side
ContainerLayer
layers::Animation
AddAnimation()
layers::Animation
AsyncCompositionManager
CompositorParent
TransformShadowTree()
LayerManagerComposite
BeginTransaction()
EndTransaction()
RenderLayer()
AddAnimationsAndTransitionsToLayer()
AddAnimationsAndTransitionsToLayer()
SampleAnimations()
ContainerLayerComposite
LayerComposite
GetAnimations()
GetAnimationData()
SetShadowOpacity()
SetShadowTransform();
SetShadowTransformSetByAnimation()
Off-main-thread Animation(OMTA)
• AddAnimationsAndTransitionsToLayer() adds layers::Animation
to Layers. Only nsDisplayTransform and nsDisplayOpacity calls
it among nsDisplayItems
• layers::Animation is delivered to LayerComposite
• Just before compositing, CompositorParent calls
AsyncCompositionManager::TransformShadowTree(). It
transforms LayerComposite tree based on layers::Animation
• If more Composition is necessary to update animation,
CompositorParent schedules next compositing
Async Pan/Zoom(APZ)
• Allows panning and zooming to be performed
asynchronously (on the compositor thread rather than
the main thead).
• Reference
• https://dxr.mozilla.org/mozilla-central/source/gfx/doc/AsyncPanZoom-
HighLevel.png
• https://github.com/mozilla/gecko-
dev/blob/master/gfx/doc/AsyncPanZoom.md
• http://people.mozilla.org/~bgirard/doxygen/gfx/apz.html
• https://wiki.mozilla.org/Platform/GFX/APZ
• https://wiki.mozilla.org/Mobile/AsyncSubframePanning
• https://staktrace.com/spout/entry.php?id=834
Async Pan/Zoom(APZ)
https://dxr.mozilla.org/mozilla-central/source/gfx/doc/AsyncPanZoom-HighLevel.png
Async Pan/Zoom(APZ)
Content ProcessChrome Process
nsWindow PresShell
HandleEvent()
EventStateManager
PreHandleEvent()
PostHandleEvent()
TabParent TabChild
IPC
AsyncComposition
Manager
CompositorParent
TransformShadowTree()
RemoteContent
Controller
RenderFrameParent
AsyncPanZoomController
APZCTreeManager
ReceiveInputEvent()
HitTestingTreeNode
InputQueue
CancelableBlockState
APZEventState
APZCCallbackHelper
EventStateManager
PresShell
ActiveElement
Manager
SetContentState()
PuppetWidget
UpdateHitTestingTree()
LayerManager
Composite
set APZC
Layer
BeginTransaction()
EndTransaction()
Async Pan/Zoom(APZ)
• When layer transactions are receved at LayerTransactionParent,
CompositorParent requests APZCTreeManager to update hit-testing tree
based on the layer update by APZCTreeManager::UpdateHitTestingTree()
• nsWindow at first, sends an input event to APZCTreeManager by
APZCTreeManager::ReceiveInputEvent(). It manipulates frame metrics of
AsyncPanZoomControllers based on what type of input it is
• If the APZCTreeManager says to drop it, then nsWindow drops it
• If the APZCTreeManager does not say to drop it, nsWindow sends it to
normal event delivery route (to PresShell)
• Like OMTA, AsyncCompositionManager::TransformShadowTree()
transforms LayerComposite(Layer) tree based on
AsyncPanZoomController that is set to the Layer
• AsyncPanZoomController requests content repaint via
RemoteContentController
About “about:config”
Some prefs could visualize layers and painting updates
• layers.draw-borders
• Enable layer borders drawing
• layers.draw-tile-borders
• Enable tile broders drawing
• layers.acceleration.draw-fps
• Enable compositing fps counter daring
• nglayout.debug.paint_flashing
• Enable paint flashing
Q&A?

More Related Content

What's hot

React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMJimit Shah
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depthChris Simmonds
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Arif Amirani
 
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...Edureka!
 
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개nemoux
 
Support formation vidéo: Android Kotlin : développez des applications mobiles
Support formation vidéo: Android Kotlin : développez des applications mobiles Support formation vidéo: Android Kotlin : développez des applications mobiles
Support formation vidéo: Android Kotlin : développez des applications mobiles SmartnSkilled
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?Sergi Martínez
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react jsdhanushkacnd
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Top 50 Node.js Interview Questions and Answers | Edureka
Top 50 Node.js Interview Questions and Answers | EdurekaTop 50 Node.js Interview Questions and Answers | Edureka
Top 50 Node.js Interview Questions and Answers | EdurekaEdureka!
 
WEB SERVICE SOAP, JAVA, XML, JAXWS
WEB SERVICE SOAP, JAVA, XML, JAXWSWEB SERVICE SOAP, JAVA, XML, JAXWS
WEB SERVICE SOAP, JAVA, XML, JAXWSLhouceine OUHAMZA
 

What's hot (20)

React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
The Android graphics path, in depth
The Android graphics path, in depthThe Android graphics path, in depth
The Android graphics path, in depth
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
 
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...
 
React workshop
React workshopReact workshop
React workshop
 
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
(NEMO-UX) WAYLAND 기반 컴포지팅 최적화 기술 소개
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Support formation vidéo: Android Kotlin : développez des applications mobiles
Support formation vidéo: Android Kotlin : développez des applications mobiles Support formation vidéo: Android Kotlin : développez des applications mobiles
Support formation vidéo: Android Kotlin : développez des applications mobiles
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
React Native Workshop
React Native WorkshopReact Native Workshop
React Native Workshop
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
 
Introduction to Android Window System
Introduction to Android Window SystemIntroduction to Android Window System
Introduction to Android Window System
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Top 50 Node.js Interview Questions and Answers | Edureka
Top 50 Node.js Interview Questions and Answers | EdurekaTop 50 Node.js Interview Questions and Answers | Edureka
Top 50 Node.js Interview Questions and Answers | Edureka
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
WEB SERVICE SOAP, JAVA, XML, JAXWS
WEB SERVICE SOAP, JAVA, XML, JAXWSWEB SERVICE SOAP, JAVA, XML, JAXWS
WEB SERVICE SOAP, JAVA, XML, JAXWS
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
 

Similar to Firefox OS Graphics inside

Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Go for building cross-platform graphical apps
Go for building cross-platform graphical appsGo for building cross-platform graphical apps
Go for building cross-platform graphical appsAndrew Williams
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentDavid Galeano
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Web assembly with go
Web assembly with goWeb assembly with go
Web assembly with goWangChow1
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the EnterpriseJames Williams
 
How dojo works
How dojo worksHow dojo works
How dojo worksAmit Tyagi
 
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...Amir Zmora
 
Web dev tools review
Web dev tools reviewWeb dev tools review
Web dev tools reviewChanghyun Lee
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfSamiraKids
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...Andy Maleh
 
Developing games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalDeveloping games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalMichalis Kamburelis
 
Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Giorgio Cefaro
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with StarlingSergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with StarlingFlash Conference
 

Similar to Firefox OS Graphics inside (20)

Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Go for building cross-platform graphical apps
Go for building cross-platform graphical appsGo for building cross-platform graphical apps
Go for building cross-platform graphical apps
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Web assembly with go
Web assembly with goWeb assembly with go
Web assembly with go
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
 
How dojo works
How dojo worksHow dojo works
How dojo works
 
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
WebRTC Standards & Implementation Q&A - The Internals of WebRTC Browsers Impl...
 
Rexdockercon2017
Rexdockercon2017Rexdockercon2017
Rexdockercon2017
 
Web dev tools review
Web dev tools reviewWeb dev tools review
Web dev tools review
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 
Developing games and graphic visualizations in Pascal
Developing games and graphic visualizations in PascalDeveloping games and graphic visualizations in Pascal
Developing games and graphic visualizations in Pascal
 
Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 
Mini .net conf 2020
Mini .net conf 2020Mini .net conf 2020
Mini .net conf 2020
 
Sergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with StarlingSergey Gonchar - Fast rendering with Starling
Sergey Gonchar - Fast rendering with Starling
 
2011 05-jszurich
2011 05-jszurich2011 05-jszurich
2011 05-jszurich
 

Recently uploaded

Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 

Recently uploaded (20)

Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 

Firefox OS Graphics inside

  • 1. Firefox OS Graphics inside 16/Dec/2015
  • 2. about:me Sotaro Ikeda (池田総太郎) •Mozilla Corporation (Since 2013) •Current Work : • Graphics and Media •Software Diagrams • Firefox-diagrams • https://github.com/sotaroikeda/firefox-diagrams/wiki/Firefox-Diagrams • Android Diagrams • https://github.com/sotaroikeda/android-diagrams/wiki/Android-Diagrams
  • 3. about:document • Explains about internal software structures of Firefox OS graphics mainly about Layers and Compositing • Diagrams are based on latest master gecko (gecko 45) on 16/Dec/2015 • More detailed diagrams are at • https://github.com/sotaroikeda/firefox-diagrams/wiki/Firefox-Diagrams • Platform/GFX mozilla wiki • https://wiki.mozilla.org/Platform/GFX/ • Doxygen extracted from mozilla-central gfx • http://people.mozilla.org/~bgirard/doxygen/gfx/index.html
  • 5. Rendering data flow(added gfx steps) Parse Construct Frame Build DisplayList Create Layer Paint to Layer Composite Render to Screen
  • 6. Boundary between Layout and Graphics FrameLayerBuilder nsDisplayItem nsDisplayList PaintedLayer nsIFrame nsDisplayListBuilder create build LayerManager CreatePaintedLayer() create DrawTarget create buffer Allocate DrawPaintedLayer() Paint() Paint To Graphics Layout Other Layers create Moz2D thebes gfxContext Font Paint To Paint To
  • 7. Boundary between Layout and Graphics • nsDisplayListBuilder • Manages a display list • Contains the parameters that don't change from frame to frame • nsIFrame can have many different visual parts. Constructs a display list for a frame tree that contains one item for each visual part • Display list could improve performance than traversing frame tree directly • nsDisplayList • Manages a singly-linked list of display list items • The display list items are sorted by z-order • Can be used to paint the frames, to determine which frame is the target of a mouse event, and to determine what areas need to be repainted when scrolling • Role is similar to 'scene graph' • nsDisplayItem • Unit of rendering and event testing • Each instance represents an entity that can be drawn on the screen e.g., a frame's CSS background, or a frame's text string
  • 8. Boundary between Layout and Graphics • FrameLayerBuilder • Responsible for converting display lists into layer trees • Every LayerManager needs an unique FrameLayerBuilder to build layers • LayerManager • Controls a tree of layers • Uses transaction to update layers and painting of • PaintedLayers • A state of the layer tree at the end of a transaction is rendered to the target • Layer • Represents anything that can be rendered onto a destination surface • Layers are primarily used to minimize invalidating and repainting • PaintedLayer • A Layer which we can paint into • DrawTarget • Class used for all drawing of Moz2D • Layout paints into it directly or indirectly via gfxContext
  • 9. Boundary between Layout and Graphics • Moz2D • Cross-platform interface onto the various graphics backends that Gecko uses for rendering • Mostly stateless—better suited to CSS rendering and eliminates overhead • Floating-point—better suits platform APIs • API methods line up with HTML canvas • https://wiki.mozilla.org/Platform/GFX/Moz2D • Thebes • C++ wrapper around Moz2D/Cairo, along with some Gecko-specific utility code, and a text API that uses platform text handling. • Cairo dependencies are going to be replaced by Moz2D • Predecessor of Moz2D, but still in use • Named after Cairo
  • 10. LayerManager Controls a tree of layers and uses transaction to update layers • ClientLayerManager • Used for off main thread composition for widget(screen) • Handles only active layers • Final composition is done by compositor on compositor thread • BasicLayerManager • Used for the following use cases • Paints Inactive layers in PaintInactiveLayer() • Off screen document rendering • Main thread composition of widget (Not supported on Firefox OS) • During the drawing phase, each PaintedLayer is painted directly into the target
  • 11. Layers Represents anything that can be rendered onto a destination surface. Primarily used to minimize invalidating and repainting • PaintedLayer • A Layer which we can paint into • ImageLayer • A Layer which renders Images or video frames • From ClientLayerManager point of view, majority of Images are rendered into PaintedLayer • ContainerLayer • A Layer which other layers render into. It holds references to its children • ColorLayer • A Layer which just renders a solid color in its visible region • CanvasLayer • A Layer for HTML Canvas elements • RefLayer • ContainerLayer that refers to a "foreign" layer tree, through an ID. • Used to refer to a tree in a different process • ReadbackLayer • It is created only by nsPluginFrame. Firefox OS does not use it
  • 13. Compositing Action of flattening Layers into the final image that is shown on the screen. ContainerLayers might be painted to intermediate surfaces during Compositing • Compositor • An object that can draw quads on the screen (or on an off-screen render target) • Texture: • An object that contains image data • By Bug 1200595 fix, TextureClient's platform specific parts were split to TextureData • Compositable • An object that can manipulate one or several textures, and knows how to present them to the compositor • Handle all the logic around texture transfer • Layer • A layer usually doesn't know much about compositing. It uses a compositable to do the work
  • 14. Compositors on Firefox OS Two compositors are available on Firefox OS. • CompositorOGL • Use OpenGL for Compositing • Firefox OS on gonk use it by default • BasicCompositor • Use Moz2D for Compositing • Used when CompositorOGL is disabled • Can be used when platform does not have GPU • Can be tested by pref("layers.acceleration.disabled", true);
  • 16. CompositorOGL Uses OpenGL for Compositing. Its compositing is controlled by LayerManagerComposite. BeginFrame() starts a new frame compositing and EndFrame() flushes the current frame to the screen and tidy up • nsWindow • Gonk’s implementation of nsIWidget. nsIWidget is a wrapper of OS platform related things. Roles of nsIWidget are different between os platforms. On gonk, it handles touch inputs and screen • ANativeWindow • Android's struct to provide access to a native window and window buffers. • nsScreenGonk • Gonk’s implementation of nsIScreen • It wraps android’s display surface • GonkDisplay • Creates android’s display surface and renders boot animation • It exits to start boot animation as soon as possible before xpcom initialization • After boot completes, its roles are superseded by nsScreenGonk and HwcComposer2D
  • 18. BasicCompositor • Uses Moz2D for compositing • On gonk, there is no valid use case except no GPU devices • BasicCompositor gets DrawTarget from nsWindow • Extra color conversions might happen during compositing on current gonk (like Flame) • Android applications draw with RGB color. But gecko draws contents with BGR
  • 19. Types of TexutureData/TextureHost on Firefox OS • GrallocTextureData/GrallocTextureHostOGL • A wrapper of android gralloc buffer • Always use GrallocTextureData if gralloc could be allocated • Disable gralloc for gfx::SurfaceFormat::A8 • Disable gralloc if width/height is more than 4096. Many devices do not support more than 4096 • GrallocTextureHostOGL is used when CompositorOGL is used • ShmemTextureData/ShmemTextureHost • A wrapper of Shmem • Used when TextureClient is not in chrome process • Shmem is gecko's platform independent memory for cross process • On gonk, android's ashmem is used for Shmem • MemoryTextureData/MemoryTextureHost • A Wrapper of raw memory • Used when TextureClient is in chrome process • GrallocTextureHostBasic • GrallocTextureHostBasic is used when BasicCompositor is used • Used with GrallocTextureData
  • 20. GrallocTextureData/GrallocTextureHostOGL DrawQuad() BindTexture() CompositableClientCompositableHost TextureClientGrallocTextureHostOGL use use use forward Child sideParent side GrallocTextureData use SharedBuffer ManagerChild SharedBuffer ManagerParent IPC allocate GraphicBuffer ISurfaceAllocator AllocGrallocBuffer() AllocGrallocBuffer() CompositorOGL EGLImage GL Texture GLTextureSource
  • 21. GrallocTextureData/GrallocTextureHostOGL • Gralloc (android::GraphicBuffer) is shared between GrallocTextureData and GrallocTextureHostOGL • gralloc could be directly bounded to Open GL texture by using EGLImage • SharedBufferManagerParent allocates gralloc in chrome process and delivers it to child side • SharedBufferManagerParent/Child pairs is allocated for chrome process and for each content process • SharedBufferManagerParent/Child owns a thread to handle gralloc allocation, since the allocation takes a long time
  • 22. Off-main-thread compositing (OMTC) Child sideParent side nsWindow (nsIWidget) CompositorParent create CompositorChild create IPC Compositor LayerManager Composite create ClientLayerManager create forward Thread create create LayerTransaction Child create LayerTransaction Parent LayerManager Composite CompositorChild IPC create forward LayerComposite create Layer create
  • 23. Off-main-thread compositing (OMTC) CompositorParent creates a thread for compositing(compositor thread) and run compositing tasks and related IPC on the thread • PCompositor protocol • Used to manage communication between the main thread (CompositorChild side) and the compositor thread (CompositorParent side). It's primary purpose is to manage the PLayerTransaction sub protocol • PLayerTransaction protocol • Atomically publishes layer subtrees from main thread (LayerTransactionChild side) to a "shadow“(LayerTransactionParent side) and atomically updating a published subtree. ("Atomic" in this sense is wrt painting)
  • 24. Compositing of child process layers Chrome process CompositorParent LayerManager Composite TabChildTabParent IPC ClientLayer Manager PuppetWidget (nsIWidget) Child process create create ClientLayer Manager forward RefLayerComposite LayerComposite create nsSubDocument Frame RenderFrame Child RenderFrame Parent IPC create create nsFrame Loader CreateRefLayer() ClientRefLayer create CrossProcess CompositorParent CompositorChild IPC LayerTransaction Child create LayerTransaction Parent CompositorChild IPC create create create forward forward nsDisplayRemote create Layer create
  • 25. Compositing of child process layers • When a document is loaded in child process (like by <iframe>), layers are created in the process • nsSubDocumentFrame could be created by several tags like <iframe> by NS_NewSubDocumentFrame() • PRenderFrame (in the layout sense of "frame") represents one web "page". It's used to graft content processes' layer trees into chrome's rendering path. RenderFrameParent is for chrome side • ClientRefLayer and RefLayerComposite are created for the RenderFrameParent. RefLayer refers to a layer tree in child process through an ID. • LayerComposites of the layer trees are created by LayerManagerComposite via CrossProcessCompositorParent • The LayerComposites are connected to RefLayerComposite only during compositing by using AutoResolveRefLayers
  • 26. PaintedLayer (scrollable) TextureClient TileClient TileClient Child sideParent side LayerManager Composite ClientLayerManager LayerManager Composite forward ClientTiledPaintedLayerPaintedLayerComposite create create TiledContentHost MultiTiledContentClient TextureClientTextureHost TiledLayerBufferComposite (TiledLayerBuffer) TileHost gfxShmSharedReadLock (gfxSharedReadLock) ShmemSection TileClient gfxShmSharedReadLock (gfxSharedReadLock) ClientMultiTiledLayerBuffer (TiledLayerBuffer) TextureClientPool GetTextureClient() TextureClient alloc
  • 27. PaintedLayer (scrollable) ClientTiledPaintedLayer is always created as PaintedLayer on gonk. If ClientTiledPaintedLayer is scrollable, MultiTiledContentClient is created as CompositableClient. Tile size is choosen so that there are between 2 and 4 tiles per screen width (tile size max: 1024) • ClientTiledPaintedLayer • An implementation of PaintedLayer that only supports remote composition that is backed by tiles • MultiTiledContentClient • An implementation of TiledContentClient that supports multiple tiles and a low precision buffer • TileClient • Represent a single tile in tiled buffer. The buffer keeps tiles, each tile keeps a reference to a texture client and a read-lock. This read-lock is used to help implement a copy-on-write mechanism • TextureClientPool • Caches TextureClients to improve performance • Used by TileClient
  • 28. PaintedLayer (non scrollable) Child sideParent side LayerManager Composite ClientLayerManager LayerManager Composite forward ClientTiledPaintedLayerPaintedLayerComposite create create TiledContentHost SingleTiledContentClient TextureClientTextureHost TiledLayerBufferComposite (TiledLayerBuffer) TileHost gfxShmSharedReadLock (gfxSharedReadLock) ShmemSection TileClient gfxShmSharedReadLock (gfxSharedReadLock) ClientSingleTiledLayerBuffer
  • 29. PaintedLayer (non scrollable) If ClientTiledPaintedLayer is non scrollable, SingleTiledContentClient is created as CompositableClient. Host side works same to MultiTiledContentClient • SingleTiledContentClient • Allocate one tile for whole PaintedLayer • Does not use TextureClientPool
  • 30. ImageLayer (synchronous) Child sideParent side LayerManager Composite ClientLayerManager LayerManager Composite forward ClientImageLayerCanvasLayerComposite create create ImageHost create ImageClientSingle TextureClientTextureHost ImageContainer Image
  • 31. ImageLayer (synchronous) • On Firefox OS, all ImageContainers uses synchronous mode except video frame renderings. • Delivers images to Compositor side via main thread • In the majority of cases, ClientImageLayer is not used for image rendering. Instead, they are painted into PaintedLayer • ClientImageLayers are typically created for animated images
  • 32. ImageLayer (asynchronous) TextureHost TextureClient Image Child sideParent side ImageBridgeChildImageBridgeParent IPC LayerManager Composite ClientLayerManager LayerManager Composite forward ClientImageLayerImageLayerComposite create create ImageClientBridgeImageHost ImageContainer ImageClientSingle ImageContainerChildImageContainerParent IPC create create create SendAsyncDelete() CreateImageClient() VideoFrameContainer SetCurrentImages()AppendImageCompositeNotification() NotifyComposite() GetAsyncContainerID() Image TextureClientTextureHost CompositorParent ExtractImageCompositeNotifications() NotifyImageComposites()
  • 33. ImageLayer (asynchronous) • On Firefox OS, asynchronous mode of ImageComtainer is used for video frames renderings. TextureClients are delivered to Compositor side via ImageBridge thread • To reduce video frames drops, ImageContainer, ImageClientSingle and ImageHost could hold multiple images with timestamps(Bug 1143575). ImageHost renders Images based on timestamps. • Image • Represents a buffer of pixel data. The data can be in one of various formats including YCbCr • If the buffer is not TextureClient, its content is copied to TextureClient at ImageClientSingle • PImageBridge protocol • Used to allow isolated threads or processes to push frames directly to the compositor thread/process without relying on the main thread which might be too busy dealing with content script. • ImageBridgeChild is child side object that run on ImageBridge thread. ImageBridgeParent is parent side object that run on Compositor thread
  • 34. 2D Canvas (with GPU) Child sideParent side LayerManager Composite ClientLayerManager LayerManager Composite forward ClientImageLayerCanvasLayerComposite create create ImageHost create CanvasClientSharedSurface SharedSurfaceTextureClient (TextureClient) CanvasRenderingContext2D HTMLCanvasElement DrawTargetSkia (DrawTarget) GL Texture SharedSurface_Basic (SharedSurface) GrallocTextureData (TextureData) SharedSurfaceTextureData (TextureData) TextureClient SharedSurfaceGralloc (SharedSurface) ProdCopy() GrallocTextureHostOGL
  • 35. 2D Canvas (with GPU) • CanvasRenderingContext2D renders to DrawTargetSkia. It actually renders to OpenGL texture • CanvasClientSharedSurface gets the OpenGL texture as SharedSurface_Basic • The texture is copied from SharedSurface_Basic to SharedSurfaceGralloc by using GPU • SharedSurfaceGralloc is wrapped by SharedSurfaceTextureClient. But SharedSurfaceGralloc wraps TextureClient. It is sad. It might be changed in future
  • 36. WebGL Child sideParent side LayerManager Composite ClientLayerManager LayerManager Composite forward ClientImageLayerCanvasLayerComposite create create ImageHost create CanvasClientSharedSurface SharedSurfaceTextureClient (TextureClient) HTMLCanvasElement GrallocTextureData (TextureData) SharedSurfaceTextureData (TextureData) TextureClient GrallocTextureHostOGL WebGLContext1 (WebGLContext) GLContextEGL (GLContext) create GLScreenBuffer EGLImage GL Texture GraphicBuffer Front() SharedSurfaceGralloc (SharedSurface) SurfaceFactory_Gralloc (SurfaceFactory) create NewTexClient() create
  • 37. WebGL • WebGLContext renders to GLScreenBuffer • CanvasClientSharedSurface gets front buffer(SharedSurfaceTextureClient) by GLScreenBuffer::Front() • The SharedSurfaceTextureClient is sent to Compositor side for composition • GLScreenBuffer • Abstraction for the "default framebuffer" used by an offscreen GLContext • Rendering is published as SharedSurfaceTextureClient by GLScreenBuffer::PublishFrame() • OffscreenCanvas is wip • Bug 709490, Bug 801176, Bug 1172796, Bug 1203382 • https://wiki.whatwg.org/wiki/OffscreenCanvas
  • 38. Render to screen CompositorOGL (Compositor) nsWindow (nsIWidget) nsScreenGonk Surface (ANativeWindow) LayerManagerComposite BeginFrame() EndFrame() HwcComposer2D TryRenderWithHwc() Render() hwc hal pepare() set() GetScreen() FramebufferSurface (DisplaySurface) GetDisplaySurface() GLContextEGL EGLSurface SwapBuffers() dequeueBuffer() queueBuffer() onFrameAvailable() lastHandle GetPrevDispAcquireFd() setReleaseFenceFd() Surface (ANativeWindow) Display
  • 39. Render to screen(with CompositorOGL) • On gonk, Compositing and "render to screen" are different steps. Hwc (hardware compooser) does "render to screen". Hwc also supports 2d compositing for limited number of layers • https://source.android.com/devices/graphics/architecture.html#hwc omposer • When compositing is done only by CompositorOGL, resultant buffers are delivered to FrameBufferSurface via ANativeWindow • When Composer2D::Render() is called, Composer2D gets the buffer from FrameBufferSurface and renders it to screen via hwc hal.
  • 40. Types of Compositing on gonk Compositing by using Compositor is not the only compositing on gonk. LayerManagerComposite::Render() tries ‘Full hwc composition’ at first. If it failed, then fallbacks to ‘ using OpenGL for compositing’. The fallback could be ‘OpenGL compositing’ or ‘Hwc and OpenGL mixed compositing’ • Full hwc compositing • All layers are composed by hwc. Open GL composition does not happen • Open GL Compositing • All layers are composed by Open GL • Hwc just renders the composed result • Hwc and OpenGL mixed compositing • Some layers are composed by hwc and another layers are composed by OpenGL • Supported only by overlay hwc • Uses it mainly for performance and power consumption especially of video rendering • Android uses it also for rendering DRM protected contents. Firefox OS does not supports it. It is going to be added to Firefox OS(Bug 1049296)
  • 41. Types of HWC • Copybit HWC • Majority of Firefox OS mobile products use it • Use copybit hw for composition • Does not have much power consumption advantage to OpenGL. If over drawing exceed a specific level(150%), it fallbacks to OpenGL composition • Can handle multiple rectangles for each layer • Does not support OpenGL+HWC mixed composition • Overlay HWC • Fx0 use it • Better performance • Not good at handling multiple rectangles in a layer • Support OpenGL+HWC mixed composition
  • 42. VsyncSource https://wiki.mozilla.org/Project_Silk HwcComposer2D Vsync() hwc hal GonkVsyncSource (VsyncSource) NotifyVsync() GonkDisplay (VsyncSource::Display) create Content processChrome process CompositorParent CompositorVsync Scheduler GeckoTouch Dispatcher CompositeToTarget() CompositorVsync Dispatcher NotifyVsync() NotifyVsync() SetNeedsComposite() LayerManager Composite BeginTransaction() EndTransaction() RefreshTimerVsync Dispatcher NotifyVsync() VsyncChildVsyncParent IPCNotifyVsync() RefreshDriverVsyncObserver (VsyncObserver) nsRefreshDriver VsyncRefreshDriver Timer NotifyVsync() NotifyVsync() create SetVsyncObserver() VsyncChild create VsyncRefreshDriver Timer Tick() nsViewManager ProcessPendingUpdates() PresShell Paint()
  • 43. VsyncSource • VsyncSource is used to deliver vsync timing to CompositorVsyncScheduler, nsRefreshDriver and GeckoTouchDispatcher • CompositorVsyncScheduler schedules CompositorParent's compositing • nsRefreshDriver schedules PresShell's painting or other layout’s tasks like requestAnimationFrame(rAF). • GeckoTouchDispatcher resamples touch events whenever a vsync event occurs for smooth scrolling • GonkVsyncSource uses hwc hal's vsync callback as vsync source. If it is disabled, SoftwareVsyncSource is used.
  • 44. Off-main-thread Animation(OMTA) • Allows css animation to be performed asynchronously (on the compositor thread rather than the main thread) • Also referred as “Async Animations” • Only supports opacity and transform of animations • Implemented by Bug 768440 and Bug 1166173
  • 45. Off-main-thread Animation(OMTA) nsDisplayListBuilder nsDisplayOpacity nsDisplayTransform nsDisplayItem CanUseAsyncAnimations() Child sideParent side ContainerLayer layers::Animation AddAnimation() layers::Animation AsyncCompositionManager CompositorParent TransformShadowTree() LayerManagerComposite BeginTransaction() EndTransaction() RenderLayer() AddAnimationsAndTransitionsToLayer() AddAnimationsAndTransitionsToLayer() SampleAnimations() ContainerLayerComposite LayerComposite GetAnimations() GetAnimationData() SetShadowOpacity() SetShadowTransform(); SetShadowTransformSetByAnimation()
  • 46. Off-main-thread Animation(OMTA) • AddAnimationsAndTransitionsToLayer() adds layers::Animation to Layers. Only nsDisplayTransform and nsDisplayOpacity calls it among nsDisplayItems • layers::Animation is delivered to LayerComposite • Just before compositing, CompositorParent calls AsyncCompositionManager::TransformShadowTree(). It transforms LayerComposite tree based on layers::Animation • If more Composition is necessary to update animation, CompositorParent schedules next compositing
  • 47. Async Pan/Zoom(APZ) • Allows panning and zooming to be performed asynchronously (on the compositor thread rather than the main thead). • Reference • https://dxr.mozilla.org/mozilla-central/source/gfx/doc/AsyncPanZoom- HighLevel.png • https://github.com/mozilla/gecko- dev/blob/master/gfx/doc/AsyncPanZoom.md • http://people.mozilla.org/~bgirard/doxygen/gfx/apz.html • https://wiki.mozilla.org/Platform/GFX/APZ • https://wiki.mozilla.org/Mobile/AsyncSubframePanning • https://staktrace.com/spout/entry.php?id=834
  • 49. Async Pan/Zoom(APZ) Content ProcessChrome Process nsWindow PresShell HandleEvent() EventStateManager PreHandleEvent() PostHandleEvent() TabParent TabChild IPC AsyncComposition Manager CompositorParent TransformShadowTree() RemoteContent Controller RenderFrameParent AsyncPanZoomController APZCTreeManager ReceiveInputEvent() HitTestingTreeNode InputQueue CancelableBlockState APZEventState APZCCallbackHelper EventStateManager PresShell ActiveElement Manager SetContentState() PuppetWidget UpdateHitTestingTree() LayerManager Composite set APZC Layer BeginTransaction() EndTransaction()
  • 50. Async Pan/Zoom(APZ) • When layer transactions are receved at LayerTransactionParent, CompositorParent requests APZCTreeManager to update hit-testing tree based on the layer update by APZCTreeManager::UpdateHitTestingTree() • nsWindow at first, sends an input event to APZCTreeManager by APZCTreeManager::ReceiveInputEvent(). It manipulates frame metrics of AsyncPanZoomControllers based on what type of input it is • If the APZCTreeManager says to drop it, then nsWindow drops it • If the APZCTreeManager does not say to drop it, nsWindow sends it to normal event delivery route (to PresShell) • Like OMTA, AsyncCompositionManager::TransformShadowTree() transforms LayerComposite(Layer) tree based on AsyncPanZoomController that is set to the Layer • AsyncPanZoomController requests content repaint via RemoteContentController
  • 51. About “about:config” Some prefs could visualize layers and painting updates • layers.draw-borders • Enable layer borders drawing • layers.draw-tile-borders • Enable tile broders drawing • layers.acceleration.draw-fps • Enable compositing fps counter daring • nglayout.debug.paint_flashing • Enable paint flashing
  • 52. Q&A?