Add a new CanvasEngine, gated by flag
The flag can be flipped in the FlagFlipper app: Theming -> Use Canvas
Renderer.
A new file, ImageCanvasWallpaperRenderer, performs the drawing of the bitmap on the surface.
The Engine class only manages the loading/unloading of wallpapers.
This Engine is widely inspired from the old DrawableEngine, but some details have been modified:
- updateSurfaceSize() has been modified. Now, it simply calls
surfaceHolder.setFixedSize() with the dimensions of the bitmap (or
128 if bitmap is smaller)
- The Trace logic has been temporarily removed
- The method shouldZoomOutWallpaper is overriden and always returns
true
- A call to setShowForAllUsers(true) has been added in the constructor
- The 'onOffsetsChanged' method does not exist anymore, offsets are
considered to be always 0. All computations about offset, cropping, scale and
rotation have been removed, as they are no longer necessary.
- The 'onVisibilityChanged' and 'dump' methods do not exist anymore.
The wallpaper is automatically unloaded after 5000ms, so it is not mandatory to
unload when onVisibilityChanged(false) is called.
- bitmap.recycle() is always called when the wallpaper is changed
- A few new tests have been added
Test: manual
Test: atest ImageWallpaperTest
Bug: 243402530
Change-Id: I20bc71e6ad9158f7728f0f44367cca9b256c77cb
4 files changed