Merge "wear_ui: Remove backgroundIcon."

This commit is contained in:
Tao Bao
2017-09-01 17:58:13 +00:00
committed by Gerrit Code Review
2 changed files with 8 additions and 40 deletions
+6 -34
View File
@@ -50,8 +50,6 @@ WearRecoveryUI::WearRecoveryUI()
loop_frames = 60; loop_frames = 60;
touch_screen_allowed_ = true; touch_screen_allowed_ = true;
for (size_t i = 0; i < 5; i++) backgroundIcon[i] = NULL;
} }
int WearRecoveryUI::GetProgressBaseline() const { int WearRecoveryUI::GetProgressBaseline() const {
@@ -67,24 +65,12 @@ void WearRecoveryUI::draw_background_locked() {
gr_fill(0, 0, gr_fb_width(), gr_fb_height()); gr_fill(0, 0, gr_fb_width(), gr_fb_height());
if (currentIcon != NONE) { if (currentIcon != NONE) {
GRSurface* surface; GRSurface* frame = GetCurrentFrame();
if (currentIcon == INSTALLING_UPDATE || currentIcon == ERASING) { int frame_width = gr_get_width(frame);
if (!intro_done) { int frame_height = gr_get_height(frame);
surface = introFrames[current_frame]; int frame_x = (gr_fb_width() - frame_width) / 2;
} else { int frame_y = (gr_fb_height() - frame_height) / 2;
surface = loopFrames[current_frame]; gr_blit(frame, 0, 0, frame_width, frame_height, frame_x, frame_y);
}
} else {
surface = backgroundIcon[currentIcon];
}
int width = gr_get_width(surface);
int height = gr_get_height(surface);
int x = (gr_fb_width() - width) / 2;
int y = (gr_fb_height() - height) / 2;
gr_blit(surface, 0, 0, width, height, x, y);
} }
} }
@@ -177,20 +163,6 @@ void WearRecoveryUI::update_progress_locked() {
gr_flip(); gr_flip();
} }
bool WearRecoveryUI::Init(const std::string& locale) {
if (!ScreenRecoveryUI::Init(locale)) {
return false;
}
LoadBitmap("icon_error", &backgroundIcon[ERROR]);
backgroundIcon[NO_COMMAND] = backgroundIcon[ERROR];
// This leaves backgroundIcon[INSTALLING_UPDATE] and backgroundIcon[ERASING]
// as NULL which is fine since draw_background_locked() doesn't use them.
return true;
}
void WearRecoveryUI::SetStage(int current, int max) { void WearRecoveryUI::SetStage(int current, int max) {
} }
+2 -6
View File
@@ -25,8 +25,6 @@ class WearRecoveryUI : public ScreenRecoveryUI {
public: public:
WearRecoveryUI(); WearRecoveryUI();
bool Init(const std::string& locale) override;
void SetStage(int current, int max) override; void SetStage(int current, int max) override;
// printing messages // printing messages
@@ -55,14 +53,12 @@ class WearRecoveryUI : public ScreenRecoveryUI {
void PrintV(const char*, bool, va_list) override; void PrintV(const char*, bool, va_list) override;
private: private:
GRSurface* backgroundIcon[5];
int menu_start, menu_end;
void draw_background_locked() override; void draw_background_locked() override;
void draw_screen_locked() override; void draw_screen_locked() override;
void PutChar(char); void PutChar(char);
int menu_start, menu_end;
}; };
#endif // RECOVERY_WEAR_UI_H #endif // RECOVERY_WEAR_UI_H