Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_shell.h |
| diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h |
| index 4fcff02aca8e683e1b218bd9d2cd14a4118cbffa..056c12e69cc8ba3244770a9bcdf86c37a0e6446e 100644 |
| --- a/chrome/browser/android/vr_shell/vr_shell.h |
| +++ b/chrome/browser/android/vr_shell/vr_shell.h |
| @@ -7,32 +7,24 @@ |
| #include <jni.h> |
| #include <memory> |
| +#include <vector> |
| #include "base/android/jni_weak_ref.h" |
| #include "base/macros.h" |
| +#include "chrome/browser/android/vr_shell/ui_elements.h" |
| #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h" |
| #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h" |
| + |
| namespace vr_shell { |
| class VrShellRenderer; |
| -class ContentRect { |
| - public: |
| - ContentRect(); |
| - ~ContentRect(); |
| - void SetIdentity(); |
| - void Translate(float x, float y, float z); |
| - gvr::Mat4f transfrom_to_world; |
| - int content_texture_handle; |
| -}; |
| - |
| class VrShell { |
| public: |
| VrShell(JNIEnv* env, jobject obj); |
| void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| - |
| void GvrInit(JNIEnv* env, |
| const base::android::JavaParamRef<jobject>& obj, |
| jlong native_gvr_api); |
| @@ -45,12 +37,40 @@ class VrShell { |
| private: |
| ~VrShell(); |
| - |
| void DrawEye(const gvr::Mat4f& view_matrix, |
| const gvr::BufferViewport& params); |
| - void DrawContentRect(); |
| + void DrawUI(); |
| + |
| + void UpdateTransforms(float screenWidthMeters, |
|
David Trainor- moved to gerrit
2016/09/08 05:49:30
fix variable names, same for others. Will stop ni
mthiesse
2016/09/08 17:44:41
haha sorry about that. I've scoured through the co
David Trainor- moved to gerrit
2016/09/09 06:28:29
No worries! I do the same thing especially moving
|
| + float screenHeightMeters, |
| + float screenTilt); |
| + |
| + // samplerExternalOES texture data for desktop content image. |
| + jint content_texture_id_ = 0; |
| + |
| + // Constant taken from treasure_hunt demo. |
| + static constexpr long kPredictionTimeWithoutVsyncNanos = 50000000; |
|
David Trainor- moved to gerrit
2016/09/08 05:49:30
Should these be in an anonymous namespace in the c
mthiesse
2016/09/08 17:44:41
There's no reason to have these in the header, rat
David Trainor- moved to gerrit
2016/09/09 06:28:29
Yeah sorry for the nit about this. For me it make
|
| + |
| + static constexpr float kZNear = 0.1f; |
| + static constexpr float kZFar = 1000.0f; |
| + |
| + static constexpr gvr::Vec3f kDesktopPositionDefault = {0.0f, 0.0f, -2.0f}; |
| + static constexpr float kDesktopHeightDefault = 1.6f; |
| + |
| + // Screen angle in degrees. 0 = vertical, positive = top closer. |
| + static constexpr float kDesktopScreenTiltDefault = 0; |
| + |
| + static constexpr float kScreenHeightMeters = 2.0f; |
| + static constexpr float kScreenWidthMeters = 2.0f; |
| + |
| + float desktop_screen_tilt_ = kDesktopScreenTiltDefault; |
| + float desktop_height_ = kDesktopHeightDefault; |
| + |
| + ContentRectangle* desktop_plane_; |
| + gvr::Vec3f desktop_position_ = kDesktopPositionDefault; |
| + |
| + std::vector<std::unique_ptr<ContentRectangle>> ui_rects_; |
| - std::unique_ptr<ContentRect> content_rect_; |
| std::unique_ptr<gvr::GvrApi> gvr_api_; |
| std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_; |
| std::unique_ptr<gvr::BufferViewport> buffer_viewport_; |
| @@ -64,7 +84,6 @@ class VrShell { |
| gvr::Sizei render_size_; |
| std::unique_ptr<VrShellRenderer> vr_shell_renderer_; |
| - |
| base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| DISALLOW_COPY_AND_ASSIGN(VrShell); |