Flutter Engine
The Flutter Engine
FlutterStandardCodec_Internal.h
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#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODEC_INTERNAL_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODEC_INTERNAL_H_
7
8#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h"
9#import "flutter/shell/platform/darwin/common/framework/Source/FlutterStandardCodecHelper.h"
10
11namespace flutter {
13 FlutterStandardDataType type) {
14 switch (type) {
15 case FlutterStandardDataTypeUInt8:
17 case FlutterStandardDataTypeInt32:
19 case FlutterStandardDataTypeInt64:
21 case FlutterStandardDataTypeFloat32:
23 case FlutterStandardDataTypeFloat64:
25 }
26}
27FlutterStandardDataType FlutterStandardDataTypeForField(
29 switch (field) {
31 return FlutterStandardDataTypeUInt8;
33 return FlutterStandardDataTypeInt32;
35 return FlutterStandardDataTypeInt64;
37 return FlutterStandardDataTypeFloat32;
39 return FlutterStandardDataTypeFloat64;
40 default:
41 return FlutterStandardDataTypeUInt8;
42 }
43}
44
45UInt8 elementSizeForFlutterStandardDataType(FlutterStandardDataType type) {
46 switch (type) {
47 case FlutterStandardDataTypeUInt8:
48 return 1;
49 case FlutterStandardDataTypeInt32:
50 return 4;
51 case FlutterStandardDataTypeInt64:
52 return 8;
53 case FlutterStandardDataTypeFloat32:
54 return 4;
55 case FlutterStandardDataTypeFloat64:
56 return 8;
57 }
58}
59} // namespace flutter
60
61#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODEC_INTERNAL_H_
@ FlutterStandardFieldUInt8Data
@ FlutterStandardFieldFloat32Data
@ FlutterStandardFieldInt64Data
@ FlutterStandardFieldInt32Data
@ FlutterStandardFieldFloat64Data
GLenum type
FlutterStandardField FlutterStandardFieldForDataType(FlutterStandardDataType type)
FlutterStandardDataType FlutterStandardDataTypeForField(FlutterStandardField field)
UInt8 elementSizeForFlutterStandardDataType(FlutterStandardDataType type)