flutter_flutter/lib/ui/window/pointer_data_packet.cc
Adam Barth 862d9e9f6b Android should use PointerDataPackets (#3092)
We now use JNI rather than Mojo to transport pointer data from Java to Dart.
Also, fill in a few more of the pointer data fields from information in Java.
2016-10-03 21:02:46 -07:00

24 lines
689 B
C++

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/lib/ui/window/pointer_data_packet.h"
#include <string.h>
namespace blink {
PointerDataPacket::PointerDataPacket(size_t count)
: data_(count * sizeof(PointerData)) {}
PointerDataPacket::PointerDataPacket(char* data, size_t num_bytes)
: data_(data, data + num_bytes) {}
PointerDataPacket::~PointerDataPacket() = default;
void PointerDataPacket::SetPointerData(size_t i, const PointerData& data) {
memcpy(&data_[i * sizeof(PointerData)], &data, sizeof(PointerData));
}
} // namespace blink