summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-06-21 03:11:21 +0200
committerTao Bao <tbao@google.com>2017-06-23 18:45:28 +0200
commit855eaffff674f0c90cf6fe107f8d10b50efc3965 (patch)
tree3321376f646731706c186ea61884ee342e1b96f6 /screen_ui.cpp
parentscreen_ui: Allow setting screen margin space. (diff)
downloadandroid_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.tar
android_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.tar.gz
android_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.tar.bz2
android_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.tar.lz
android_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.tar.xz
android_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.tar.zst
android_bootable_recovery-855eaffff674f0c90cf6fe107f8d10b50efc3965.zip
Diffstat (limited to '')
-rw-r--r--screen_ui.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 10e56dec4..4ca96a9b2 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -51,7 +51,9 @@ static double now() {
}
ScreenRecoveryUI::ScreenRecoveryUI()
- : density_(static_cast<float>(android::base::GetIntProperty("ro.sf.lcd_density", 160)) / 160.f),
+ : kMarginWidth(RECOVERY_UI_MARGIN_WIDTH),
+ kMarginHeight(RECOVERY_UI_MARGIN_HEIGHT),
+ density_(static_cast<float>(android::base::GetIntProperty("ro.sf.lcd_density", 160)) / 160.f),
currentIcon(NONE),
progressBarType(EMPTY),
progressScopeStart(0),
@@ -78,8 +80,6 @@ ScreenRecoveryUI::ScreenRecoveryUI()
animation_fps(30), // TODO: there's currently no way to infer this.
stage(-1),
max_stage(-1),
- margin_width_(0),
- margin_height_(0),
updateMutex(PTHREAD_MUTEX_INITIALIZER) {}
GRSurface* ScreenRecoveryUI::GetCurrentFrame() {
@@ -292,8 +292,8 @@ void ScreenRecoveryUI::draw_screen_locked() {
gr_clear();
static constexpr int TEXT_INDENT = 4;
- int x = TEXT_INDENT + margin_width_;
- int y = margin_height_;
+ int x = TEXT_INDENT + kMarginWidth;
+ int y = kMarginHeight;
if (show_menu) {
std::string recovery_fingerprint =
android::base::GetProperty("ro.bootimage.build.fingerprint", "");
@@ -333,7 +333,7 @@ void ScreenRecoveryUI::draw_screen_locked() {
SetColor(LOG);
int row = (text_top_ + text_rows_ - 1) % text_rows_;
size_t count = 0;
- for (int ty = gr_fb_height() - margin_height_ - char_height_;
+ for (int ty = gr_fb_height() - kMarginHeight - char_height_;
ty >= y && count < text_rows_; ty -= char_height_, ++count) {
gr_text(gr_sys_font(), 0, ty, text_[row], false);
--row;
@@ -453,8 +453,8 @@ bool ScreenRecoveryUI::InitTextParams() {
}
gr_font_size(gr_sys_font(), &char_width_, &char_height_);
- text_rows_ = (gr_fb_height() - margin_height_ * 2) / char_height_;
- text_cols_ = (gr_fb_width() - margin_width_ * 2) / char_width_;
+ text_rows_ = (gr_fb_height() - kMarginHeight * 2) / char_height_;
+ text_cols_ = (gr_fb_width() - kMarginWidth * 2) / char_width_;
return true;
}