Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements.h

Issue 2335643002: Add VR Shell animation classes and unit test. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
bshe 2016/09/12 15:38:26 Is this necessary here? Looks like you include vr_
cjgrant 2016/09/13 17:32:16 Done (in the next patch set).
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 gvr::Vec3f GetCenter() const; 60 gvr::Vec3f GetCenter() const;
59 gvr::Vec3f GetNormal() const; 61 gvr::Vec3f GetNormal() const;
60 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const; 62 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const;
61 }; 63 };
62 64
63 class ContentRectangle : public WorldRectangle { 65 class ContentRectangle : public WorldRectangle {
64 public: 66 public:
65 ContentRectangle(); 67 ContentRectangle();
66 ~ContentRectangle(); 68 ~ContentRectangle();
67 69
68 int id; 70 void Animate(int64_t time);
71
72 int id = 0;
73
69 // samplerExternalOES texture data for desktop content image. 74 // samplerExternalOES texture data for desktop content image.
70 int content_texture_handle; 75 int content_texture_handle;
71 Rectf copy_rect; 76 Rectf copy_rect = {0.0f, 0.0f, 0.0f, 0.0f};
72 Recti window_rect; 77 Recti window_rect = {0.0f, 0.0f, 0.0f, 0.0f};
73 gvr::Vec3f size; 78 gvr::Vec3f size = {0.0f, 0.0f, 0.0f};
74 gvr::Vec3f translation; 79 gvr::Vec3f translation = {0.0f, 0.0f, 0.0f};
75 XAnchoring x_anchoring; 80 XAnchoring x_anchoring = XAnchoring::XNONE;
76 YAnchoring y_anchoring; 81 YAnchoring y_anchoring = YAnchoring::YNONE;
77 bool anchor_z; 82 bool anchor_z = false;
78 std::vector<float> orientation_axis_angle; 83 std::vector<float> orientation_axis_angle;
79 std::vector<float> rotation_axis_angle; 84 std::vector<float> rotation_axis_angle;
85 std::vector<std::unique_ptr<Animation>> animations;
80 86
81 private: 87 private:
82 DISALLOW_COPY_AND_ASSIGN(ContentRectangle); 88 DISALLOW_COPY_AND_ASSIGN(ContentRectangle);
83 }; 89 };
84 90
85 } // namespace vr_shell 91 } // namespace vr_shell
86 92
87 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_ 93 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698