diff options
author | Doug Zongker <dougz@google.com> | 2014-03-17 22:56:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-17 22:56:47 +0000 |
commit | d90da13076303a5377de631623e16c34ee195830 (patch) | |
tree | 629541c511f84bd4c42ef3de7ad099001874f05c /screen_ui.cpp | |
parent | 026ebe0214d6c1c9b3ddc22c35e9ac37e5f622bc (diff) | |
parent | a418aa7dd5e94cbf1ab2a6fa1c63f60e5e087d42 (diff) | |
download | bootable_recovery-d90da13076303a5377de631623e16c34ee195830.zip bootable_recovery-d90da13076303a5377de631623e16c34ee195830.tar.gz bootable_recovery-d90da13076303a5377de631623e16c34ee195830.tar.bz2 |
Merge "refactor image resource loading code in minui"
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r-- | screen_ui.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp index 589c935..656f724 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -52,6 +52,7 @@ static double now() { ScreenRecoveryUI::ScreenRecoveryUI() : currentIcon(NONE), installingFrame(0), + locale(NULL), rtl_locale(false), progressBarType(EMPTY), progressScopeStart(0), @@ -306,21 +307,21 @@ void ScreenRecoveryUI::progress_loop() { } void ScreenRecoveryUI::LoadBitmap(const char* filename, gr_surface* surface) { - int result = res_create_surface(filename, surface); + int result = res_create_display_surface(filename, surface); if (result < 0) { LOGE("missing bitmap %s\n(Code %d)\n", filename, result); } } void ScreenRecoveryUI::LoadBitmapArray(const char* filename, int* frames, gr_surface** surface) { - int result = res_create_multi_surface(filename, frames, surface); + int result = res_create_multi_display_surface(filename, frames, surface); if (result < 0) { LOGE("missing bitmap %s\n(Code %d)\n", filename, result); } } void ScreenRecoveryUI::LoadLocalizedBitmap(const char* filename, gr_surface* surface) { - int result = res_create_localized_surface(filename, surface); + int result = res_create_localized_alpha_surface(filename, locale, surface); if (result < 0) { LOGE("missing bitmap %s\n(Code %d)\n", filename, result); } @@ -360,8 +361,9 @@ void ScreenRecoveryUI::Init() RecoveryUI::Init(); } -void ScreenRecoveryUI::SetLocale(const char* locale) { - if (locale) { +void ScreenRecoveryUI::SetLocale(const char* new_locale) { + if (new_locale) { + this->locale = new_locale; char* lang = strdup(locale); for (char* p = lang; *p; ++p) { if (*p == '_') { @@ -380,6 +382,8 @@ void ScreenRecoveryUI::SetLocale(const char* locale) { rtl_locale = true; } free(lang); + } else { + new_locale = NULL; } } |