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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2926643003: [VrShell] Centralize color handling and enable close button on fullscreen (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h"
6 6
7 #include <chrono> 7 #include <chrono>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 // existing content in place in the primary buffer without 1124 // existing content in place in the primary buffer without
1125 // clearing. Currently, there aren't any world elements in WebVR 1125 // clearing. Currently, there aren't any world elements in WebVR
1126 // mode, this will need further testing if those get added 1126 // mode, this will need further testing if those get added
1127 // later. 1127 // later.
1128 } else { 1128 } else {
1129 // Non-WebVR mode, enable depth testing and clear the primary buffers. 1129 // Non-WebVR mode, enable depth testing and clear the primary buffers.
1130 glEnable(GL_CULL_FACE); 1130 glEnable(GL_CULL_FACE);
1131 glEnable(GL_DEPTH_TEST); 1131 glEnable(GL_DEPTH_TEST);
1132 glDepthMask(GL_TRUE); 1132 glDepthMask(GL_TRUE);
1133 1133
1134 const SkColor backgroundColor = scene_->GetBackgroundColor(); 1134 const SkColor backgroundColor = scene_->GetWorldBackgroundColor();
1135 glClearColor(SkColorGetR(backgroundColor) / 255.0, 1135 glClearColor(SkColorGetR(backgroundColor) / 255.0,
1136 SkColorGetG(backgroundColor) / 255.0, 1136 SkColorGetG(backgroundColor) / 255.0,
1137 SkColorGetB(backgroundColor) / 255.0, 1137 SkColorGetB(backgroundColor) / 255.0,
1138 SkColorGetA(backgroundColor) / 255.0); 1138 SkColorGetA(backgroundColor) / 255.0);
1139 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 1139 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
1140 } 1140 }
1141 std::vector<const UiElement*> elements = scene_->GetWorldElements(); 1141 std::vector<const UiElement*> elements = scene_->GetWorldElements();
1142 const bool draw_reticle = !(scene_->is_exiting() || ShouldDrawWebVr()); 1142 const bool draw_reticle = !(scene_->is_exiting() || ShouldDrawWebVr());
1143 DrawUiView(head_pose, elements, render_size_primary_, 1143 DrawUiView(head_pose, elements, render_size_primary_,
1144 kViewportListPrimaryOffset, draw_reticle); 1144 kViewportListPrimaryOffset, draw_reticle);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 // This assumes that the initial webvr_surface_size_ was set to the 1599 // This assumes that the initial webvr_surface_size_ was set to the
1600 // appropriate recommended render resolution as the default size during 1600 // appropriate recommended render resolution as the default size during
1601 // InitializeGl. Revisit if the initialization order changes. 1601 // InitializeGl. Revisit if the initialization order changes.
1602 device::mojom::VRDisplayInfoPtr info = 1602 device::mojom::VRDisplayInfoPtr info =
1603 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), 1603 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(),
1604 webvr_surface_size_, device_id); 1604 webvr_surface_size_, device_id);
1605 browser_->RunVRDisplayInfoCallback(callback, &info); 1605 browser_->RunVRDisplayInfoCallback(callback, &info);
1606 } 1606 }
1607 1607
1608 } // namespace vr_shell 1608 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698