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
59
62 switch (value) {
95 }
96}
97
101
103 impeller::PixelFormat value) {
104 switch (value) {
108 FML_DCHECK(false) << "k32Float not implemented.";
140 }
141}
142
147
157
163
181
183 FlutterGPUBlendFactor value) {
184 switch (value) {
215 }
216}
217
221
223 kAdd,
224 kSubtract,
226};
227
239
243
245 kDontCare,
246 kLoad,
247 kClear,
248};
249
261
263 return ToImpellerLoadAction(static_cast<FlutterGPULoadAction>(value));
264}
265
272
286
290
292 kVertex,
293 kFragment,
294};
295
305
309
311 impeller::ShaderStage value) {
312 switch (value) {
319 FML_LOG(FATAL) << "Invalid Flutter GPU ShaderStage "
320 << static_cast<size_t>(value);
322 }
323}
324
326 kNearest,
327 kLinear,
328};
329
339
343
345 kNearest,
346 kLinear,
347};
348
357
359 return ToImpellerMipFilter(static_cast<FlutterGPUMipFilter>(value));
360}
361
367
379
384
386 k16bit,
387 k32bit,
388};
389
398
400 return ToImpellerIndexType(static_cast<FlutterGPUIndexType>(value));
401}
402
404 kTriangle,
406 kLine,
408 kPoint,
409};
410
426
430
432 kNever,
433 kAlways,
434 kLess,
435 kEqual,
437 kGreater,
438 kNotEqual,
440};
441
463
468
479
501
506
508 kNone,
510 kBackFace,
511};
512
523
525 return ToImpellerCullMode(static_cast<FlutterGPUCullMode>(value));
526}
527
532
542
546
548 kFill,
549 kLine,
550};
551
561
565
566} // namespace gpu
567} // namespace flutter
568
569#endif // FLUTTER_LIB_GPU_FORMATS_H_
int32_t value
#define FML_LOG(severity)
Definition logging.h:101
#define FML_UNREACHABLE()
Definition logging.h:128
#define FML_DCHECK(condition)
Definition logging.h:122
FlutterGPUShaderStage
Definition formats.h:291
FlutterGPUPixelFormat
Definition formats.h:41
FlutterGPUWindingOrder
Definition formats.h:528
FlutterGPUTextureCoordinateSystem
Definition formats.h:143
constexpr impeller::PixelFormat ToImpellerPixelFormat(FlutterGPUPixelFormat value)
Definition formats.h:60
FlutterGPUCompareFunction
Definition formats.h:431
FlutterGPUStorageMode
Definition formats.h:19
FlutterGPUBlendOperation
Definition formats.h:222
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:182
FlutterGPUMinMagFilter
Definition formats.h:325
constexpr FlutterGPUShaderStage FromImpellerShaderStage(impeller::ShaderStage value)
Definition formats.h:310
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:228
FlutterGPUBlendFactor
Definition formats.h:164
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:368
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:349
constexpr FlutterGPUPixelFormat FromImpellerPixelFormat(impeller::PixelFormat value)
Definition formats.h:102
FlutterGPUSamplerAddressMode
Definition formats.h:362
FlutterGPUStencilOperation
Definition formats.h:469
FlutterGPUPolygonMode
Definition formats.h:547
constexpr impeller::TextureCoordinateSystem ToImpellerTextureCoordinateSystem(FlutterGPUTextureCoordinateSystem value)
Definition formats.h:148
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:533
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:442
constexpr impeller::ShaderStage ToImpellerShaderStage(FlutterGPUShaderStage value)
Definition formats.h:296
FlutterGPUPrimitiveType
Definition formats.h:403
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:250
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:273
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:552
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:390
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:480
FlutterGPUStoreAction
Definition formats.h:266
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:411
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:513
constexpr impeller::StorageMode ToImpellerStorageMode(FlutterGPUStorageMode value)
Definition formats.h:25
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:330
PrimitiveType
Decides how backend draws pixels based on input vertices.
Definition formats.h:355
@ kPoint
Draws a point at each input vertex.
SamplerAddressMode
Definition formats.h:444
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:556
@ 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:428
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.
@ kNearest
The nearst mipmap level is selected.
StencilOperation
Definition formats.h:575
@ 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.
TextureCoordinateSystem
Definition formats.h:330
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:418
@ kNearest
Select nearest to the sample point. Most widely supported.
BlendOperation
Definition formats.h:199