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

Side by Side Diff: content/browser/vr/android/cardboard/cardboard_vr_device.cc

Issue 1552733002: Convert Pass()→std::move() in //content (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/vr/android/cardboard/cardboard_vr_device.h" 5 #include "content/browser/vr/android/cardboard/cardboard_vr_device.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/android/context_utils.h" 10 #include "base/android/context_utils.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 left_eye->renderRect->y = 0; 111 left_eye->renderRect->y = 0;
112 left_eye->renderRect->width = screen_size[0] / 2.0; 112 left_eye->renderRect->width = screen_size[0] / 2.0;
113 left_eye->renderRect->height = screen_size[1]; 113 left_eye->renderRect->height = screen_size[1];
114 114
115 right_eye->renderRect = VRRect::New(); 115 right_eye->renderRect = VRRect::New();
116 right_eye->renderRect->x = screen_size[0] / 2.0; 116 right_eye->renderRect->x = screen_size[0] / 2.0;
117 right_eye->renderRect->y = 0; 117 right_eye->renderRect->y = 0;
118 right_eye->renderRect->width = screen_size[0] / 2.0; 118 right_eye->renderRect->width = screen_size[0] / 2.0;
119 right_eye->renderRect->height = screen_size[1]; 119 right_eye->renderRect->height = screen_size[1];
120 120
121 return device.Pass(); 121 return device;
122 } 122 }
123 123
124 VRSensorStatePtr CardboardVRDevice::GetSensorState() { 124 VRSensorStatePtr CardboardVRDevice::GetSensorState() {
125 TRACE_EVENT0("input", "CardboardVRDevice::GetSensorState"); 125 TRACE_EVENT0("input", "CardboardVRDevice::GetSensorState");
126 VRSensorStatePtr state = VRSensorState::New(); 126 VRSensorStatePtr state = VRSensorState::New();
127 127
128 state->timestamp = base::Time::Now().ToJsTime(); 128 state->timestamp = base::Time::Now().ToJsTime();
129 state->frameIndex = frame_index_++; 129 state->frameIndex = frame_index_++;
130 130
131 JNIEnv* env = AttachCurrentThread(); 131 JNIEnv* env = AttachCurrentThread();
(...skipping 17 matching lines...) Expand all
149 state->orientation->x = decomposed_transform.quaternion[0]; 149 state->orientation->x = decomposed_transform.quaternion[0];
150 state->orientation->y = decomposed_transform.quaternion[1]; 150 state->orientation->y = decomposed_transform.quaternion[1];
151 state->orientation->z = decomposed_transform.quaternion[2]; 151 state->orientation->z = decomposed_transform.quaternion[2];
152 state->orientation->w = decomposed_transform.quaternion[3]; 152 state->orientation->w = decomposed_transform.quaternion[3];
153 153
154 state->position = VRVector3::New(); 154 state->position = VRVector3::New();
155 state->position->x = decomposed_transform.translate[0]; 155 state->position->x = decomposed_transform.translate[0];
156 state->position->y = decomposed_transform.translate[1]; 156 state->position->y = decomposed_transform.translate[1];
157 state->position->z = decomposed_transform.translate[2]; 157 state->position->z = decomposed_transform.translate[2];
158 158
159 return state.Pass(); 159 return state;
160 } 160 }
161 161
162 void CardboardVRDevice::ResetSensor() { 162 void CardboardVRDevice::ResetSensor() {
163 Java_CardboardVRDevice_resetSensor(AttachCurrentThread(), 163 Java_CardboardVRDevice_resetSensor(AttachCurrentThread(),
164 j_cardboard_device_.obj()); 164 j_cardboard_device_.obj());
165 } 165 }
166 166
167 } // namespace content 167 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | content/browser/vr/vr_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698