| 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_elements/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" |
| 11 #include "chrome/browser/android/vr_shell/animation.h" | 11 #include "chrome/browser/android/vr_shell/animation.h" |
| 12 #include "chrome/browser/android/vr_shell/easing.h" | 12 #include "chrome/browser/android/vr_shell/easing.h" |
| 13 #include "device/vr/vr_math.h" | 13 #include "device/vr/vr_math.h" |
| 14 | 14 |
| 15 namespace vr_shell { | 15 namespace vr_shell { |
| (...skipping 82 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 void UiElement::Render(VrShellRenderer* renderer, |
| 109 vr::Mat4f view_proj_matrix) const { |
| 110 NOTREACHED(); |
| 111 } |
| 112 |
| 113 void UiElement::Initialize() {} |
| 114 |
| 108 void UiElement::Animate(const base::TimeTicks& time) { | 115 void UiElement::Animate(const base::TimeTicks& time) { |
| 109 for (auto& it : animations) { | 116 for (auto& it : animations) { |
| 110 Animation& animation = *it; | 117 Animation& animation = *it; |
| 111 if (time < animation.start) | 118 if (time < animation.start) |
| 112 continue; | 119 continue; |
| 113 | 120 |
| 114 // If |from| is not specified, start at the current values. | 121 // If |from| is not specified, start at the current values. |
| 115 if (animation.from.size() == 0) { | 122 if (animation.from.size() == 0) { |
| 116 switch (animation.property) { | 123 switch (animation.property) { |
| 117 case Animation::SIZE: | 124 case Animation::SIZE: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 200 |
| 194 bool UiElement::IsVisible() const { | 201 bool UiElement::IsVisible() const { |
| 195 return visible && computed_opacity > 0.0f; | 202 return visible && computed_opacity > 0.0f; |
| 196 } | 203 } |
| 197 | 204 |
| 198 bool UiElement::IsHitTestable() const { | 205 bool UiElement::IsHitTestable() const { |
| 199 return IsVisible() && hit_testable; | 206 return IsVisible() && hit_testable; |
| 200 } | 207 } |
| 201 | 208 |
| 202 } // namespace vr_shell | 209 } // namespace vr_shell |
| OLD | NEW |