Project Silk: Difference between revisions

Line 13: Line 13:
=== VsyncDispatcher ===
=== VsyncDispatcher ===
VsyncDispatcherHost/Client stands at the key position of Project Silk. The main role of this object is
VsyncDispatcherHost/Client stands at the key position of Project Silk. The main role of this object is
# to receive HW vsync event from vsync driver.
# Receive HW vsync-event from vsync driver.
# Real time dispatching vsync event to registered-event listeners.
# Real time dispatching vsync-event to registered-event listeners.


There is exactly one VsyncDispatcherHost object in chrome process and one VsyncDispatcherClient in each content process.
There is exactly one VsyncDispatcherHost object in chrome process and one VsyncDispatcherClient in each content process.


In chrome process:
In chrome process  
* VsyncDispatcherHost creates a dedicated thread, named as <b>vsync dispatcher thread</b>, to dispatch vsync-event. Since vsync-event dispatching is very performance sensitive, we create a dedicate thread which only works on event dispatching to prevent transmission flow from being blocked by irrelevant tasks.
* VsyncDispatcherHost creates a dedicated thread, named as <b>vsync dispatcher thread</b>, to dispatch vsync-event. Since vsync-event dispatching is very performance sensitive, we create a dedicate thread which only works on event dispatching to prevent transmission flow from being blocked by irrelevant tasks.
* Receive HW vsync events from HWComposer. On platforms which have no HW vsync supported, it's fallback to SW vsync driver automatically.
* Receive HW vsync events from HWComposer. On platforms which have no HW vsync supported, it's fallback to SW vsync driver automatically.
* Export registry/unregistry function to user clients who want to receive vsync-event notification.  
* Export registry functions to clients who want to receive vsync-event notification.  
* In vsync dispatcher thread, sent vsync notification to registered listeners.
* Sent vsync notifications to registered listeners, on the <b>vsync dispatcher thread</b>.


In Content process, what VsyncDispatcherClient does is relatively simpler:
In Content process, what VsyncDispatcherClient does is relatively simpler:
Confirmed users
1,643

edits