17SamplerGLES::~SamplerGLES() =
default;
20 switch (minmag_filter) {
21 case MinMagFilter::kNearest:
31 case MipFilter::kBase:
33 case MipFilter::kNearest:
34 switch (minmag_filter) {
35 case MinMagFilter::kNearest:
36 return GL_NEAREST_MIPMAP_NEAREST;
38 return GL_LINEAR_MIPMAP_NEAREST;
41 switch (minmag_filter) {
42 case MinMagFilter::kNearest:
43 return GL_NEAREST_MIPMAP_LINEAR;
45 return GL_LINEAR_MIPMAP_LINEAR;
52 bool supports_decal_sampler_address_mode) {
54 case SamplerAddressMode::kClampToEdge:
55 return GL_CLAMP_TO_EDGE;
56 case SamplerAddressMode::kRepeat:
58 case SamplerAddressMode::kMirror:
59 return GL_MIRRORED_REPEAT;
60 case SamplerAddressMode::kDecal:
61 if (supports_decal_sampler_address_mode) {
64 return GL_CLAMP_TO_EDGE;
72 if (
texture.NeedsMipmapGeneration()) {
74 <<
"Texture mip count is > 1, but the mipmap has not been generated. "
75 "Texture can not be sampled safely.";
84 const auto&
desc = GetDescriptor();
90 if (
texture.GetTextureDescriptor().mip_count > 1) {
96 gl.TexParameteri(*
target, GL_TEXTURE_MIN_FILTER, min_filter);
97 gl.TexParameteri(*
target, GL_TEXTURE_MAG_FILTER, mag_filter);
99 const auto supports_decal_mode =
100 gl.GetCapabilities()->SupportsDecalSamplerAddressMode();
107 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_S, wrap_s);
108 gl.TexParameteri(*
target, GL_TEXTURE_WRAP_T, wrap_t);
113 const GLfloat border_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
#define FML_UNREACHABLE()
static constexpr skcms_TransferFunction kLinear
std::function< ProfileSample(void)> Sampler
Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version ...
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
constexpr std::optional< GLenum > ToTextureTarget(TextureType type)
static GLint ToAddressMode(SamplerAddressMode mode, bool supports_decal_sampler_address_mode)
MipFilter
Options for selecting and filtering between mipmap levels.
static GLint ToParam(MinMagFilter minmag_filter, MipFilter mip_filter)
MinMagFilter
Describes how the texture should be sampled when the texture is being shrunk (minified) or expanded (...
#define IMPELLER_GL_TEXTURE_BORDER_COLOR
#define IMPELLER_GL_CLAMP_TO_BORDER