Commit 8f095c11 authored by ch.dumez@samsung.com's avatar ch.dumez@samsung.com

Turn on ENABLE_NEW_GAMEPAD_API flag so that the new gamepad code is used

Turn on ENABLE_NEW_GAMEPAD_API flag so that the new gamepad code is used.
Also remove the old code on Chromium side. The ENABLE_NEW_GAMEPAD_API is only
needed until the Blink side #ifdefs are removed.

BUG=344556

Review URL: https://codereview.chromium.org/289423004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272723 0039d316-1c4b-4281-b951-d872f2087c98
parent ba6498b0
......@@ -2276,6 +2276,11 @@
# Targets are by default not nacl untrusted code.
'nacl_untrusted_build%': 0,
# Enable a new Gamepad interface.
# TODO(cdumez): This is temporary and should go away once the chromium
# and blink interfaces are in sync, http://crbug.com/344556.
'enable_new_gamepad_api%': 1,
'pnacl_compile_flags': [
# pnacl uses the clang compiler so we need to suppress all the
# same warnings as we do for clang.
......@@ -2445,6 +2450,9 @@
['enable_hidpi==1', {
'defines': ['ENABLE_HIDPI=1'],
}],
['enable_new_gamepad_api==1', {
'defines': ['ENABLE_NEW_GAMEPAD_API=1'],
}],
['native_discardable_memory==1', {
'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'],
}],
......
......@@ -9,7 +9,6 @@
#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 {
......@@ -18,17 +17,9 @@ 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;
buttonValueType value;
double value;
};
// This must match the definition of blink::Gamepad. The GamepadHost unit test
......@@ -53,7 +44,7 @@ struct WebKitGamepad {
unsigned axes_length;
// Normalized values representing axes, in the range [-1..1].
axisValueType axes[kAxesLengthCap];
double axes[kAxesLengthCap];
// Number of valid entries in the buttons array.
unsigned buttons_length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment