Flutter Engine
The Flutter Engine
pointer_data.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.h"
6
7#include <cstring>
8
9namespace flutter {
10
11// The number of fields of PointerData.
12//
13// If kPointerDataFieldCount changes, update the corresponding values to:
14//
15// * _kPointerDataFieldCount in platform_dispatcher.dart
16// * POINTER_DATA_FIELD_COUNT in AndroidTouchProcessor.java
17//
18// (This is a centralized list of all locations that should be kept up-to-date.)
19static constexpr int kPointerDataFieldCount = 36;
20static constexpr int kBytesPerField = sizeof(int64_t);
21
22static_assert(sizeof(PointerData) == kBytesPerField * kPointerDataFieldCount,
23 "PointerData has the wrong size");
24
26 memset(this, 0, sizeof(PointerData));
27}
28
29} // namespace flutter
static constexpr int kPointerDataFieldCount
Definition: pointer_data.cc:19
static constexpr int kBytesPerField
Definition: pointer_data.cc:20