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

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

Issue 2914623003: [VrShell] Centralize color handling and enable close button on fullscreen (Closed)
Patch Set: adjust close button vertical a bit 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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 // existing content in place in the primary buffer without 1107 // existing content in place in the primary buffer without
1108 // clearing. Currently, there aren't any world elements in WebVR 1108 // clearing. Currently, there aren't any world elements in WebVR
1109 // mode, this will need further testing if those get added 1109 // mode, this will need further testing if those get added
1110 // later. 1110 // later.
1111 } else { 1111 } else {
1112 // Non-WebVR mode, enable depth testing and clear the primary buffers. 1112 // Non-WebVR mode, enable depth testing and clear the primary buffers.
1113 glEnable(GL_CULL_FACE); 1113 glEnable(GL_CULL_FACE);
1114 glEnable(GL_DEPTH_TEST); 1114 glEnable(GL_DEPTH_TEST);
1115 glDepthMask(GL_TRUE); 1115 glDepthMask(GL_TRUE);
1116 1116
1117 const SkColor backgroundColor = scene_->GetBackgroundColor(); 1117 const SkColor backgroundColor = scene_->GetWorldBackgroundColor();
1118 glClearColor(SkColorGetR(backgroundColor) / 255.0, 1118 glClearColor(SkColorGetR(backgroundColor) / 255.0,
1119 SkColorGetG(backgroundColor) / 255.0, 1119 SkColorGetG(backgroundColor) / 255.0,
1120 SkColorGetB(backgroundColor) / 255.0, 1120 SkColorGetB(backgroundColor) / 255.0,
1121 SkColorGetA(backgroundColor) / 255.0); 1121 SkColorGetA(backgroundColor) / 255.0);
1122 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 1122 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
1123 } 1123 }
1124 std::vector<const UiElement*> elements = scene_->GetWorldElements(); 1124 std::vector<const UiElement*> elements = scene_->GetWorldElements();
1125 const bool draw_reticle = !(scene_->is_exiting() || ShouldDrawWebVr()); 1125 const bool draw_reticle = !(scene_->is_exiting() || ShouldDrawWebVr());
1126 DrawUiView(head_pose, elements, render_size_primary_, 1126 DrawUiView(head_pose, elements, render_size_primary_,
1127 kViewportListPrimaryOffset, draw_reticle); 1127 kViewportListPrimaryOffset, draw_reticle);
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 // This assumes that the initial webvr_surface_size_ was set to the 1581 // This assumes that the initial webvr_surface_size_ was set to the
1582 // appropriate recommended render resolution as the default size during 1582 // appropriate recommended render resolution as the default size during
1583 // InitializeGl. Revisit if the initialization order changes. 1583 // InitializeGl. Revisit if the initialization order changes.
1584 device::mojom::VRDisplayInfoPtr info = 1584 device::mojom::VRDisplayInfoPtr info =
1585 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), 1585 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(),
1586 webvr_surface_size_, device_id); 1586 webvr_surface_size_, device_id);
1587 browser_->RunVRDisplayInfoCallback(callback, &info); 1587 browser_->RunVRDisplayInfoCallback(callback, &info);
1588 } 1588 }
1589 1589
1590 } // namespace vr_shell 1590 } // 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