Chromium Code Reviews| 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_GL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | |
| 10 #include <utility> | 11 #include <utility> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/cancelable_callback.h" | 14 #include "base/cancelable_callback.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 17 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 19 #include "base/values.h" | |
| 18 #include "device/vr/android/gvr/gvr_delegate.h" | 20 #include "device/vr/android/gvr/gvr_delegate.h" |
| 19 #include "device/vr/vr_service.mojom.h" | 21 #include "device/vr/vr_service.mojom.h" |
| 20 #include "mojo/public/cpp/bindings/binding.h" | 22 #include "mojo/public/cpp/bindings/binding.h" |
| 21 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr.h" | 23 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr.h" |
| 22 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" | 24 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" |
| 23 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
| 24 | 26 |
| 25 namespace base { | 27 namespace base { |
| 26 class ListValue; | 28 class ListValue; |
| 27 } | 29 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 void UpdateVSyncInterval(int64_t timebase_nanos, double interval_seconds); | 103 void UpdateVSyncInterval(int64_t timebase_nanos, double interval_seconds); |
| 102 | 104 |
| 103 void OnRequest(device::mojom::VRVSyncProviderRequest request); | 105 void OnRequest(device::mojom::VRVSyncProviderRequest request); |
| 104 void ResetPose(); | 106 void ResetPose(); |
| 105 void CreateVRDisplayInfo( | 107 void CreateVRDisplayInfo( |
| 106 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, | 108 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, |
| 107 uint32_t device_id); | 109 uint32_t device_id); |
| 108 void SubmitWebVRFrame(int16_t frame_index, const gpu::MailboxHolder& mailbox); | 110 void SubmitWebVRFrame(int16_t frame_index, const gpu::MailboxHolder& mailbox); |
| 109 void SetSubmitClient( | 111 void SetSubmitClient( |
| 110 device::mojom::VRSubmitFrameClientPtrInfo submit_client_info); | 112 device::mojom::VRSubmitFrameClientPtrInfo submit_client_info); |
| 113 void CreateUiElementInfos( | |
| 114 std::vector<std::string> element_names, | |
|
cjgrant
2017/03/29 21:16:06
const std::vector<std::string>&... Again, avoid t
bsheedy
2017/03/29 22:33:45
Done.
| |
| 115 int callback_id, | |
| 116 const base::Callback<void(int, std::unique_ptr<base::DictionaryValue>)> | |
| 117 on_created); | |
| 111 | 118 |
| 112 private: | 119 private: |
| 113 void GvrInit(gvr_context* gvr_api); | 120 void GvrInit(gvr_context* gvr_api); |
| 114 void InitializeRenderer(); | 121 void InitializeRenderer(); |
| 115 void DrawFrame(int16_t frame_index); | 122 void DrawFrame(int16_t frame_index); |
| 116 void DrawWorldElements(const gvr::Mat4f& head_pose); | 123 void DrawWorldElements(const gvr::Mat4f& head_pose); |
| 117 void DrawHeadLockedElements(); | 124 void DrawHeadLockedElements(); |
| 118 void DrawUiView(const gvr::Mat4f& head_pose, | 125 void DrawUiView(const gvr::Mat4f& head_pose, |
| 119 const std::vector<const ContentRectangle*>& elements, | 126 const std::vector<const ContentRectangle*>& elements, |
| 120 const gvr::Sizei& render_size, | 127 const gvr::Sizei& render_size, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 gvr::Vec3f controller_start_direction_; | 245 gvr::Vec3f controller_start_direction_; |
| 239 | 246 |
| 240 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 247 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 241 | 248 |
| 242 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 249 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 243 }; | 250 }; |
| 244 | 251 |
| 245 } // namespace vr_shell | 252 } // namespace vr_shell |
| 246 | 253 |
| 247 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 254 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |