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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2624633002: Remove Sync GetPose VRService call, implement VRVSyncProvider (Closed)
Patch Set: Address comments Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/vr_shell.h
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h
index ed30c1d3f14a9dd171046e76fa410ed0fc0228fa..8dddcd24282bdc0da0f09b6078804806ab15de29 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -16,6 +16,7 @@
#include "base/single_thread_task_runner.h"
#include "content/public/browser/web_contents_observer.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"
@@ -94,22 +95,9 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
static base::WeakPtr<VrShell> GetWeakPtr(
const content::WebContents* web_contents);
- // TODO(mthiesse): Clean up threading around UiInterface.
UiInterface* GetUiInterface();
void OnDomContentsLoaded();
- // device::GvrDelegate implementation
- // TODO(mthiesse): Clean up threading around GVR API. These functions are
- // called on the UI thread, but use GL thread objects in a non-threadsafe way.
- void SetWebVRSecureOrigin(bool secure_origin) override;
- void SubmitWebVRFrame() override;
- void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds,
- const gvr::Rectf& right_bounds) override;
- gvr::GvrApi* gvr_api() override;
- void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override;
- void SetWebVRRenderSurfaceSize(int width, int height) override;
- gvr::Sizei GetWebVRCompositorSurfaceSize() override;
-
void SurfacesChanged(jobject content_surface, jobject ui_surface);
void GvrDelegateReady();
void AppButtonPressed();
@@ -136,17 +124,33 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
void ForceExitVr();
+ static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat,
+ uint32_t pose_index);
+
private:
- ~VrShell() override;
+ virtual ~VrShell();
void SetShowingOverscrollGlow(bool showing_glow);
void PostToGlThreadWhenReady(const base::Closure& task);
- // content::WebContentsObserver implementation. All called on UI thread.
+ // content::WebContentsObserver implementation.
void RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) override;
void MainFrameWasResized(bool width_changed) override;
void WebContentsDestroyed() override;
+ // device::GvrDelegate implementation
+ void SetWebVRSecureOrigin(bool secure_origin) override;
+ void SubmitWebVRFrame() override;
+ void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds,
+ const gvr::Rectf& right_bounds) override;
+ gvr::GvrApi* gvr_api() override;
+ void SetWebVRRenderSurfaceSize(int width, int height) override;
+ gvr::Sizei GetWebVRCompositorSurfaceSize() override;
+ void OnVRVsyncProviderRequest(
+ device::mojom::VRVSyncProviderRequest request) override;
+ void UpdateVSyncInterval(long timebase_nanos,
+ double interval_seconds) override;
+
std::unique_ptr<UiInterface> html_interface_;
content::WebContents* main_contents_;

Powered by Google App Engine
This is Rietveld 408576698