diff options
author | Marin Shalamanov <shalamanov@google.com> | 2020-05-19 23:55:12 +0200 |
---|---|---|
committer | Marin Shalamanov <shalamanov@google.com> | 2020-05-29 18:15:52 +0200 |
commit | 047802d41650f52b8adee936ce2c2e8f0738ba12 (patch) | |
tree | caa92c3d2760cef6de3950e10ab6e65e2ba54f7d /cmds/bootanimation/BootAnimation.h | |
parent | fd839ea18fe1e3f9e8b1aa690c9a88cfa9d48900 (diff) |
Render boot animation with same size as framebuffer
When ro.surface_flinger.max_graphics_{width|height} is
set the framebuffer size is limited by this property.
However the boot animation size matches the display active
mode size which can cause it to be off-center or partially
visible.
This change limits the boot animation surface size with
accordance with ro.surface_flinger.max_graphics_width.
Bug: 153991408
Test: manual
Change-Id: Idfd1c9adc1f6b10f44bc04ec2078dbc823f28ed6
Diffstat (limited to 'cmds/bootanimation/BootAnimation.h')
-rw-r--r-- | cmds/bootanimation/BootAnimation.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h index 36cd91bdee0d..6ba7fd450fbb 100644 --- a/cmds/bootanimation/BootAnimation.h +++ b/cmds/bootanimation/BootAnimation.h @@ -170,6 +170,7 @@ private: bool findBootAnimationFileInternal(const std::vector<std::string>& files); bool preloadAnimation(); EGLConfig getEglConfig(const EGLDisplay&); + ui::Size limitSurfaceSize(int width, int height) const; void resizeSurface(int newWidth, int newHeight); void checkExit(); @@ -181,6 +182,8 @@ private: Texture mAndroid[2]; int mWidth; int mHeight; + int mMaxWidth = 0; + int mMaxHeight = 0; int mCurrentInset; int mTargetInset; bool mUseNpotTextures = false; |