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

Unified Diff: third_party/WebKit/Source/modules/gamepad/Gamepad.cpp

Issue 2300543003: Added Pose attribute to Gamepad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gamepad_touched
Patch Set: Rebase Created 4 years, 3 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
Index: third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
diff --git a/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp b/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
index 26b135aee9faf7242b201e3e3244d263cfd259f9..b0c16b7db7ea6b36fa8cc1a0ba5f4838e9d4deec 100644
--- a/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
+++ b/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
@@ -58,9 +58,24 @@ void Gamepad::setButtons(unsigned count, const WebGamepadButton* data)
}
}
+void Gamepad::setPose(const WebGamepadPose& pose)
+{
+ if (!pose.notNull) {
+ if (m_pose)
+ m_pose = nullptr;
+ return;
+ }
+
+ if (!m_pose)
+ m_pose = GamepadPose::create();
+
+ m_pose->setPose(pose);
+}
+
DEFINE_TRACE(Gamepad)
{
visitor->trace(m_buttons);
+ visitor->trace(m_pose);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/gamepad/Gamepad.h ('k') | third_party/WebKit/Source/modules/gamepad/Gamepad.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698