| 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 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "chrome/browser/android/vr_shell/vr_shell.h" | 8 #include "chrome/browser/android/vr_shell/vr_shell.h" |
| 9 #include "device/vr/android/gvr/gvr_device_provider.h" | 9 #include "device/vr/android/gvr/gvr_device_provider.h" |
| 10 #include "jni/VrShellDelegate_jni.h" | 10 #include "jni/VrShellDelegate_jni.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 virtual ~GvrNonPresentingDelegate() = default; | 25 virtual ~GvrNonPresentingDelegate() = default; |
| 26 | 26 |
| 27 // GvrDelegate implementation | 27 // GvrDelegate implementation |
| 28 void SetWebVRSecureOrigin(bool secure_origin) override {} | 28 void SetWebVRSecureOrigin(bool secure_origin) override {} |
| 29 void SubmitWebVRFrame() override {} | 29 void SubmitWebVRFrame() override {} |
| 30 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, | 30 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, |
| 31 const gvr::Rectf& right_bounds) override {} | 31 const gvr::Rectf& right_bounds) override {} |
| 32 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, | 32 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, |
| 33 uint32_t pose_index) override {} | 33 uint32_t pose_index) override {} |
| 34 void SetWebVRRenderSurfaceSize(int width, int height) override {} |
| 35 gvr::Sizei GetWebVRCompositorSurfaceSize() override { |
| 36 return device::kFallbackRenderTargetSize; } |
| 34 gvr::GvrApi* gvr_api() override { return gvr_api_.get(); } | 37 gvr::GvrApi* gvr_api() override { return gvr_api_.get(); } |
| 35 base::WeakPtr<GvrNonPresentingDelegate> GetWeakPtr() { | 38 base::WeakPtr<GvrNonPresentingDelegate> GetWeakPtr() { |
| 36 return weak_ptr_factory_.GetWeakPtr(); | 39 return weak_ptr_factory_.GetWeakPtr(); |
| 37 } | 40 } |
| 38 private: | 41 private: |
| 39 std::unique_ptr<gvr::GvrApi> gvr_api_; | 42 std::unique_ptr<gvr::GvrApi> gvr_api_; |
| 40 base::WeakPtrFactory<GvrNonPresentingDelegate> weak_ptr_factory_; | 43 base::WeakPtrFactory<GvrNonPresentingDelegate> weak_ptr_factory_; |
| 41 }; | 44 }; |
| 42 | 45 |
| 43 VrShellDelegate::VrShellDelegate(JNIEnv* env, jobject obj) | 46 VrShellDelegate::VrShellDelegate(JNIEnv* env, jobject obj) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 121 |
| 119 bool RegisterVrShellDelegate(JNIEnv* env) { | 122 bool RegisterVrShellDelegate(JNIEnv* env) { |
| 120 return RegisterNativesImpl(env); | 123 return RegisterNativesImpl(env); |
| 121 } | 124 } |
| 122 | 125 |
| 123 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 126 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 124 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); | 127 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); |
| 125 } | 128 } |
| 126 | 129 |
| 127 } // namespace vr_shell | 130 } // namespace vr_shell |
| OLD | NEW |