Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
formats.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_LIB_GPU_FORMATS_H_
6#define FLUTTER_LIB_GPU_FORMATS_H_
7
8#include "fml/logging.h"
11
12// ATTENTION! ATTENTION! ATTENTION!
13// All enums defined in this file must exactly match the contents and order of
14// the corresponding enums defined in `gpu/lib/src/formats.dart`.
15
16namespace flutter {
17namespace gpu {
18
24
36
40
76
78 kBC,
79 kETC2,
80 kASTC,
82};
83
97
103
105 FlutterGPUPixelFormat value) {
106 switch (value) {
169 }
170}
171
175
177 impeller::PixelFormat value) {
178 switch (value) {
204 // Apple-only extended-range formats, not exposed by the Flutter GPU API.
246 }
247}
248
266
268 FlutterGPUBlendFactor value) {
269 switch (value) {
300 }
301}
302
306
308 kAdd,
309 kSubtract,
311};
312
324
328
330 kDontCare,
331 kLoad,
332 kClear,
333};
334
346
348 return ToImpellerLoadAction(static_cast<FlutterGPULoadAction>(value));
349}
350
357
371
375
377 kVertex,
378 kFragment,
379};
380
390
394
396 impeller::ShaderStage value) {
397 switch (value) {
404 FML_LOG(FATAL) << "Invalid Flutter GPU ShaderStage "
405 << static_cast<size_t>(value);
407 }
408}
409
411 kNearest,
412 kLinear,
413};
414
424
428
430 kNearest,
431 kLinear,
432};
433
442
444 return ToImpellerMipFilter(static_cast<FlutterGPUMipFilter>(value));
445}
446
452
464
469
471 k16bit,
472 k32bit,
473};
474
483
485 return ToImpellerIndexType(static_cast<FlutterGPUIndexType>(value));
486}
487
489 kTriangle,
491 kLine,
493 kPoint,
494};
495
511
515
517 kNever,
518 kAlways,
519 kLess,
520 kEqual,
522 kGreater,
523 kNotEqual,
525};
526
548
553
564
586
591
593 kNone,
595 kBackFace,
596};
597
608
610 return ToImpellerCullMode(static_cast<FlutterGPUCullMode>(value));
611}
612
617
627
631
633 kFill,
634 kLine,
635};
636
646
650
651} // namespace gpu
652} // namespace flutter
653
654#endif // FLUTTER_LIB_GPU_FORMATS_H_
int32_t value
#define FML_LOG(severity)
Definition logging.h:101
#define FML_UNREACHABLE()
Definition logging.h:128
FlutterGPUShaderStage
Definition formats.h:376
FlutterGPUPixelFormat
Definition formats.h:41
FlutterGPUWindingOrder
Definition formats.h:613
constexpr impeller::PixelFormat ToImpellerPixelFormat(FlutterGPUPixelFormat value)
Definition formats.h:104
FlutterGPUTextureCompressionFamily
Definition formats.h:77
FlutterGPUCompareFunction
Definition formats.h:516
FlutterGPUStorageMode
Definition formats.h:19
FlutterGPUBlendOperation
Definition formats.h:307
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:267
FlutterGPUMinMagFilter
Definition formats.h:410
constexpr FlutterGPUShaderStage FromImpellerShaderStage(impeller::ShaderStage value)
Definition formats.h:395
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:313
FlutterGPUBlendFactor
Definition formats.h:249
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:453
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:434
constexpr FlutterGPUPixelFormat FromImpellerPixelFormat(impeller::PixelFormat value)
Definition formats.h:176
FlutterGPUSamplerAddressMode
Definition formats.h:447
FlutterGPUStencilOperation
Definition formats.h:554
FlutterGPUPolygonMode
Definition formats.h:632
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:618
constexpr impeller::CompressedTextureFamily ToImpellerCompressedTextureFamily(FlutterGPUTextureCompressionFamily value)
Definition formats.h:84
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:527
constexpr impeller::ShaderStage ToImpellerShaderStage(FlutterGPUShaderStage value)
Definition formats.h:381
FlutterGPUPrimitiveType
Definition formats.h:488
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:335
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:358
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:637
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:475
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:565
FlutterGPUStoreAction
Definition formats.h:351
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:496
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:598
constexpr impeller::StorageMode ToImpellerStorageMode(FlutterGPUStorageMode value)
Definition formats.h:25
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:415
PrimitiveType
Decides how backend draws pixels based on input vertices.
Definition formats.h:529
@ kPoint
Draws a point at each input vertex.
SamplerAddressMode
Definition formats.h:618
StorageMode
Specified where the allocation resides and how it is used.
Definition formats.h:32
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition formats.h:99
CompareFunction
Definition formats.h:804
@ kEqual
Comparison test passes if new_value == current_value.
@ kLessEqual
Comparison test passes if new_value <= current_value.
@ kGreaterEqual
Comparison test passes if new_value >= current_value.
@ kAlways
Comparison test passes always passes.
@ kLess
Comparison test passes if new_value < current_value.
@ kGreater
Comparison test passes if new_value > current_value.
@ kNotEqual
Comparison test passes if new_value != current_value.
@ kNever
Comparison test never passes.
MipFilter
Options for selecting and filtering between mipmap levels.
Definition formats.h:602
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.
@ kNearest
The nearst mipmap level is selected.
StencilOperation
Definition formats.h:823
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
@ kSetToReferenceValue
Reset the stencil value to the reference value.
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
@ kZero
Reset the stencil value to zero.
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
@ kInvert
Perform a logical bitwise invert on the current stencil value.
@ kKeep
Don't modify the current stencil value.
CompressedTextureFamily
The family of a block-compressed pixel format. GPUs support compressed formats on a per-family basis,...
Definition formats.h:146
@ kASTCHDR
ASTC HDR. A separate device feature from ASTC LDR.
@ kBC
S3TC, RGTC, and BPTC (BC1 through BC7). Desktop GPUs.
@ kETC2
ETC2 and EAC. Mobile, OpenGL ES 3.0, and WebGL2.
@ kASTC
ASTC LDR. Modern mobile and some desktop.
WindingOrder
Definition formats.h:22
MinMagFilter
Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (...
Definition formats.h:592
@ kNearest
Select nearest to the sample point. Most widely supported.
BlendOperation
Definition formats.h:384