res: Embed FPS into icon_installing.png.

We allow vendor-specific icon installing image but have defined private
animation_fps that can't be overridden. This CL changes the image
generator to optionally embed FPS (otherwise use the default value of
20) into the generated image.

For wear devices, they are using individual images instead of the
interlaced one. Change the animation_fps from private to protected so
that it can be customized.

Bug: 26009230
Change-Id: I9fbf64ec717029d4c54f72316f6cb079e8dbfb5e
This commit is contained in:
Tao Bao
2015-12-11 15:18:51 -08:00
parent 4e72d1a81e
commit b723f4f38f
12 changed files with 82 additions and 42 deletions

View File

@@ -73,7 +73,7 @@ ScreenRecoveryUI::ScreenRecoveryUI() :
menu_items(0),
menu_sel(0),
file_viewer_text_(nullptr),
animation_fps(20),
animation_fps(-1),
installing_frames(-1),
stage(-1),
max_stage(-1) {
@@ -367,8 +367,9 @@ void ScreenRecoveryUI::LoadBitmap(const char* filename, GRSurface** surface) {
}
}
void ScreenRecoveryUI::LoadBitmapArray(const char* filename, int* frames, GRSurface*** surface) {
int result = res_create_multi_display_surface(filename, frames, surface);
void ScreenRecoveryUI::LoadBitmapArray(const char* filename, int* frames, int* fps,
GRSurface*** surface) {
int result = res_create_multi_display_surface(filename, frames, fps, surface);
if (result < 0) {
LOGE("missing bitmap %s\n(Code %d)\n", filename, result);
}
@@ -405,7 +406,7 @@ void ScreenRecoveryUI::Init() {
text_top_ = 1;
backgroundIcon[NONE] = nullptr;
LoadBitmapArray("icon_installing", &installing_frames, &installation);
LoadBitmapArray("icon_installing", &installing_frames, &animation_fps, &installation);
backgroundIcon[INSTALLING_UPDATE] = installing_frames ? installation[0] : nullptr;
backgroundIcon[ERASING] = backgroundIcon[INSTALLING_UPDATE];
LoadBitmap("icon_error", &backgroundIcon[ERROR]);