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

Side by Side Diff: device/vr/android/gvr/gvr_device.cc

Issue 2544503003: WebVR: fix incorrect renderWidth for the right eye (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "device/vr/android/gvr/gvr_device.h" 5 #include "device/vr/android/gvr/gvr_device.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return device; 96 return device;
97 } 97 }
98 98
99 // In compositor mode, we have to use the current compositor window's 99 // In compositor mode, we have to use the current compositor window's
100 // surface size. Would be nice to change it, but that needs more browser 100 // surface size. Would be nice to change it, but that needs more browser
101 // internals to be modified. TODO(klausw,crbug.com/655722): remove this once 101 // internals to be modified. TODO(klausw,crbug.com/655722): remove this once
102 // we can pick our own surface size. 102 // we can pick our own surface size.
103 gvr::Sizei compositor_size = delegate_->GetWebVRCompositorSurfaceSize(); 103 gvr::Sizei compositor_size = delegate_->GetWebVRCompositorSurfaceSize();
104 left_eye->renderWidth = compositor_size.width / 2; 104 left_eye->renderWidth = compositor_size.width / 2;
105 left_eye->renderHeight = compositor_size.height; 105 left_eye->renderHeight = compositor_size.height;
106 right_eye->renderWidth = left_eye->renderHeight; 106 right_eye->renderWidth = left_eye->renderWidth;
107 right_eye->renderHeight = left_eye->renderHeight; 107 right_eye->renderHeight = left_eye->renderHeight;
108 108
109 std::string vendor = gvr_api->GetViewerVendor(); 109 std::string vendor = gvr_api->GetViewerVendor();
110 std::string model = gvr_api->GetViewerModel(); 110 std::string model = gvr_api->GetViewerModel();
111 device->displayName = vendor + " " + model; 111 device->displayName = vendor + " " + model;
112 112
113 gvr::BufferViewportList gvr_buffer_viewports = 113 gvr::BufferViewportList gvr_buffer_viewports =
114 gvr_api->CreateEmptyBufferViewportList(); 114 gvr_api->CreateEmptyBufferViewportList();
115 gvr_buffer_viewports.SetToRecommendedBufferViewports(); 115 gvr_buffer_viewports.SetToRecommendedBufferViewports();
116 116
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 269
270 gvr::GvrApi* GvrDevice::GetGvrApi() { 270 gvr::GvrApi* GvrDevice::GetGvrApi() {
271 if (!delegate_) 271 if (!delegate_)
272 return nullptr; 272 return nullptr;
273 273
274 return delegate_->gvr_api(); 274 return delegate_->gvr_api();
275 } 275 }
276 276
277 } // namespace device 277 } // namespace device
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698