1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #include "flutter/lib/ui/window/pointer_data_packet.h" |
6 | |
7 | #include <string.h> |
8 | |
9 | namespace flutter { |
10 | |
11 | PointerDataPacket::PointerDataPacket(size_t count) |
12 | : data_(count * sizeof(PointerData)) {} |
13 | |
14 | PointerDataPacket::PointerDataPacket(uint8_t* data, size_t num_bytes) |
15 | : data_(data, data + num_bytes) {} |
16 | |
17 | PointerDataPacket::~PointerDataPacket() = default; |
18 | |
19 | void PointerDataPacket::SetPointerData(size_t i, const PointerData& data) { |
20 | memcpy(&data_[i * sizeof(PointerData)], &data, sizeof(PointerData)); |
21 | } |
22 | |
23 | } // namespace flutter |
24 |