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..9fc4eb06fa593bf0af4b2ef51d2d327c71c54744 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,42 @@ class VrShell { |
| private: |
| ~VrShell(); |
| - |
| void DrawEye(const gvr::Mat4f& view_matrix, |
| const gvr::BufferViewport& params); |
| - void DrawContentRect(); |
| + void DrawUI(); |
| + |
| + void UpdateTransforms(float screenWidthMeters, |
| + 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; |
| + |
| + static constexpr float kZNear = 0.1f; |
| + static constexpr float kZFar = 1000.0f; |
| + |
| + // Content rect in world coordinates. Height and width are currently supplied |
|
amp
2016/09/01 20:50:41
Is this comment still valid? I don't see any heig
mthiesse
2016/09/02 01:05:34
Ah, nope stale comment.
|
| + // as DrawFrame arguments. |
| + 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 +86,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); |