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

Unified Diff: Source/modules/gamepad/GamepadCommon.cpp

Issue 280393004: Update Gamepad.axes / GamepadButton.value to match the latest specification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add back #ifdefs Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/gamepad/GamepadCommon.h ('k') | public/platform/WebGamepad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/GamepadCommon.cpp
diff --git a/Source/modules/gamepad/GamepadCommon.cpp b/Source/modules/gamepad/GamepadCommon.cpp
index bab5498cce811152f829b12ba94ade8b99e8e00c..264c6b7da0f202f1b40fd6021c80eb1adad9e10f 100644
--- a/Source/modules/gamepad/GamepadCommon.cpp
+++ b/Source/modules/gamepad/GamepadCommon.cpp
@@ -38,11 +38,20 @@ GamepadCommon::~GamepadCommon()
{
}
-void GamepadCommon::setAxes(unsigned count, const float* data)
+#if defined(ENABLE_NEW_GAMEPAD_API)
+void GamepadCommon::setAxes(unsigned count, const double* data)
{
m_axes.resize(count);
if (count)
std::copy(data, data + count, m_axes.begin());
}
+#else
+void GamepadCommon::setAxes(unsigned count, const float* data)
+{
+ m_axes.resize(count);
+ for (unsigned i = 0; i < count; ++i)
+ m_axes[i] = data[i];
+}
+#endif
} // namespace WebCore
« no previous file with comments | « Source/modules/gamepad/GamepadCommon.h ('k') | public/platform/WebGamepad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698