Project Silk

From MozillaWiki
Jump to: navigation, search

Overview

The objective of Project Silk is to provide smoother scrolling and animation on B2G. To achieve the goal, it aligns HW Vsync signals among input, content painting and composition modules. Proper docs are at http://hg.mozilla.org/mozilla-central/file/b8d59286a581/gfx/doc/Silk.md An easier to read version is at https://github.com/changm/SilkDocs/blob/master/silk.md

Porting Issue

In silk, there are only two platform dependent objects, which are platform vsync timer and InputDispatcher.

In a word, if you want to enable project silk on a specific platform, things need to be done are

  • Constructing a concrete implementation of PlatformVsyncTimer interface
  • An InputDispatcher instance which is inherit from VsyncObserver
  • TBD: (object creation)

Testing Plan

Performace

  • Test manually
    • With automatic script or tool
    • Scroll
      • Show we get a smooth position with time
    • OMTA
      • Check b2g always composes done before next vsync
    • requestAnimationFrame
      • Check we get a better timestamp for animation

Unit test

  • VsyncDispatcher
    • Registry - vsync listener should be able to receive sync-notification steadily after registry.
    • Unregistry - vsync listener should not receive any vync notification after synchronize unregistry from VsyncDispatcher

Integration test

  • First paint - have a test case to make sure we do not break first-paint.

Benchmark

Type:

  • requestAnimationFrame, WebGL
  • OMTA test
  • scrollable layer

Running the mochitest

There is a builtin mochitest that requires APZ and e10s enabled which generates native touch events and scrolls a test webpage. It then calculates the frame uniformity of each scrollable layer. You can run it with:

./mach mochitest --e10s --setpref=layers.async-pan-zoom.enabled=true gfx/layers/apz/test/test_smoothness.html

On OS X, the frame uniformity value should be < 2, with 0 being perfect. On Windows, it should be < 4. The values are only valid on platforms with hardware vsync.

Project Silk Discussion at Taipei Workweek

Project Silk

Bugs

New/Open

No results.

0 Total; 0 Open (0%); 0 Resolved (0%); 0 Verified (0%);


Resolved

No results.

0 Total; 0 Open (0%); 0 Resolved (0%); 0 Verified (0%);


FAQ

Platform supporting plan 
We are going to support Firefox OS first and extend this framework to other platforms after.
Can Silk improve rendering performance?
No
What version of Android is required?
We need Kit-Kat or greater. Jelly Bean and ICS are NOT supported.