| 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 <cmath> | 8 #include <cmath> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "chrome/browser/android/vr_shell/vr_util.h" | 12 #include "chrome/browser/android/vr_shell/vr_math.h" |
| 13 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr_types.h" | 13 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr_types.h" |
| 14 | 14 |
| 15 namespace vr_shell { | 15 namespace vr_shell { |
| 16 | 16 |
| 17 class Animation; |
| 18 |
| 17 enum XAnchoring { | 19 enum XAnchoring { |
| 18 XLEFT = 0, | 20 XLEFT = 0, |
| 19 XRIGHT, | 21 XRIGHT, |
| 20 XCENTER, | 22 XCENTER, |
| 21 XNONE | 23 XNONE |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 enum YAnchoring { | 26 enum YAnchoring { |
| 25 YTOP = 0, | 27 YTOP = 0, |
| 26 YBOTTOM, | 28 YBOTTOM, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 struct WorldRectangle : public WorldObject { | 56 struct WorldRectangle : public WorldObject { |
| 55 gvr::Vec3f GetCenter() const; | 57 gvr::Vec3f GetCenter() const; |
| 56 gvr::Vec3f GetNormal() const; | 58 gvr::Vec3f GetNormal() const; |
| 57 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const; | 59 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const; |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 struct ContentRectangle : public WorldRectangle { | 62 struct ContentRectangle : public WorldRectangle { |
| 61 ContentRectangle(); | 63 ContentRectangle(); |
| 62 ~ContentRectangle(); | 64 ~ContentRectangle(); |
| 63 | 65 |
| 64 int id; | 66 void Animate(int64_t time); |
| 67 |
| 68 int id = 0; |
| 69 |
| 65 // samplerExternalOES texture data for desktop content image. | 70 // samplerExternalOES texture data for desktop content image. |
| 66 int content_texture_handle; | 71 int content_texture_handle = -1; |
| 67 Rectf copy_rect; | 72 Rectf copy_rect = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 68 Recti window_rect; | 73 Recti window_rect = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 69 gvr::Vec3f size; | 74 gvr::Vec3f size = {0.0f, 0.0f, 0.0f}; |
| 70 gvr::Vec3f translation; | 75 gvr::Vec3f translation = {0.0f, 0.0f, 0.0f}; |
| 71 XAnchoring x_anchoring; | 76 XAnchoring x_anchoring = XAnchoring::XNONE; |
| 72 YAnchoring y_anchoring; | 77 YAnchoring y_anchoring = YAnchoring::YNONE; |
| 73 bool anchor_z; | 78 bool anchor_z = false; |
| 74 std::vector<float> orientation_axis_angle; | 79 std::vector<float> orientation_axis_angle; |
| 75 std::vector<float> rotation_axis_angle; | 80 std::vector<float> rotation_axis_angle; |
| 81 std::vector<std::unique_ptr<Animation>> animations; |
| 76 | 82 |
| 77 private: | 83 private: |
| 78 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); | 84 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); |
| 79 }; | 85 }; |
| 80 | 86 |
| 81 } // namespace vr_shell | 87 } // namespace vr_shell |
| 82 | 88 |
| 83 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ | 89 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ |
| OLD | NEW |