| 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void SetContentCssSize(float width, float height, float dpr); | 127 void SetContentCssSize(float width, float height, float dpr); |
| 128 void SetUiCssSize(float width, float height, float dpr); | 128 void SetUiCssSize(float width, float height, float dpr); |
| 129 | 129 |
| 130 void ContentFrameWasResized(bool width_changed); | 130 void ContentFrameWasResized(bool width_changed); |
| 131 | 131 |
| 132 void ForceExitVr(); | 132 void ForceExitVr(); |
| 133 | 133 |
| 134 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); | 134 void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); |
| 135 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); | 135 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); |
| 136 | 136 |
| 137 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat, | 137 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); |
| 138 uint32_t pose_index); | |
| 139 | 138 |
| 140 private: | 139 private: |
| 141 ~VrShell() override; | 140 ~VrShell() override; |
| 142 void PostToGlThreadWhenReady(const base::Closure& task); | 141 void PostToGlThreadWhenReady(const base::Closure& task); |
| 143 | 142 |
| 144 // content::WebContentsObserver implementation. | 143 // content::WebContentsObserver implementation. |
| 145 void RenderViewHostChanged(content::RenderViewHost* old_host, | 144 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 146 content::RenderViewHost* new_host) override; | 145 content::RenderViewHost* new_host) override; |
| 147 void MainFrameWasResized(bool width_changed) override; | 146 void MainFrameWasResized(bool width_changed) override; |
| 148 void WebContentsDestroyed() override; | 147 void WebContentsDestroyed() override; |
| 149 | 148 |
| 150 // device::GvrDelegate implementation | 149 // device::GvrDelegate implementation |
| 151 void SetWebVRSecureOrigin(bool secure_origin) override; | 150 void SetWebVRSecureOrigin(bool secure_origin) override; |
| 152 void SubmitWebVRFrame() override; | 151 void SubmitWebVRFrame() override; |
| 153 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, | 152 void UpdateWebVRTextureBounds(int16_t frame_index, |
| 153 const gvr::Rectf& left_bounds, |
| 154 const gvr::Rectf& right_bounds) override; | 154 const gvr::Rectf& right_bounds) override; |
| 155 gvr::GvrApi* gvr_api() override; | 155 gvr::GvrApi* gvr_api() override; |
| 156 void SetWebVRRenderSurfaceSize(int width, int height) override; | 156 void SetWebVRRenderSurfaceSize(int width, int height) override; |
| 157 gvr::Sizei GetWebVRCompositorSurfaceSize() override; | 157 gvr::Sizei GetWebVRCompositorSurfaceSize() override; |
| 158 void OnVRVsyncProviderRequest( | 158 void OnVRVsyncProviderRequest( |
| 159 device::mojom::VRVSyncProviderRequest request) override; | 159 device::mojom::VRVSyncProviderRequest request) override; |
| 160 void UpdateVSyncInterval(long timebase_nanos, | 160 void UpdateVSyncInterval(long timebase_nanos, |
| 161 double interval_seconds) override; | 161 double interval_seconds) override; |
| 162 | 162 |
| 163 std::unique_ptr<UiInterface> html_interface_; | 163 std::unique_ptr<UiInterface> html_interface_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 183 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 183 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 184 | 184 |
| 185 DISALLOW_COPY_AND_ASSIGN(VrShell); | 185 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 bool RegisterVrShell(JNIEnv* env); | 188 bool RegisterVrShell(JNIEnv* env); |
| 189 | 189 |
| 190 } // namespace vr_shell | 190 } // namespace vr_shell |
| 191 | 191 |
| 192 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 192 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |