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
52
88
90 kBC,
91 kETC2,
92 kASTC,
94};
95
109
115
117 FlutterGPUPixelFormat value) {
118 switch (value) {
181 }
182}
183
187
189 impeller::PixelFormat value) {
190 switch (value) {
216 // Apple-only extended-range formats, not exposed by the Flutter GPU API.
258 }
259}
260
278
280 FlutterGPUBlendFactor value) {
281 switch (value) {
312 }
313}
314
318
320 kAdd,
321 kSubtract,
323};
324
336
340
342 kDontCare,
343 kLoad,
344 kClear,
345};
346
358
360 return ToImpellerLoadAction(static_cast<FlutterGPULoadAction>(value));
361}
362
369
383
387
389 kVertex,
390 kFragment,
391};
392
402
406
408 impeller::ShaderStage value) {
409 switch (value) {
416 FML_LOG(FATAL) << "Invalid Flutter GPU ShaderStage "
417 << static_cast<size_t>(value);
419 }
420}
421
423 kNearest,
424 kLinear,
425};
426
436
440
442 kNearest,
443 kLinear,
444};
445
454
456 return ToImpellerMipFilter(static_cast<FlutterGPUMipFilter>(value));
457}
458
464
476
481
483 k16bit,
484 k32bit,
485};
486
495
497 return ToImpellerIndexType(static_cast<FlutterGPUIndexType>(value));
498}
499
501 kTriangle,
503 kLine,
505 kPoint,
506};
507
523
527
529 kNever,
530 kAlways,
531 kLess,
532 kEqual,
534 kGreater,
535 kNotEqual,
537};
538
560
565
576
598
603
605 kNone,
607 kBackFace,
608};
609
620
622 return ToImpellerCullMode(static_cast<FlutterGPUCullMode>(value));
623}
624
629
639
643
645 kFill,
646 kLine,
647};
648
658
662
663} // namespace gpu
664} // namespace flutter
665
666#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:388
FlutterGPUPixelFormat
Definition formats.h:53
FlutterGPUWindingOrder
Definition formats.h:625
constexpr impeller::PixelFormat ToImpellerPixelFormat(FlutterGPUPixelFormat value)
Definition formats.h:116
FlutterGPUTextureCompressionFamily
Definition formats.h:89
FlutterGPUCompareFunction
Definition formats.h:528
FlutterGPUStorageMode
Definition formats.h:19
FlutterGPUBlendOperation
Definition formats.h:319
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:279
constexpr FlutterGPUStorageMode FromImpellerStorageMode(impeller::StorageMode value)
Definition formats.h:41
FlutterGPUMinMagFilter
Definition formats.h:422
constexpr FlutterGPUShaderStage FromImpellerShaderStage(impeller::ShaderStage value)
Definition formats.h:407
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:325
FlutterGPUBlendFactor
Definition formats.h:261
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:465
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:446
constexpr FlutterGPUPixelFormat FromImpellerPixelFormat(impeller::PixelFormat value)
Definition formats.h:188
FlutterGPUSamplerAddressMode
Definition formats.h:459
FlutterGPUStencilOperation
Definition formats.h:566
FlutterGPUPolygonMode
Definition formats.h:644
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:630
constexpr impeller::CompressedTextureFamily ToImpellerCompressedTextureFamily(FlutterGPUTextureCompressionFamily value)
Definition formats.h:96
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:539
constexpr impeller::ShaderStage ToImpellerShaderStage(FlutterGPUShaderStage value)
Definition formats.h:393
FlutterGPUPrimitiveType
Definition formats.h:500
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:347
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:370
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:649
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:487
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:577
FlutterGPUStoreAction
Definition formats.h:363
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:508
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:610
constexpr impeller::StorageMode ToImpellerStorageMode(FlutterGPUStorageMode value)
Definition formats.h:25
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:427
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