Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_gl.h

Issue 2773903003: Add way to get native VR UI information from Java (Closed)
Patch Set: Cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/cancelable_callback.h" 13 #include "base/cancelable_callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
18 #include "base/values.h"
18 #include "device/vr/android/gvr/gvr_delegate.h" 19 #include "device/vr/android/gvr/gvr_delegate.h"
19 #include "device/vr/vr_service.mojom.h" 20 #include "device/vr/vr_service.mojom.h"
20 #include "mojo/public/cpp/bindings/binding.h" 21 #include "mojo/public/cpp/bindings/binding.h"
21 #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.h"
22 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" 23 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h"
23 #include "ui/gfx/native_widget_types.h" 24 #include "ui/gfx/native_widget_types.h"
24 25
25 namespace base { 26 namespace base {
26 class ListValue; 27 class ListValue;
27 } 28 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void UpdateVSyncInterval(int64_t timebase_nanos, double interval_seconds); 102 void UpdateVSyncInterval(int64_t timebase_nanos, double interval_seconds);
102 103
103 void OnRequest(device::mojom::VRVSyncProviderRequest request); 104 void OnRequest(device::mojom::VRVSyncProviderRequest request);
104 void ResetPose(); 105 void ResetPose();
105 void CreateVRDisplayInfo( 106 void CreateVRDisplayInfo(
106 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, 107 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback,
107 uint32_t device_id); 108 uint32_t device_id);
108 void SubmitWebVRFrame(int16_t frame_index, const gpu::MailboxHolder& mailbox); 109 void SubmitWebVRFrame(int16_t frame_index, const gpu::MailboxHolder& mailbox);
109 void SetSubmitClient( 110 void SetSubmitClient(
110 device::mojom::VRSubmitFrameClientPtrInfo submit_client_info); 111 device::mojom::VRSubmitFrameClientPtrInfo submit_client_info);
112 void CreateUiElementInfos(
113 std::vector<int> element_ids,
114 int callback_id,
115 const base::Callback<void(int, std::unique_ptr<base::DictionaryValue>)>
116 onCreated);
111 117
112 private: 118 private:
113 void GvrInit(gvr_context* gvr_api); 119 void GvrInit(gvr_context* gvr_api);
114 void InitializeRenderer(); 120 void InitializeRenderer();
115 void DrawFrame(int16_t frame_index); 121 void DrawFrame(int16_t frame_index);
116 void DrawWorldElements(const gvr::Mat4f& head_pose); 122 void DrawWorldElements(const gvr::Mat4f& head_pose);
117 void DrawHeadLockedElements(); 123 void DrawHeadLockedElements();
118 void DrawUiView(const gvr::Mat4f& head_pose, 124 void DrawUiView(const gvr::Mat4f& head_pose,
119 const std::vector<const ContentRectangle*>& elements, 125 const std::vector<const ContentRectangle*>& elements,
120 const gvr::Sizei& render_size, 126 const gvr::Sizei& render_size,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 gvr::Vec3f controller_start_direction_; 244 gvr::Vec3f controller_start_direction_;
239 245
240 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; 246 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_;
241 247
242 DISALLOW_COPY_AND_ASSIGN(VrShellGl); 248 DISALLOW_COPY_AND_ASSIGN(VrShellGl);
243 }; 249 };
244 250
245 } // namespace vr_shell 251 } // namespace vr_shell
246 252
247 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ 253 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698