| 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_UI_ELEMENT_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_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 "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" | 13 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" |
| 14 #include "device/vr/vr_types.h" | 14 #include "device/vr/vr_types.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class TimeTicks; | 18 class TimeTicks; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace vr_shell { | 21 namespace vr_shell { |
| 21 | 22 |
| 22 class Animation; | 23 class Animation; |
| 23 class VrShellRenderer; | 24 class VrShellRenderer; |
| 24 | 25 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 199 |
| 199 // Animations that affect the properties of the object over time. | 200 // Animations that affect the properties of the object over time. |
| 200 std::vector<std::unique_ptr<Animation>>& animations() { return animations_; } | 201 std::vector<std::unique_ptr<Animation>>& animations() { return animations_; } |
| 201 const std::vector<std::unique_ptr<Animation>>& animations() const { | 202 const std::vector<std::unique_ptr<Animation>>& animations() const { |
| 202 return animations_; | 203 return animations_; |
| 203 } | 204 } |
| 204 | 205 |
| 205 Fill fill() const { return fill_; } | 206 Fill fill() const { return fill_; } |
| 206 void set_fill(Fill fill) { fill_ = fill; } | 207 void set_fill(Fill fill) { fill_ = fill; } |
| 207 | 208 |
| 208 vr::Colorf edge_color() const { return edge_color_; } | 209 SkColor edge_color() const { return edge_color_; } |
| 209 void set_edge_color(const vr::Colorf& edge_color) { | 210 void set_edge_color(const SkColor& edge_color) { edge_color_ = edge_color; } |
| 210 edge_color_ = edge_color; | |
| 211 } | |
| 212 | 211 |
| 213 vr::Colorf center_color() const { return center_color_; } | 212 SkColor center_color() const { return center_color_; } |
| 214 void set_center_color(const vr::Colorf& center_color) { | 213 void set_center_color(const SkColor& center_color) { |
| 215 center_color_ = center_color; | 214 center_color_ = center_color; |
| 216 } | 215 } |
| 217 | 216 |
| 218 int gridline_count() const { return gridline_count_; } | 217 int gridline_count() const { return gridline_count_; } |
| 219 void set_gridline_count(int gridline_count) { | 218 void set_gridline_count(int gridline_count) { |
| 220 gridline_count_ = gridline_count; | 219 gridline_count_ = gridline_count; |
| 221 } | 220 } |
| 222 | 221 |
| 223 int draw_phase() const { return draw_phase_; } | 222 int draw_phase() const { return draw_phase_; } |
| 224 void set_draw_phase(int draw_phase) { draw_phase_ = draw_phase; } | 223 void set_draw_phase(int draw_phase) { draw_phase_ = draw_phase; } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 // specified edge(s) of the parent, rather than the center. A parent object | 291 // specified edge(s) of the parent, rather than the center. A parent object |
| 293 // must be specified when using anchoring. | 292 // must be specified when using anchoring. |
| 294 XAnchoring x_anchoring_ = XAnchoring::XNONE; | 293 XAnchoring x_anchoring_ = XAnchoring::XNONE; |
| 295 YAnchoring y_anchoring_ = YAnchoring::YNONE; | 294 YAnchoring y_anchoring_ = YAnchoring::YNONE; |
| 296 | 295 |
| 297 // Animations that affect the properties of the object over time. | 296 // Animations that affect the properties of the object over time. |
| 298 std::vector<std::unique_ptr<Animation>> animations_; | 297 std::vector<std::unique_ptr<Animation>> animations_; |
| 299 | 298 |
| 300 Fill fill_ = Fill::NONE; | 299 Fill fill_ = Fill::NONE; |
| 301 | 300 |
| 302 vr::Colorf edge_color_ = {1.0f, 1.0f, 1.0f, 1.0f}; | 301 SkColor edge_color_ = SK_ColorWHITE; |
| 303 vr::Colorf center_color_ = {1.0f, 1.0f, 1.0f, 1.0f}; | 302 SkColor center_color_ = SK_ColorWHITE; |
| 304 | 303 |
| 305 int gridline_count_ = 1; | 304 int gridline_count_ = 1; |
| 306 | 305 |
| 307 int draw_phase_ = 1; | 306 int draw_phase_ = 1; |
| 308 | 307 |
| 309 // This transform can be used by children to derive position of its parent. | 308 // This transform can be used by children to derive position of its parent. |
| 310 Transform inheritable_transform_; | 309 Transform inheritable_transform_; |
| 311 | 310 |
| 312 // A flag usable during transformation calculates to avoid duplicate work. | 311 // A flag usable during transformation calculates to avoid duplicate work. |
| 313 bool dirty_ = false; | 312 bool dirty_ = false; |
| 314 | 313 |
| 315 // An identifier used for testing and debugging, in lieu of a string. | 314 // An identifier used for testing and debugging, in lieu of a string. |
| 316 UiElementDebugId debug_id_ = UiElementDebugId::kNone; | 315 UiElementDebugId debug_id_ = UiElementDebugId::kNone; |
| 317 | 316 |
| 318 Transform transform_; | 317 Transform transform_; |
| 319 | 318 |
| 320 DISALLOW_COPY_AND_ASSIGN(UiElement); | 319 DISALLOW_COPY_AND_ASSIGN(UiElement); |
| 321 }; | 320 }; |
| 322 | 321 |
| 323 } // namespace vr_shell | 322 } // namespace vr_shell |
| 324 | 323 |
| 325 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ | 324 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ |
| OLD | NEW |