5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_FORMATS_GLES_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_FORMATS_GLES_H_
10#include "flutter/fml/logging.h"
11#include "flutter/fml/macros.h"
19 switch (primitive_type) {
23 return GL_TRIANGLE_STRIP;
40 return GL_UNSIGNED_SHORT;
42 return GL_UNSIGNED_INT;
100 return GL_ONE_MINUS_SRC_COLOR;
104 return GL_ONE_MINUS_SRC_ALPHA;
108 return GL_ONE_MINUS_DST_COLOR;
112 return GL_ONE_MINUS_DST_ALPHA;
114 return GL_SRC_ALPHA_SATURATE;
116 return GL_CONSTANT_COLOR;
118 return GL_ONE_MINUS_CONSTANT_COLOR;
120 return GL_CONSTANT_ALPHA;
122 return GL_ONE_MINUS_CONSTANT_ALPHA;
132 return GL_FUNC_SUBTRACT;
134 return GL_FUNC_REVERSE_SUBTRACT;
144 return GL_UNSIGNED_BYTE;
148 return GL_UNSIGNED_SHORT;
173 return GL_TEXTURE_2D;
175 return GL_TEXTURE_2D_MULTISAMPLE;
177 return GL_TEXTURE_CUBE_MAP;
179 return GL_TEXTURE_EXTERNAL_OES;
187 return GL_TEXTURE_2D;
189 return GL_TEXTURE_2D;
191 return GL_TEXTURE_CUBE_MAP;
193 return GL_TEXTURE_EXTERNAL_OES;
#define FML_UNREACHABLE()
@ kNone
Does not use the index buffer.
@ kOneMinusDestinationAlpha
@ kOneMinusDestinationColor
PrimitiveType
Decides how backend draws pixels based on input vertices.
@ kPoint
Draws a point at each input vertex.
constexpr std::optional< GLenum > ToTextureTarget(TextureType type)
constexpr GLenum ToIndexType(IndexType type)
constexpr GLenum ToCompareFunction(CompareFunction func)
std::string DebugToFramebufferError(int status)
@ 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.
constexpr GLenum ToTextureType(TextureType type)
constexpr GLenum ToStencilOp(StencilOperation op)
constexpr GLenum ToMode(PrimitiveType primitive_type)
@ 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.
constexpr std::optional< GLenum > ToVertexAttribType(ShaderType type)
constexpr GLenum ToBlendFactor(BlendFactor factor)
constexpr GLenum ToBlendOperation(BlendOperation op)