| Index: chrome/browser/android/vr_shell/vr_shell_gl.h
|
| diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.h b/chrome/browser/android/vr_shell/vr_shell_gl.h
|
| index 45ded1a7faf71c38d20b6aca4832c0c236fe9f09..5d7217894d421c65138402cc336cf9fd0c7d6394 100644
|
| --- a/chrome/browser/android/vr_shell/vr_shell_gl.h
|
| +++ b/chrome/browser/android/vr_shell/vr_shell_gl.h
|
| @@ -13,6 +13,7 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "device/vr/android/gvr/gvr_delegate.h"
|
| +#include "device/vr/vr_service.mojom.h"
|
| #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h"
|
| #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h"
|
| #include "ui/gfx/native_widget_types.h"
|
| @@ -64,8 +65,6 @@ class VrShellGl {
|
| void Initialize();
|
| void InitializeGl(gfx::AcceleratedWidget window);
|
|
|
| - void DrawFrame();
|
| -
|
| void OnTriggerEvent();
|
| void OnPause();
|
| void OnResume();
|
| @@ -85,9 +84,14 @@ class VrShellGl {
|
|
|
| void UpdateScene(std::unique_ptr<base::ListValue> commands);
|
|
|
| + void OnVRVSyncProviderClientConnected(
|
| + device::mojom::VRVSyncProviderClientPtr client_info);
|
| + void UpdateVSyncInterval(long timebase_nanos, double interval_seconds);
|
| +
|
| private:
|
| void GvrInit(gvr_context* gvr_api);
|
| void InitializeRenderer();
|
| + void DrawFrame();
|
| void DrawVrShell(const gvr::Mat4f& head_pose, gvr::Frame &frame);
|
| void DrawUiView(const gvr::Mat4f* head_pose,
|
| const std::vector<const ContentRectangle*>& elements,
|
| @@ -107,12 +111,14 @@ class VrShellGl {
|
| void OnUIFrameAvailable();
|
| void OnContentFrameAvailable();
|
|
|
| - void UpdateVSyncParameters(const base::TimeTicks timebase,
|
| - const base::TimeDelta interval);
|
| void ScheduleNextDrawFrame();
|
|
|
| void ForceExitVr();
|
|
|
| + void OnVSyncAck();
|
| +
|
| + device::mojom::VRPosePtr GetPose();
|
| +
|
| // samplerExternalOES texture data for UI content image.
|
| int ui_texture_id_ = 0;
|
| // samplerExternalOES texture data for main content image.
|
| @@ -161,7 +167,6 @@ class VrShellGl {
|
| // current backlog of poses which is 2-3 frames.
|
| static constexpr int kPoseRingBufferSize = 8;
|
| std::vector<gvr::Mat4f> webvr_head_pose_;
|
| - std::vector<bool> webvr_head_pose_valid_;
|
| int webvr_texture_id_ = 0;
|
| bool web_vr_mode_;
|
| bool ready_to_draw_ = false;
|
| @@ -174,11 +179,19 @@ class VrShellGl {
|
| base::TimeTicks vsync_timebase_;
|
| base::TimeDelta vsync_interval_;
|
|
|
| + bool pending_vsync_ = false;
|
| + double pending_time_;
|
| + bool pending_ack_ = false;
|
| + bool triggered_vsync_from_ack_ = false;
|
| +
|
| base::WeakPtr<VrShell> weak_vr_shell_;
|
| base::WeakPtr<VrInputManager> content_input_manager_;
|
| base::WeakPtr<VrInputManager> ui_input_manager_;
|
| scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
|
|
|
| + device::mojom::VRVSyncProviderClientPtr client_;
|
| + uint32_t pose_index_ = 1;
|
| +
|
| base::WeakPtrFactory<VrShellGl> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(VrShellGl);
|
|
|