| 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENT_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "device/vr/vr_types.h" | 13 #include "device/vr/vr_types.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class TimeTicks; | 16 class TimeTicks; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // rectangle, returning 2D coordinates relative to the un-transformed unit | 79 // rectangle, returning 2D coordinates relative to the un-transformed unit |
| 80 // rectangle. This allows beam intersection points to be mapped to sprite | 80 // rectangle. This allows beam intersection points to be mapped to sprite |
| 81 // pixel coordinates. Points that fall onto the rectangle will generate X and | 81 // pixel coordinates. Points that fall onto the rectangle will generate X and |
| 82 // Y values on the interval [-0.5, 0.5]. | 82 // Y values on the interval [-0.5, 0.5]. |
| 83 gfx::PointF GetUnitRectangleCoordinates(const gfx::Point3F& world_point); | 83 gfx::PointF GetUnitRectangleCoordinates(const gfx::Point3F& world_point); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 Transform transform_; | 86 Transform transform_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 struct ContentRectangle : public WorldRectangle { | 89 struct UiElement : public WorldRectangle { |
| 90 ContentRectangle(); | 90 UiElement(); |
| 91 ~ContentRectangle(); | 91 ~UiElement(); |
| 92 | 92 |
| 93 void Animate(const base::TimeTicks& time); | 93 void Animate(const base::TimeTicks& time); |
| 94 | 94 |
| 95 // Indicates whether the element should be visually rendered. | 95 // Indicates whether the element should be visually rendered. |
| 96 bool IsVisible() const; | 96 bool IsVisible() const; |
| 97 | 97 |
| 98 // Indicates whether the element should be tested for cursor input. | 98 // Indicates whether the element should be tested for cursor input. |
| 99 bool IsHitTestable() const; | 99 bool IsHitTestable() const; |
| 100 | 100 |
| 101 // Valid IDs are non-negative. | 101 // Valid IDs are non-negative. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 int draw_phase = 1; | 162 int draw_phase = 1; |
| 163 | 163 |
| 164 // This transform can be used by children to derive position of its parent. | 164 // This transform can be used by children to derive position of its parent. |
| 165 Transform inheritable_transform; | 165 Transform inheritable_transform; |
| 166 | 166 |
| 167 // A flag usable during transformation calculates to avoid duplicate work. | 167 // A flag usable during transformation calculates to avoid duplicate work. |
| 168 bool dirty; | 168 bool dirty; |
| 169 | 169 |
| 170 private: | 170 private: |
| 171 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); | 171 DISALLOW_COPY_AND_ASSIGN(UiElement); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace vr_shell | 174 } // namespace vr_shell |
| 175 | 175 |
| 176 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 176 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENT_H_ |
| OLD | NEW |