Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
pointer_data_packet.cc
Go to the documentation of this file.
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#include "flutter/fml/logging.h"
7
8#include <cstring>
9
10namespace flutter {
11
14
15PointerDataPacket::PointerDataPacket(uint8_t* data, size_t num_bytes)
16 : data_(data, data + num_bytes) {}
17
19
21 FML_DCHECK(i < GetLength());
22 memcpy(&data_[i * sizeof(PointerData)], &data, sizeof(PointerData));
23}
24
26 FML_DCHECK(i < GetLength());
28 memcpy(&result, &data_[i * sizeof(PointerData)], sizeof(PointerData));
29 return result;
30}
31
33 return data_.size() / sizeof(PointerData);
34}
35
36} // namespace flutter
int count
PointerData GetPointerData(size_t i) const
const std::vector< uint8_t > & data() const
void SetPointerData(size_t i, const PointerData &data)
GAsyncResult * result
#define FML_DCHECK(condition)
Definition logging.h:103
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41