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

Unified Diff: trunk/public/platform/WebGamepad.h

Issue 171423019: Revert 167539 "Updating Blink-side Gamepad API to match latest spec" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 10 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 | « trunk/Source/modules/modules.gypi ('k') | trunk/public/platform/WebGamepads.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/public/platform/WebGamepad.h
===================================================================
--- trunk/public/platform/WebGamepad.h (revision 167540)
+++ trunk/public/platform/WebGamepad.h (working copy)
@@ -34,29 +34,12 @@
#pragma pack(push, 1)
-class WebGamepadButton {
-public:
- WebGamepadButton()
- : pressed(false)
- , value(0.f)
- {
- }
- WebGamepadButton(bool pressed, float value)
- : pressed(pressed)
- , value(value)
- {
- }
- bool pressed;
- float value;
-};
-
// This structure is intentionally POD and fixed size so that it can be shared
// memory between hardware polling threads and the rest of the browser. See
// also WebGamepads.h.
class WebGamepad {
public:
static const size_t idLengthCap = 128;
- static const size_t mappingLengthCap = 16;
static const size_t axesLengthCap = 16;
static const size_t buttonsLengthCap = 32;
@@ -67,7 +50,6 @@
, buttonsLength(0)
{
id[0] = 0;
- mapping[0] = 0;
}
// Is there a gamepad connected at this index?
@@ -89,15 +71,12 @@
// Number of valid entries in the buttons array.
unsigned buttonsLength;
- // Button states
- WebGamepadButton buttons[buttonsLengthCap];
-
- // Mapping type (for example "standard")
- WebUChar mapping[mappingLengthCap];
+ // Normalized values representing buttons, in the range [0..1].
+ float buttons[buttonsLengthCap];
};
#if BLINK_IMPLEMENTATION
-COMPILE_ASSERT(sizeof(WebGamepad) == 529, WebGamepad_has_wrong_size);
+COMPILE_ASSERT(sizeof(WebGamepad) == 465, WebGamepad_has_wrong_size);
#endif
#pragma pack(pop)
« no previous file with comments | « trunk/Source/modules/modules.gypi ('k') | trunk/public/platform/WebGamepads.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698