tree: 5c25d851e04852ef2e4e4e73fe0dc06d51cb2f37 [path history] [tgz]
  2. DEPS
  4. android/
  6. bitmap_request.h
  7. compositor_status.h
  9. player_compositor_delegate.h

Paint Preview Player

The player displays a paint preview that has been previously recorded. Currently, the player is only fully implemented for Android. However, there are a few platform-independent base classes (PlayerCompositorDelegate , CompositorStatus , BitmapRequest ) than can be used to extend the playback support for other platforms.

PlayerCompositorDelegate uses the StartCompositorService API. Alternatively, playback support for other platforms can be provided by using StartCompositorService directly for more flexibility.

The remainder of this doc describes the Android-specific implementation.


Want to use the player? Construct a PlayerManager and use PlayerManager#getView to display it.


As mentioned in the main README , a paint preview can have multiple frames in a nested structure. Consequently, the player is desinged in a nested structure as well, to facilitate the display of mulitple nested frames.

  • android/java/src/.../player/: This directory contains per-player classes. In another word, these classes are aware that the player might have multiple frames and are not involved in the logic for displaying a single frame.
  • android/java/src/.../player/frame: This directory contains per-frame classes. These are responsible for displaying a single frame.

Important classes

  • PlayerManager: Entry point for using the player. When created it initializes the compositor and populates a hierarchy of player frames based on the paint preview.
  • PlayerCompositorDelegateImpl : Communicates with the paint preview compositor. It requests bitmaps from the comopsitor and provides them to palyer frames.
  • PlayerFrameMediator : Handles the business logic for a single frame in the player, i.e. maintaining a viewport, updating its sub-frame visibilities, requesting bitmaps from the compositor delegate, etc.
  • PlayerFrameView : The View that displays a single frame.