Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
impeller::TexImage2DData Struct Reference

Public Member Functions

 TexImage2DData (PixelFormat pixel_format)
 
 TexImage2DData (PixelFormat pixel_format, std::shared_ptr< const fml::Mapping > mapping)
 
bool IsValid () const
 

Public Attributes

GLint internal_format = 0
 
GLenum external_format = GL_NONE
 
GLenum type = GL_NONE
 
std::shared_ptr< const fml::Mappingdata
 

Detailed Description

Definition at line 128 of file texture_gles.cc.

Constructor & Destructor Documentation

◆ TexImage2DData() [1/2]

impeller::TexImage2DData::TexImage2DData ( PixelFormat  pixel_format)
inlineexplicit

Definition at line 134 of file texture_gles.cc.

134 {
135 switch (pixel_format) {
137 internal_format = GL_ALPHA;
138 external_format = GL_ALPHA;
139 type = GL_UNSIGNED_BYTE;
140 break;
142 internal_format = GL_RED;
143 external_format = GL_RED;
144 type = GL_UNSIGNED_BYTE;
145 break;
150 internal_format = GL_RGBA;
151 external_format = GL_RGBA;
152 type = GL_UNSIGNED_BYTE;
153 break;
155 internal_format = GL_RGBA;
156 external_format = GL_RGBA;
157 type = GL_FLOAT;
158 break;
160 internal_format = GL_RGBA;
161 external_format = GL_RGBA;
162 type = GL_HALF_FLOAT;
163 break;
165 // Pure stencil textures are only available in OpenGL 4.4+, which is
166 // ~0% of mobile devices. Instead, we use a depth-stencil texture and
167 // only use the stencil component.
168 //
169 // https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
171 internal_format = GL_DEPTH_STENCIL;
172 external_format = GL_DEPTH_STENCIL;
173 type = GL_UNSIGNED_INT_24_8;
174 break;
181 return;
182 }
183 is_valid_ = true;
184 }

◆ TexImage2DData() [2/2]

impeller::TexImage2DData::TexImage2DData ( PixelFormat  pixel_format,
std::shared_ptr< const fml::Mapping mapping 
)
inline

Definition at line 186 of file texture_gles.cc.

188 : TexImage2DData(pixel_format) {
189 data = std::move(mapping);
190 }
std::shared_ptr< const fml::Mapping > data
TexImage2DData(PixelFormat pixel_format)

Member Function Documentation

◆ IsValid()

bool impeller::TexImage2DData::IsValid ( ) const
inline

Definition at line 192 of file texture_gles.cc.

192{ return is_valid_; }

Member Data Documentation

◆ data

std::shared_ptr<const fml::Mapping> impeller::TexImage2DData::data

Definition at line 132 of file texture_gles.cc.

◆ external_format

GLenum impeller::TexImage2DData::external_format = GL_NONE

Definition at line 130 of file texture_gles.cc.

◆ internal_format

GLint impeller::TexImage2DData::internal_format = 0

Definition at line 129 of file texture_gles.cc.

◆ type

GLenum impeller::TexImage2DData::type = GL_NONE

Definition at line 131 of file texture_gles.cc.


The documentation for this struct was generated from the following file: