diff options
Diffstat (limited to 'cmds/bootanimation/BootAnimation.h')
-rw-r--r-- | cmds/bootanimation/BootAnimation.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h index 6ba7fd450fbb..aee385387f57 100644 --- a/cmds/bootanimation/BootAnimation.h +++ b/cmds/bootanimation/BootAnimation.h @@ -19,6 +19,7 @@ #include <vector> #include <queue> +#include <climits> #include <stdint.h> #include <sys/types.h> @@ -45,6 +46,8 @@ class SurfaceControl; class BootAnimation : public Thread, public IBinder::DeathRecipient { public: + static constexpr int MAX_FADED_FRAMES_COUNT = std::numeric_limits<int>::max(); + struct Texture { GLint w; GLint h; @@ -84,10 +87,15 @@ public: String8 trimData; SortedVector<Frame> frames; bool playUntilComplete; + int framesToFadeCount; float backgroundColor[3]; uint8_t* audioData; int audioLength; Animation* animation; + + bool hasFadingPhase() const { + return !playUntilComplete && framesToFadeCount > 0; + } }; int fps; int width; @@ -160,6 +168,8 @@ private: bool movie(); void drawText(const char* str, const Font& font, bool bold, int* x, int* y); void drawClock(const Font& font, const int xPos, const int yPos); + void fadeFrame(int frameLeft, int frameBottom, int frameWidth, int frameHeight, + const Animation::Part& part, int fadedFramesCount); bool validClock(const Animation::Part& part); Animation* loadAnimation(const String8&); bool playAnimation(const Animation&); @@ -172,7 +182,9 @@ private: EGLConfig getEglConfig(const EGLDisplay&); ui::Size limitSurfaceSize(int width, int height) const; void resizeSurface(int newWidth, int newHeight); + void projectSceneToWindow(); + bool shouldStopPlayingPart(const Animation::Part& part, int fadedFramesCount); void checkExit(); void handleViewport(nsecs_t timestep); |