Flutter Engine
The Flutter Engine
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) {
137 }
138}
139
144
154
160
178
180 FlutterGPUBlendFactor value) {
181 switch (value) {
212 }
213}
214
218
220 kAdd,
221 kSubtract,
223};
224
236
240
242 kDontCare,
243 kLoad,
244 kClear,
245};
246
258
260 return ToImpellerLoadAction(static_cast<FlutterGPULoadAction>(value));
261}
262
269
283
287
289 kVertex,
290 kFragment,
291};
292
302
306
308 impeller::ShaderStage value) {
309 switch (value) {
316 FML_LOG(FATAL) << "Invalid Flutter GPU ShaderStage "
317 << static_cast<size_t>(value);
319 }
320}
321
323 kNearest,
324 kLinear,
325};
326
336
340
342 kNearest,
343 kLinear,
344};
345
354
356 return ToImpellerMipFilter(static_cast<FlutterGPUMipFilter>(value));
357}
358
364
376
381
383 k16bit,
384 k32bit,
385};
386
395
397 return ToImpellerIndexType(static_cast<FlutterGPUIndexType>(value));
398}
399
401 kTriangle,
403 kLine,
405 kPoint,
406};
407
423
427
429 kNever,
430 kAlways,
431 kLess,
432 kEqual,
434 kGreater,
435 kNotEqual,
437};
438
460
465
476
498
503
504} // namespace gpu
505} // namespace flutter
506
507#endif // FLUTTER_LIB_GPU_FORMATS_H_
#define FATAL(error)
uint8_t value
#define FML_LOG(severity)
Definition logging.h:82
#define FML_UNREACHABLE()
Definition logging.h:109
FlutterGPUShaderStage
Definition formats.h:288
FlutterGPUPixelFormat
Definition formats.h:41
FlutterGPUTextureCoordinateSystem
Definition formats.h:140
constexpr impeller::PixelFormat ToImpellerPixelFormat(FlutterGPUPixelFormat value)
Definition formats.h:60
FlutterGPUCompareFunction
Definition formats.h:428
FlutterGPUStorageMode
Definition formats.h:19
FlutterGPUBlendOperation
Definition formats.h:219
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:179
FlutterGPUMinMagFilter
Definition formats.h:322
constexpr FlutterGPUShaderStage FromImpellerShaderStage(impeller::ShaderStage value)
Definition formats.h:307
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:225
FlutterGPUBlendFactor
Definition formats.h:161
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:365
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:346
constexpr FlutterGPUPixelFormat FromImpellerPixelFormat(impeller::PixelFormat value)
Definition formats.h:102
FlutterGPUSamplerAddressMode
Definition formats.h:359
FlutterGPUStencilOperation
Definition formats.h:466
constexpr impeller::TextureCoordinateSystem ToImpellerTextureCoordinateSystem(FlutterGPUTextureCoordinateSystem value)
Definition formats.h:145
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:439
constexpr impeller::ShaderStage ToImpellerShaderStage(FlutterGPUShaderStage value)
Definition formats.h:293
FlutterGPUPrimitiveType
Definition formats.h:400
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:247
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:270
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:387
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:477
FlutterGPUStoreAction
Definition formats.h:263
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:408
constexpr impeller::StorageMode ToImpellerStorageMode(FlutterGPUStorageMode value)
Definition formats.h:25
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:327
PrimitiveType
Decides how backend draws pixels based on input vertices.
Definition formats.h:353
@ kPoint
Draws a point at each input vertex.
@ kNearest
Sample from the nearest mip level.
StorageMode
Specified where the allocation resides and how it is used.
Definition formats.h:33
SamplerAddressMode
Definition formats.h:423
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition formats.h:100
CompareFunction
Definition formats.h:534
@ 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.
StencilOperation
Definition formats.h:553
@ 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:328
@ kNearest
Select nearest to the sample point. Most widely supported.
BlendOperation
Definition formats.h:197