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

Side by Side Diff: chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc

Issue 2814443004: Refactor VR math off of GVR types, onto gfx types where possible. (Closed)
Patch Set: Fix tests Created 3 years, 8 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 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h" 5 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr.h" 10 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 void NonPresentingGvrDelegate::CreateVRDisplayInfo( 150 void NonPresentingGvrDelegate::CreateVRDisplayInfo(
151 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, 151 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback,
152 uint32_t device_id) { 152 uint32_t device_id) {
153 if (!gvr_api_) { 153 if (!gvr_api_) {
154 callback.Run(device::mojom::VRDisplayInfoPtr(nullptr)); 154 callback.Run(device::mojom::VRDisplayInfoPtr(nullptr));
155 return; 155 return;
156 } 156 }
157 157
158 gvr::Sizei webvr_size = GvrDelegate::GetRecommendedWebVrSize(gvr_api_.get()); 158 gfx::Size webvr_size = GvrDelegate::GetRecommendedWebVrSize(gvr_api_.get());
159 DVLOG(1) << __FUNCTION__ << ": resize recommended to " << webvr_size.width 159 DVLOG(1) << __FUNCTION__ << ": resize recommended to " << webvr_size.width()
160 << "x" << webvr_size.height; 160 << "x" << webvr_size.height();
161 callback.Run( 161 callback.Run(
162 GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), webvr_size, device_id)); 162 GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), webvr_size, device_id));
163 } 163 }
164 164
165 } // namespace vr_shell 165 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h ('k') | chrome/browser/android/vr_shell/ui_elements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698