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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2624243002: VrShell: Allow native control of UI element opacity. (Closed)
Patch Set: for (auto nit : nits) nit.fix(); Created 3 years, 11 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/vr_shell_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index effea8744a33b0116316f64481f8d79c751d5497..43a4f60ad4f5fcc845ba7282a004bb71add5a4f6 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -487,9 +487,9 @@ void VrShellGl::UpdateController(const gvr::Vec3f& forward_vector) {
InputTarget input_target = InputTarget::NONE;
for (const auto& plane : scene_->GetUiElements()) {
- if (!plane->visible || !plane->hit_testable) {
+ if (!plane->IsHitTestable())
continue;
- }
+
float distance_to_plane = plane->GetRayDistance(kOrigin, eye_to_target);
gvr::Vec3f plane_intersection_point =
GetRayPoint(kOrigin, eye_to_target, distance_to_plane);
@@ -701,9 +701,8 @@ void VrShellGl::DrawVrShell(const gvr::Mat4f& head_pose,
std::vector<const ContentRectangle*> head_locked_elements;
std::vector<const ContentRectangle*> world_elements;
for (const auto& rect : scene_->GetUiElements()) {
- if (!rect->visible) {
+ if (!rect->IsVisible())
continue;
- }
if (rect->lock_to_fov) {
head_locked_elements.push_back(rect.get());
} else {
@@ -813,7 +812,7 @@ void VrShellGl::DrawElements(
}
gvr::Mat4f transform = MatrixMul(render_matrix, rect->transform.to_world);
vr_shell_renderer_->GetTexturedQuadRenderer()->Draw(
- texture_handle, transform, copy_rect);
+ texture_handle, transform, copy_rect, rect->computed_opacity);
}
}
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_unittest.cc ('k') | chrome/browser/android/vr_shell/vr_shell_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698