Chrome Release Bot (LUCI) 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
..
android 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
BUILD.gn 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
DEPS 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
README.md 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
bitmap_request.cc 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
bitmap_request.h 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
compositor_status.h 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
player_compositor_delegate.cc 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
player_compositor_delegate.h 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve
player_compositor_delegate_unittest.cc 4762b62e7d Publish DEPS for 106.0.5249.13 1 éve

README.md

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.

TL;DR

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

Design

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.