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

Side by Side Diff: content/browser/device_sensors/data_fetcher_shared_memory_win.cc

Issue 1991773002: [Win] deviceorientation: fix euler angles order. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/device_sensors/data_fetcher_shared_memory.h" 5 #include "content/browser/device_sensors/data_fetcher_shared_memory.h"
6 6
7 #include <GuidDef.h> 7 #include <GuidDef.h>
8 #include <InitGuid.h> 8 #include <InitGuid.h>
9 #include <PortableDeviceTypes.h> 9 #include <PortableDeviceTypes.h>
10 #include <Sensors.h> 10 #include <Sensors.h>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 explicit SensorEventSinkOrientation( 107 explicit SensorEventSinkOrientation(
108 DeviceOrientationHardwareBuffer* const buffer) : buffer_(buffer) {} 108 DeviceOrientationHardwareBuffer* const buffer) : buffer_(buffer) {}
109 ~SensorEventSinkOrientation() override {} 109 ~SensorEventSinkOrientation() override {}
110 110
111 protected: 111 protected:
112 bool UpdateSharedMemoryBuffer( 112 bool UpdateSharedMemoryBuffer(
113 ISensor* sensor, ISensorDataReport* new_data) override { 113 ISensor* sensor, ISensorDataReport* new_data) override {
114 double alpha, beta, gamma; 114 double alpha, beta, gamma;
115 bool has_alpha, has_beta, has_gamma; 115 bool has_alpha, has_beta, has_gamma;
116 116
117 GetSensorValue(SENSOR_DATA_TYPE_TILT_X_DEGREES, new_data, &alpha, 117 GetSensorValue(SENSOR_DATA_TYPE_TILT_X_DEGREES, new_data, &beta,
118 &has_beta);
119 GetSensorValue(SENSOR_DATA_TYPE_TILT_Y_DEGREES, new_data, &gamma,
120 &has_gamma);
121 GetSensorValue(SENSOR_DATA_TYPE_TILT_Z_DEGREES, new_data, &alpha,
118 &has_alpha); 122 &has_alpha);
119 GetSensorValue(SENSOR_DATA_TYPE_TILT_Y_DEGREES, new_data, &beta,
120 &has_beta);
121 GetSensorValue(SENSOR_DATA_TYPE_TILT_Z_DEGREES, new_data, &gamma,
122 &has_gamma);
123 123
124 if (buffer_) { 124 if (buffer_) {
125 buffer_->seqlock.WriteBegin(); 125 buffer_->seqlock.WriteBegin();
126 buffer_->data.alpha = alpha; 126 buffer_->data.alpha = alpha;
127 buffer_->data.hasAlpha = has_alpha; 127 buffer_->data.hasAlpha = has_alpha;
128 buffer_->data.beta = beta; 128 buffer_->data.beta = beta;
129 buffer_->data.hasBeta = has_beta; 129 buffer_->data.hasBeta = has_beta;
130 buffer_->data.gamma = gamma; 130 buffer_->data.gamma = gamma;
131 buffer_->data.hasGamma = has_gamma; 131 buffer_->data.hasGamma = has_gamma;
132 buffer_->data.absolute = has_alpha || has_beta || has_gamma; 132 buffer_->data.absolute = has_alpha || has_beta || has_gamma;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 motion_buffer_->data.allAvailableSensorsAreActive = enabled; 465 motion_buffer_->data.allAvailableSensorsAreActive = enabled;
466 motion_buffer_->seqlock.WriteEnd(); 466 motion_buffer_->seqlock.WriteEnd();
467 } 467 }
468 break; 468 break;
469 default: 469 default:
470 NOTREACHED(); 470 NOTREACHED();
471 } 471 }
472 } 472 }
473 473
474 } // namespace content 474 } // namespace content
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