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"
18 switch (primitive_type) {
22 return GL_TRIANGLE_STRIP;
39 return GL_UNSIGNED_SHORT;
41 return GL_UNSIGNED_INT;
99 return GL_ONE_MINUS_SRC_COLOR;
103 return GL_ONE_MINUS_SRC_ALPHA;
107 return GL_ONE_MINUS_DST_COLOR;
111 return GL_ONE_MINUS_DST_ALPHA;
113 return GL_SRC_ALPHA_SATURATE;
115 return GL_CONSTANT_COLOR;
117 return GL_ONE_MINUS_CONSTANT_COLOR;
119 return GL_CONSTANT_ALPHA;
121 return GL_ONE_MINUS_CONSTANT_ALPHA;
131 return GL_FUNC_SUBTRACT;
133 return GL_FUNC_REVERSE_SUBTRACT;
143 return GL_UNSIGNED_BYTE;
147 return GL_UNSIGNED_SHORT;
172 return GL_TEXTURE_2D;
174 return GL_TEXTURE_2D_MULTISAMPLE;
176 return GL_TEXTURE_CUBE_MAP;
178 return GL_TEXTURE_EXTERNAL_OES;
186 return GL_TEXTURE_2D;
188 return GL_TEXTURE_2D;
190 return GL_TEXTURE_CUBE_MAP;
192 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)