Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2836)

Unified Diff: chrome/browser/android/vr_shell/textures/system_indicator_texture.cc

Issue 2950173002: VR: System indicator rework. (Closed)
Patch Set: Address comments; increase size slightly for readability, now that position is dynamic. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/textures/system_indicator_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/system_indicator_texture.cc b/chrome/browser/android/vr_shell/textures/system_indicator_texture.cc
index 2ee7035e4a05040274c290bd6a21bc57dcc8d139..d87c6b945232d0ea4e43a495f70c3f03566d1aba 100644
--- a/chrome/browser/android/vr_shell/textures/system_indicator_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/system_indicator_texture.cc
@@ -44,8 +44,8 @@ void SystemIndicatorTexture::Draw(SkCanvas* sk_canvas,
gfx::Canvas gfx_canvas(&paint_canvas, 1.0f);
gfx::Canvas* canvas = &gfx_canvas;
- DCHECK(texture_size.height() * kHeightWidthRatio == texture_size.width());
size_.set_height(texture_size.height());
+
SkPaint paint;
paint.setColor(color_scheme().system_indicator_background);
@@ -99,9 +99,10 @@ void SystemIndicatorTexture::Draw(SkCanvas* sk_canvas,
gfx::Size SystemIndicatorTexture::GetPreferredTextureSize(
int maximum_width) const {
- // Ensuring height is a quarter of the width.
+ // All indicators need to be the same height, so compute height, and then
+ // re-compute with based on whether the indicator has text or not.
int height = maximum_width / kHeightWidthRatio;
- return gfx::Size(height * kHeightWidthRatio, height);
+ return gfx::Size(has_text_ ? maximum_width : height, height);
}
gfx::SizeF SystemIndicatorTexture::GetDrawnSize() const {

Powered by Google App Engine
This is Rietveld 408576698