| 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_ELEMENTS_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 XLEFT, | 21 XLEFT, |
| 22 XRIGHT | 22 XRIGHT |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 enum YAnchoring { | 25 enum YAnchoring { |
| 26 YNONE = 0, | 26 YNONE = 0, |
| 27 YTOP, | 27 YTOP, |
| 28 YBOTTOM | 28 YBOTTOM |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 enum Fill { |
| 32 NONE = 0, |
| 33 SPRITE = 1, |
| 34 OPAQUE_GRADIENT = 2, |
| 35 GRID_GRADIENT = 3 |
| 36 }; |
| 37 |
| 31 struct ReversibleTransform { | 38 struct ReversibleTransform { |
| 32 ReversibleTransform(); | 39 ReversibleTransform(); |
| 33 | 40 |
| 34 void MakeIdentity(); | 41 void MakeIdentity(); |
| 35 void Rotate(gvr::Quatf quat); | 42 void Rotate(gvr::Quatf quat); |
| 36 void Rotate(float ax, float ay, float az, float rad); | 43 void Rotate(float ax, float ay, float az, float rad); |
| 37 void Translate(float tx, float ty, float tz); | 44 void Translate(float tx, float ty, float tz); |
| 38 void Scale(float sx, float sy, float sz); | 45 void Scale(float sx, float sy, float sz); |
| 39 | 46 |
| 40 gvr::Mat4f to_world; | 47 gvr::Mat4f to_world; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 65 | 72 |
| 66 // Indicates whether the element should be visually rendered. | 73 // Indicates whether the element should be visually rendered. |
| 67 bool IsVisible() const; | 74 bool IsVisible() const; |
| 68 | 75 |
| 69 // Indicates whether the element should be tested for cursor input. | 76 // Indicates whether the element should be tested for cursor input. |
| 70 bool IsHitTestable() const; | 77 bool IsHitTestable() const; |
| 71 | 78 |
| 72 // Valid IDs are non-negative. | 79 // Valid IDs are non-negative. |
| 73 int id = -1; | 80 int id = -1; |
| 74 | 81 |
| 75 // If a non-negative parent ID is specified, applicable tranformations | 82 // If a non-negative parent ID is specified, applicable transformations |
| 76 // are applied relative to the parent, rather than absolutely. | 83 // are applied relative to the parent, rather than absolutely. |
| 77 int parent_id = -1; | 84 int parent_id = -1; |
| 78 | 85 |
| 79 // If true, this object will be visible. | 86 // If true, this object will be visible. |
| 80 bool visible = true; | 87 bool visible = true; |
| 81 | 88 |
| 82 // If false, the reticle will not hit the element, even if visible. | 89 // If false, the reticle will not hit the element, even if visible. |
| 83 bool hit_testable = true; | 90 bool hit_testable = true; |
| 84 | 91 |
| 85 // If true, transformations will be applied relative to the field of view, | 92 // If true, transformations will be applied relative to the field of view, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 114 | 121 |
| 115 // If anchoring is specified, the translation will be relative to the | 122 // If anchoring is specified, the translation will be relative to the |
| 116 // specified edge(s) of the parent, rather than the center. A parent object | 123 // specified edge(s) of the parent, rather than the center. A parent object |
| 117 // must be specified when using anchoring. | 124 // must be specified when using anchoring. |
| 118 XAnchoring x_anchoring = XAnchoring::XNONE; | 125 XAnchoring x_anchoring = XAnchoring::XNONE; |
| 119 YAnchoring y_anchoring = YAnchoring::YNONE; | 126 YAnchoring y_anchoring = YAnchoring::YNONE; |
| 120 | 127 |
| 121 // Animations that affect the properties of the object over time. | 128 // Animations that affect the properties of the object over time. |
| 122 std::vector<std::unique_ptr<Animation>> animations; | 129 std::vector<std::unique_ptr<Animation>> animations; |
| 123 | 130 |
| 131 Fill fill = Fill::NONE; |
| 132 |
| 133 Colorf edge_color = {1.0f, 1.0f, 1.0f, 1.0f}; |
| 134 Colorf center_color = {1.0f, 1.0f, 1.0f, 1.0f}; |
| 135 |
| 136 unsigned int tile_number; |
| 137 |
| 124 private: | 138 private: |
| 125 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); | 139 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); |
| 126 }; | 140 }; |
| 127 | 141 |
| 128 } // namespace vr_shell | 142 } // namespace vr_shell |
| 129 | 143 |
| 130 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 144 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
| OLD | NEW |