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

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

Issue 2624243002: VrShell: Allow native control of UI element opacity. (Closed)
Patch Set: 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..2e0ee4ddd42b730b19495fb47ddde8006572bde4 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -487,7 +487,8 @@ 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->visible || plane->computed_opacity == 0.0f ||
cjgrant 2017/01/11 16:45:47 Checking opacity here relieves the HTML UI of havi
mthiesse 2017/01/11 18:33:04 Maybe add a function IsVisible() to ContentRectang
cjgrant 2017/01/11 20:58:42 Done.
+ !plane->hit_testable) {
continue;
}
float distance_to_plane = plane->GetRayDistance(kOrigin, eye_to_target);
@@ -701,7 +702,7 @@ 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->visible || rect->computed_opacity == 0.0f) {
continue;
}
if (rect->lock_to_fov) {
@@ -813,7 +814,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);
}
}

Powered by Google App Engine
This is Rietveld 408576698