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

Unified Diff: ppapi/shared_impl/ppb_gamepad_shared.h

Issue 280713004: Update Gamepad API to match the latest specification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Apply comments 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 | « no previous file | ppapi/shared_impl/ppb_gamepad_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_gamepad_shared.h
diff --git a/ppapi/shared_impl/ppb_gamepad_shared.h b/ppapi/shared_impl/ppb_gamepad_shared.h
index c6f535d3d14ecb97f9455624f3a468afc66104f2..6c21d9a3f2d98265fb7762708ab03f235c9bf1e4 100644
--- a/ppapi/shared_impl/ppb_gamepad_shared.h
+++ b/ppapi/shared_impl/ppb_gamepad_shared.h
@@ -9,6 +9,7 @@
#include "base/strings/string16.h"
#include "ppapi/c/ppb_gamepad.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
+#include "third_party/WebKit/public/platform/WebGamepads.h"
namespace ppapi {
@@ -17,9 +18,17 @@ namespace ppapi {
#pragma pack(push, 1)
+#if defined(ENABLE_NEW_GAMEPAD_API)
+ typedef double buttonValueType;
+ typedef double axisValueType;
+#else
+ typedef float buttonValueType;
+ typedef float axisValueType;
+#endif
+
struct WebKitGamepadButton {
bool pressed;
- float value;
+ buttonValueType value;
};
// This must match the definition of blink::Gamepad. The GamepadHost unit test
@@ -44,7 +53,7 @@ struct WebKitGamepad {
unsigned axes_length;
// Normalized values representing axes, in the range [-1..1].
- float axes[kAxesLengthCap];
+ axisValueType axes[kAxesLengthCap];
// Number of valid entries in the buttons array.
unsigned buttons_length;
« no previous file with comments | « no previous file | ppapi/shared_impl/ppb_gamepad_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698