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

Unified Diff: chrome/browser/android/vr_shell/ui_elements.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
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements.h ('k') | chrome/browser/android/vr_shell/ui_scene.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/ui_elements.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements.cc b/chrome/browser/android/vr_shell/ui_elements.cc
index e0285885896ec56991e27e350ac56c73c8993a17..449dddf9157a2f7b94de37a64d3346d6634f472c 100644
--- a/chrome/browser/android/vr_shell/ui_elements.cc
+++ b/chrome/browser/android/vr_shell/ui_elements.cc
@@ -122,6 +122,9 @@ void ContentRectangle::Animate(int64_t time) {
animation.from.push_back(translation.y);
animation.from.push_back(translation.z);
break;
+ case Animation::OPACITY:
+ animation.from.push_back(opacity);
+ break;
}
}
CHECK_EQ(animation.from.size(), animation.to.size());
@@ -170,6 +173,10 @@ void ContentRectangle::Animate(int64_t time) {
translation.y = values[1];
translation.z = values[2];
break;
+ case Animation::OPACITY:
+ CHECK_EQ(animation.from.size(), 1u);
+ opacity = values[0];
+ break;
}
}
for (auto it = animations.begin(); it != animations.end();) {
@@ -182,5 +189,13 @@ void ContentRectangle::Animate(int64_t time) {
}
}
+bool ContentRectangle::IsVisible() const {
+ return visible && computed_opacity > 0.0f;
+}
+
+bool ContentRectangle::IsHitTestable() const {
+ return IsVisible() && hit_testable;
+}
+
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements.h ('k') | chrome/browser/android/vr_shell/ui_scene.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698