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

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

Issue 2301633002: Refactor Vr activity into ChromeTabbedActivity. (Closed)
Patch Set: Address comments and rebase 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_
7
8 #include <cmath>
9 #include <vector>
10
11 #include "base/logging.h"
12 #include "chrome/browser/android/vr_shell/vr_util.h"
13 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g vr_types.h"
14
15 namespace vr_shell {
16
17 enum XAnchoring {
18 XLEFT = 0,
19 XRIGHT,
20 XCENTER,
21 XNONE
22 };
23
24 enum YAnchoring {
25 YTOP = 0,
26 YBOTTOM,
27 YCENTER,
28 YNONE
29 };
30
31 class ReversibleTransform {
32 public:
33 ReversibleTransform();
34
35 void MakeIdentity();
36 void Rotate(gvr::Quatf quat);
37 void Rotate(float ax, float ay, float az, float rad);
38 void Translate(float tx, float ty, float tz);
39 void Scale(float sx, float sy, float sz);
40
41 gvr::Mat4f to_world_;
bshe 2016/09/09 14:42:10 remove trailing _ for public members.
mthiesse 2016/09/09 15:16:38 Done.
David Trainor- moved to gerrit 2016/09/13 05:43:06 Hmm are you sure? IIUC the Google style guide req
bshe 2016/09/13 13:54:28 Looking back at the style guide. You are right, it
42 gvr::Mat4f from_world_;
bshe 2016/09/09 14:42:10 ditto.
mthiesse 2016/09/09 15:16:38 Done.
43
44 // This object-to-world orientation quaternion is technically
45 // redundant, but it's easy to track it here for use as needed.
46 // TODO(klausw): use this instead of MatrixVectorRotation()?
47 // Would need quat * vector implementation.
48 gvr::Quatf orientation_ = {0.0f, 0.0f, 0.0f, 1.0f};
bshe 2016/09/09 14:42:10 ditto
mthiesse 2016/09/09 15:16:38 Done.
49 };
50
51 class WorldObject {
52 public:
53 ReversibleTransform transform_;
54 };
55
56 class WorldRectangle : public WorldObject {
57 public:
58 gvr::Vec3f GetCenter() const;
59 gvr::Vec3f GetNormal() const;
60 float GetRayDistance(gvr::Vec3f rayOrigin, gvr::Vec3f rayVector) const;
61 };
62
63 class ContentRectangle : public WorldRectangle {
64 public:
65 ContentRectangle();
66 ~ContentRectangle();
67
68 int id;
69 // samplerExternalOES texture data for desktop content image.
70 int content_texture_handle;
David Trainor- moved to gerrit 2016/09/09 06:28:29 Need trailing _ for these
mthiesse 2016/09/09 15:16:38 These are public members, expected to be accessed
David Trainor- moved to gerrit 2016/09/13 05:43:06 I feel like in that case we should just make the c
bshe 2016/09/13 13:54:28 Agree. See. https://google.github.io/styleguide/cp
71 Rectf copy_rect;
72 Recti window_rect;
73 gvr::Vec3f size;
74 gvr::Vec3f translation;
75 XAnchoring x_anchoring;
76 YAnchoring y_anchoring;
77 bool anchor_z;
78 std::vector<float> orientation_axis_angle;
79 std::vector<float> rotation_axis_angle;
80
81 private:
82 DISALLOW_COPY_AND_ASSIGN(ContentRectangle);
83 };
84
85 } // namespace vr_shell
86
87 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698