OLD | NEW |
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/ui_element.h" | 5 #include "chrome/browser/android/vr_shell/ui_element.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 const gfx::Vector3dF& ray_vector, | 98 const gfx::Vector3dF& ray_vector, |
99 float* distance) const { | 99 float* distance) const { |
100 return GetRayPlaneDistance(ray_origin, ray_vector, GetCenter(), GetNormal(), | 100 return GetRayPlaneDistance(ray_origin, ray_vector, GetCenter(), GetNormal(), |
101 distance); | 101 distance); |
102 } | 102 } |
103 | 103 |
104 UiElement::UiElement() = default; | 104 UiElement::UiElement() = default; |
105 | 105 |
106 UiElement::~UiElement() = default; | 106 UiElement::~UiElement() = default; |
107 | 107 |
| 108 bool UiElement::Render(VrShellRenderer* renderer) const { |
| 109 return false; |
| 110 } |
| 111 |
108 void UiElement::Animate(const base::TimeTicks& time) { | 112 void UiElement::Animate(const base::TimeTicks& time) { |
109 for (auto& it : animations) { | 113 for (auto& it : animations) { |
110 Animation& animation = *it; | 114 Animation& animation = *it; |
111 if (time < animation.start) | 115 if (time < animation.start) |
112 continue; | 116 continue; |
113 | 117 |
114 // If |from| is not specified, start at the current values. | 118 // If |from| is not specified, start at the current values. |
115 if (animation.from.size() == 0) { | 119 if (animation.from.size() == 0) { |
116 switch (animation.property) { | 120 switch (animation.property) { |
117 case Animation::SIZE: | 121 case Animation::SIZE: |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 197 |
194 bool UiElement::IsVisible() const { | 198 bool UiElement::IsVisible() const { |
195 return visible && computed_opacity > 0.0f; | 199 return visible && computed_opacity > 0.0f; |
196 } | 200 } |
197 | 201 |
198 bool UiElement::IsHitTestable() const { | 202 bool UiElement::IsHitTestable() const { |
199 return IsVisible() && hit_testable; | 203 return IsVisible() && hit_testable; |
200 } | 204 } |
201 | 205 |
202 } // namespace vr_shell | 206 } // namespace vr_shell |
OLD | NEW |