aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Bargiacchi2016-08-24 20:28:43 -0500
committerDamien Bargiacchi2016-09-07 04:26:50 -0500
commit5e7cfb9af64d5f6bf616d9b6fa40bd0ae82e781a (patch)
treeab6853be5f37627748b1456eec59caf1ed5a2271 /screen_ui.h
parent929ffefdccf3f7b6e2810cc47efaf93626f9a2cc (diff)
downloadplatform-bootable-recovery-5e7cfb9af64d5f6bf616d9b6fa40bd0ae82e781a.tar.gz
platform-bootable-recovery-5e7cfb9af64d5f6bf616d9b6fa40bd0ae82e781a.tar.xz
platform-bootable-recovery-5e7cfb9af64d5f6bf616d9b6fa40bd0ae82e781a.zip
Remove duplicate methods and variables from WearRecoveryUI
Copy pasta is never as delicious as ones hopes. Also fix the Pike not rendering recovery bug. Change-Id: I903da7da436e3347a22ff51633e8a0f28fea2c46
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h45
1 files changed, 24 insertions, 21 deletions
diff --git a/screen_ui.h b/screen_ui.h
index 89877577..de7b6442 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -37,16 +37,16 @@ class ScreenRecoveryUI : public RecoveryUI {
37 void SetSystemUpdateText(bool security_update); 37 void SetSystemUpdateText(bool security_update);
38 38
39 // progress indicator 39 // progress indicator
40 void SetProgressType(ProgressType type); 40 void SetProgressType(ProgressType type) override;
41 void ShowProgress(float portion, float seconds); 41 void ShowProgress(float portion, float seconds) override;
42 void SetProgress(float fraction); 42 void SetProgress(float fraction) override;
43 43
44 void SetStage(int current, int max); 44 void SetStage(int current, int max) override;
45 45
46 // text log 46 // text log
47 void ShowText(bool visible); 47 void ShowText(bool visible) override;
48 bool IsTextVisible(); 48 bool IsTextVisible() override;
49 bool WasTextEverVisible(); 49 bool WasTextEverVisible() override;
50 50
51 // printing messages 51 // printing messages
52 void Print(const char* fmt, ...) __printflike(2, 3); 52 void Print(const char* fmt, ...) __printflike(2, 3);
@@ -72,8 +72,6 @@ class ScreenRecoveryUI : public RecoveryUI {
72 Icon currentIcon; 72 Icon currentIcon;
73 73
74 const char* locale; 74 const char* locale;
75 bool intro_done;
76 int current_frame;
77 75
78 // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi. 76 // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi.
79 float density_; 77 float density_;
@@ -123,8 +121,11 @@ class ScreenRecoveryUI : public RecoveryUI {
123 pthread_t progress_thread_; 121 pthread_t progress_thread_;
124 122
125 // Number of intro frames and loop frames in the animation. 123 // Number of intro frames and loop frames in the animation.
126 int intro_frames; 124 size_t intro_frames;
127 int loop_frames; 125 size_t loop_frames;
126
127 size_t current_frame;
128 bool intro_done;
128 129
129 // Number of frames per sec (default: 30) for both parts of the animation. 130 // Number of frames per sec (default: 30) for both parts of the animation.
130 int animation_fps; 131 int animation_fps;
@@ -136,11 +137,13 @@ class ScreenRecoveryUI : public RecoveryUI {
136 pthread_mutex_t updateMutex; 137 pthread_mutex_t updateMutex;
137 bool rtl_locale; 138 bool rtl_locale;
138 139
139 void draw_background_locked(); 140 virtual void InitTextParams();
140 void draw_foreground_locked(); 141
141 void draw_screen_locked(); 142 virtual void draw_background_locked();
142 void update_screen_locked(); 143 virtual void draw_foreground_locked();
143 void update_progress_locked(); 144 virtual void draw_screen_locked();
145 virtual void update_screen_locked();
146 virtual void update_progress_locked();
144 147
145 GRSurface* GetCurrentFrame(); 148 GRSurface* GetCurrentFrame();
146 GRSurface* GetCurrentText(); 149 GRSurface* GetCurrentText();
@@ -148,8 +151,8 @@ class ScreenRecoveryUI : public RecoveryUI {
148 static void* ProgressThreadStartRoutine(void* data); 151 static void* ProgressThreadStartRoutine(void* data);
149 void ProgressThreadLoop(); 152 void ProgressThreadLoop();
150 153
151 void ShowFile(FILE*); 154 virtual void ShowFile(FILE*);
152 void PrintV(const char*, bool, va_list); 155 virtual void PrintV(const char*, bool, va_list);
153 void PutChar(char); 156 void PutChar(char);
154 void ClearText(); 157 void ClearText();
155 158
@@ -158,9 +161,9 @@ class ScreenRecoveryUI : public RecoveryUI {
158 void LoadLocalizedBitmap(const char* filename, GRSurface** surface); 161 void LoadLocalizedBitmap(const char* filename, GRSurface** surface);
159 162
160 int PixelsFromDp(int dp); 163 int PixelsFromDp(int dp);
161 int GetAnimationBaseline(); 164 virtual int GetAnimationBaseline();
162 int GetProgressBaseline(); 165 virtual int GetProgressBaseline();
163 int GetTextBaseline(); 166 virtual int GetTextBaseline();
164 167
165 void DrawHorizontalRule(int* y); 168 void DrawHorizontalRule(int* y);
166 void DrawTextLine(int x, int* y, const char* line, bool bold); 169 void DrawTextLine(int x, int* y, const char* line, bool bold);