зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1375816 - Part 2: DisplayId support in GamepadManager; r=Lenzak
MozReview-Commit-ID: 1zrePACFQWf --HG-- extra : rebase_source : d8038e116435073e59f475f33cbffe0509670ddd
This commit is contained in:
Родитель
08d93aa476
Коммит
4f401fdabb
|
@ -226,6 +226,7 @@ GamepadManager::AddGamepad(uint32_t aIndex,
|
|||
GamepadMappingType aMapping,
|
||||
GamepadHand aHand,
|
||||
GamepadServiceType aServiceType,
|
||||
uint32_t aDisplayID,
|
||||
uint32_t aNumButtons,
|
||||
uint32_t aNumAxes,
|
||||
uint32_t aNumHaptics)
|
||||
|
@ -240,6 +241,7 @@ GamepadManager::AddGamepad(uint32_t aIndex,
|
|||
newIndex,
|
||||
aMapping,
|
||||
aHand,
|
||||
aDisplayID,
|
||||
aNumButtons,
|
||||
aNumAxes,
|
||||
aNumHaptics);
|
||||
|
@ -509,6 +511,7 @@ GamepadManager::Update(const GamepadChangeEvent& aEvent)
|
|||
static_cast<GamepadMappingType>(a.mapping()),
|
||||
static_cast<GamepadHand>(a.hand()),
|
||||
a.service_type(),
|
||||
a.display_id(),
|
||||
a.num_buttons(), a.num_axes(),
|
||||
a.num_haptics());
|
||||
return;
|
||||
|
|
|
@ -51,7 +51,7 @@ class GamepadManager final : public nsIObserver,
|
|||
|
||||
// Add a gamepad to the list of known gamepads.
|
||||
void AddGamepad(uint32_t aIndex, const nsAString& aID, GamepadMappingType aMapping,
|
||||
GamepadHand aHand, GamepadServiceType aServiceType,
|
||||
GamepadHand aHand, GamepadServiceType aServiceType, uint32_t aDisplayID,
|
||||
uint32_t aNumButtons, uint32_t aNumAxes, uint32_t aNumHaptics);
|
||||
|
||||
// Remove the gamepad at |aIndex| from the list of known gamepads.
|
||||
|
|
|
@ -96,9 +96,10 @@ GamepadPlatformService::AddGamepad(const char* aID,
|
|||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
uint32_t index = ++mGamepadIndex;
|
||||
// Only VR controllers has displayID, we give 0 to the general gamepads.
|
||||
GamepadAdded a(NS_ConvertUTF8toUTF16(nsDependentCString(aID)), index,
|
||||
aMapping, aHand, GamepadServiceType::Standard,
|
||||
aNumButtons, aNumAxes, aHaptics);
|
||||
0, aNumButtons, aNumAxes, aHaptics);
|
||||
|
||||
NotifyGamepadChange<GamepadAdded>(a);
|
||||
return index;
|
||||
|
|
|
@ -123,9 +123,10 @@ GamepadServiceTest::AddGamepad(const nsAString& aID,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// Only VR controllers has displayID, we give 0 to the general gamepads.
|
||||
GamepadAdded a(nsString(aID), 0,
|
||||
aMapping, aHand,
|
||||
GamepadServiceType::Standard,
|
||||
GamepadServiceType::Standard, 0,
|
||||
aNumButtons, aNumAxes, aNumHaptics);
|
||||
GamepadChangeEvent e(a);
|
||||
nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
|
||||
|
|
|
@ -17,6 +17,7 @@ struct GamepadAdded {
|
|||
GamepadMappingType mapping;
|
||||
GamepadHand hand;
|
||||
GamepadServiceType service_type;
|
||||
uint32_t display_id;
|
||||
uint32_t num_buttons;
|
||||
uint32_t num_axes;
|
||||
uint32_t num_haptics;
|
||||
|
|
Загрузка…
Ссылка в новой задаче