Chromium Code Reviews| Index: chrome/browser/android/vr_shell/ui_scene_manager.cc |
| diff --git a/chrome/browser/android/vr_shell/ui_scene_manager.cc b/chrome/browser/android/vr_shell/ui_scene_manager.cc |
| index 49c45158192402d05bec125a2e4f7ef5c08e08c3..bbf7d48af415b6ebbbd0323da8d62002fe2d674c 100644 |
| --- a/chrome/browser/android/vr_shell/ui_scene_manager.cc |
| +++ b/chrome/browser/android/vr_shell/ui_scene_manager.cc |
| @@ -37,13 +37,17 @@ static constexpr int kFloorGridlineCount = 40; |
| static constexpr vr::Colorf kBackgroundHorizonColor = {0.57, 0.57, 0.57, 1.0}; |
| static constexpr vr::Colorf kBackgroundCenterColor = {0.48, 0.48, 0.48, 1.0}; |
| +// Placeholders to demonstrate UI changes when in CCT. |
| +static constexpr vr::Colorf kCctBackgroundHorizonColor = {0.2, 0.6, 0.2, 1.0}; |
| +static constexpr vr::Colorf kCctBackgroundCenterColor = {0.13, 0.52, 0.13, 1.0}; |
| + |
| // Tiny distance to offset textures that should appear in the same plane. |
| static constexpr float kTextureOffset = 0.01; |
| } // namespace |
| -UiSceneManager::UiSceneManager(UiScene* scene) |
| - : scene_(scene), weak_ptr_factory_(this) { |
| +UiSceneManager::UiSceneManager(UiScene* scene, bool in_cct) |
| + : scene_(scene), in_cct_(in_cct), weak_ptr_factory_(this) { |
|
ymalik
2017/05/05 14:32:53
This may have merge conflicts with https://coderev
|
| std::unique_ptr<UiElement> element; |
| CreateBackground(); |
| @@ -116,6 +120,10 @@ void UiSceneManager::CreateContentQuad() { |
| void UiSceneManager::CreateBackground() { |
| std::unique_ptr<UiElement> element; |
| + vr::Colorf horizon = |
| + in_cct_ ? kCctBackgroundHorizonColor : kBackgroundHorizonColor; |
| + vr::Colorf center = |
| + in_cct_ ? kCctBackgroundCenterColor : kBackgroundCenterColor; |
| // Floor. |
| element = base::MakeUnique<UiElement>(); |
| @@ -124,8 +132,8 @@ void UiSceneManager::CreateBackground() { |
| element->translation = {0.0, -kSceneHeight / 2, 0.0}; |
| element->rotation = {1.0, 0.0, 0.0, -M_PI / 2.0}; |
| element->fill = vr_shell::Fill::OPAQUE_GRADIENT; |
| - element->edge_color = kBackgroundHorizonColor; |
| - element->center_color = kBackgroundCenterColor; |
| + element->edge_color = horizon; |
| + element->center_color = center; |
| element->draw_phase = 0; |
| browser_ui_elements_.push_back(element.get()); |
| scene_->AddUiElement(std::move(element)); |
| @@ -138,8 +146,8 @@ void UiSceneManager::CreateBackground() { |
| element->translation = {0.0, kSceneHeight / 2, 0.0}; |
| element->rotation = {1.0, 0.0, 0.0, M_PI / 2}; |
| element->fill = vr_shell::Fill::OPAQUE_GRADIENT; |
| - element->edge_color = kBackgroundHorizonColor; |
| - element->center_color = kBackgroundCenterColor; |
| + element->edge_color = horizon; |
| + element->center_color = center; |
| element->draw_phase = 0; |
| browser_ui_elements_.push_back(element.get()); |
| scene_->AddUiElement(std::move(element)); |
| @@ -152,8 +160,8 @@ void UiSceneManager::CreateBackground() { |
| element->translation = {0.0, -kSceneHeight / 2 + kTextureOffset, 0.0}; |
| element->rotation = {1.0, 0.0, 0.0, -M_PI / 2}; |
| element->fill = vr_shell::Fill::GRID_GRADIENT; |
| - element->center_color = kBackgroundHorizonColor; |
| - vr::Colorf edge_color = kBackgroundHorizonColor; |
| + element->center_color = horizon; |
| + vr::Colorf edge_color = center; |
| edge_color.a = 0.0; |
| element->edge_color = edge_color; |
| element->gridline_count = kFloorGridlineCount; |
| @@ -161,7 +169,7 @@ void UiSceneManager::CreateBackground() { |
| browser_ui_elements_.push_back(element.get()); |
| scene_->AddUiElement(std::move(element)); |
| - scene_->SetBackgroundColor(kBackgroundHorizonColor); |
| + scene_->SetBackgroundColor(horizon); |
| } |
| base::WeakPtr<UiSceneManager> UiSceneManager::GetWeakPtr() { |