Skip to content

Commit

Permalink
Merge pull request #78 from tworaz/for_upstream/unnecessary_event_copy
Browse files Browse the repository at this point in the history
[embedlite] Don't create unnecessary copy of MultiTouchInput event.
  • Loading branch information
tmeshkova committed Jul 16, 2015
2 parents 486f041 + 16d5211 commit 7106bbe
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseParent.cpp
Expand Up @@ -460,17 +460,10 @@ EmbedLiteViewBaseParent::ReceiveInputEvent(const mozilla::InputData& aEvent)
mController->ReceiveInputEvent(const_cast<mozilla::InputData&>(aEvent), &guid, &outInputBlockId);
if (aEvent.mInputType == MULTITOUCH_INPUT) {
const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput();
MultiTouchInput translatedEvent(multiTouchInput.mType, multiTouchInput.mTime, TimeStamp(), multiTouchInput.modifiers);
for (uint32_t i = 0; i < multiTouchInput.mTouches.Length(); ++i) {
const SingleTouchData& data = multiTouchInput.mTouches[i];
SingleTouchData newData = multiTouchInput.mTouches[i];
newData.mScreenPoint = data.mScreenPoint;
translatedEvent.mTouches.AppendElement(newData);
}
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_MOVE) {
unused << SendInputDataTouchMoveEvent(guid, translatedEvent, outInputBlockId);
unused << SendInputDataTouchMoveEvent(guid, multiTouchInput, outInputBlockId);
} else {
unused << SendInputDataTouchEvent(guid, translatedEvent, outInputBlockId);
unused << SendInputDataTouchEvent(guid, multiTouchInput, outInputBlockId);
}
}
}
Expand Down

0 comments on commit 7106bbe

Please sign in to comment.