提交 c2ed9a10 编写于 作者: C Chinmay Garde

Make `unregisterTouch` return the identifier of the removed touch

上级 edf0f337
......@@ -70,10 +70,11 @@ class TouchMapper {
return freeSpot;
}
void unregisterTouch(uintptr_t touch) {
int unregisterTouch(uintptr_t touch) {
auto index = touch_map_[touch];
free_spots_ |= 1 << (index - 1);
touch_map_.erase(touch);
return index;
}
int identifierOf(uintptr_t touch) { return touch_map_[touch]; }
......@@ -281,8 +282,7 @@ static std::string SkPictureTracingPath() {
touch_identifier = _touch_mapper.registerTouch(touch_ptr);
break;
case Removed:
touch_identifier = _touch_mapper.identifierOf(touch_ptr);
_touch_mapper.unregisterTouch(touch_ptr);
touch_identifier = _touch_mapper.unregisterTouch(touch_ptr);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册