#include <texture_gles.h>
Public Types | |
| enum class | Type { kTexture , kTextureMultisampled , kRenderBuffer , kRenderBufferMultisampled } |
| enum class | AttachmentType { kColor0 , kDepth , kStencil } |
Public Member Functions | |
| TextureGLES (std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc) | |
| ~TextureGLES () override | |
| bool | IsValid () const override |
| std::optional< GLuint > | GetGLHandle () const |
| bool | Bind () const |
| bool | GenerateMipmap () |
| bool | SetAsFramebufferAttachment (GLenum target, AttachmentType attachment_type) const |
| Type | GetType () const |
| bool | IsWrapped () const |
| std::optional< GLuint > | GetFBO () const |
| void | MarkContentsInitialized () |
| Indicates that all texture storage has already been allocated and contents initialized. More... | |
| void | MarkSliceInitialized (size_t slice) const |
| Indicates that a specific texture slice has been initialized. More... | |
| bool | IsSliceInitialized (size_t slice) const |
| void | SetFence (HandleGLES fence) |
| Attach a sync fence to this texture that will be waited on before encoding a rendering operation that references it. More... | |
| void | SetCachedFBO (GLuint fbo) |
| GLuint | GetCachedFBO () const |
| Retrieve the cached FBO object, or GL_NONE if there is no object. More... | |
| std::optional< HandleGLES > | GetSyncFence () const |
| Type | ComputeTypeForBinding (GLenum target) const |
Public Member Functions inherited from impeller::Texture | |
| virtual | ~Texture () |
| bool | SetContents (const uint8_t *contents, size_t length, size_t slice=0, bool is_opaque=false) |
| bool | SetContents (std::shared_ptr< const fml::Mapping > mapping, size_t slice=0, bool is_opaque=false) |
| bool | IsOpaque () const |
| size_t | GetMipCount () const |
| const TextureDescriptor & | GetTextureDescriptor () const |
| void | SetCoordinateSystem (TextureCoordinateSystem coordinate_system) |
| TextureCoordinateSystem | GetCoordinateSystem () const |
| bool | NeedsMipmapGeneration () const |
Static Public Member Functions | |
| static std::shared_ptr< TextureGLES > | WrapFBO (std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc, GLuint fbo) |
| Create a texture by wrapping an external framebuffer object whose lifecycle is owned by the caller. More... | |
| static std::shared_ptr< TextureGLES > | WrapTexture (std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc, HandleGLES external_handle) |
| Create a texture by wrapping an external OpenGL texture handle. Ownership of the texture handle is assumed by the reactor. More... | |
| static std::shared_ptr< TextureGLES > | CreatePlaceholder (std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc) |
| Create a "texture" that is never expected to be bound/unbound explicitly or initialized in any way. It only exists to setup a render pass description. More... | |
Static Public Member Functions inherited from impeller::BackendCast< TextureGLES, Texture > | |
| static TextureGLES & | Cast (Texture &base) |
| static const TextureGLES & | Cast (const Texture &base) |
| static TextureGLES * | Cast (Texture *base) |
| static const TextureGLES * | Cast (const Texture *base) |
Additional Inherited Members | |
Protected Member Functions inherited from impeller::Texture | |
| Texture (TextureDescriptor desc) | |
Protected Attributes inherited from impeller::Texture | |
| bool | mipmap_generated_ = false |
Definition at line 18 of file texture_gles.h.
|
strong |
| Enumerator | |
|---|---|
| kColor0 | |
| kDepth | |
| kStencil | |
Definition at line 92 of file texture_gles.h.
|
strong |
| Enumerator | |
|---|---|
| kTexture | |
| kTextureMultisampled | |
| kRenderBuffer | |
| kRenderBufferMultisampled | |
Definition at line 21 of file texture_gles.h.
| impeller::TextureGLES::TextureGLES | ( | std::shared_ptr< ReactorGLES > | reactor, |
| TextureDescriptor | desc | ||
| ) |
Definition at line 181 of file texture_gles.cc.
Referenced by WrapFBO(), and WrapTexture().
|
override |
Definition at line 220 of file texture_gles.cc.
| bool impeller::TextureGLES::Bind | ( | ) | const |
Definition at line 489 of file texture_gles.cc.
References GetGLHandle(), impeller::Texture::GetTextureDescriptor(), kRenderBuffer, kRenderBufferMultisampled, kTexture, kTextureMultisampled, impeller::ToTextureTarget(), type, and VALIDATION_LOG.
Referenced by GenerateMipmap().
| TextureGLES::Type impeller::TextureGLES::ComputeTypeForBinding | ( | GLenum | target | ) | const |
Definition at line 395 of file texture_gles.cc.
References kTexture, and kTextureMultisampled.
Referenced by SetAsFramebufferAttachment().
|
static |
Create a "texture" that is never expected to be bound/unbound explicitly or initialized in any way. It only exists to setup a render pass description.
| [in] | reactor | The reactor |
| [in] | desc | The description |
Definition at line 175 of file texture_gles.cc.
References WrapFBO().
Referenced by impeller::SurfaceGLES::WrapFBO().
| bool impeller::TextureGLES::GenerateMipmap | ( | ) |
Definition at line 538 of file texture_gles.cc.
References Bind(), GetGLHandle(), impeller::Texture::GetTextureDescriptor(), IsValid(), impeller::kTexture2D, impeller::kTexture2DMultisample, impeller::kTextureCube, impeller::kTextureExternalOES, impeller::Texture::mipmap_generated_, impeller::ToTextureType(), impeller::TextureDescriptor::type, type, and VALIDATION_LOG.
| GLuint impeller::TextureGLES::GetCachedFBO | ( | ) | const |
Retrieve the cached FBO object, or GL_NONE if there is no object.
Definition at line 666 of file texture_gles.cc.
Referenced by impeller::EncodeCommandsInReactor().
| std::optional< GLuint > impeller::TextureGLES::GetFBO | ( | ) | const |
Definition at line 648 of file texture_gles.cc.
Referenced by impeller::EncodeCommandsInReactor().
| std::optional< GLuint > impeller::TextureGLES::GetGLHandle | ( | ) | const |
Definition at line 482 of file texture_gles.cc.
References IsValid().
Referenced by Bind(), impeller::ConfigureFBO(), impeller::BlitCopyBufferToTextureCommandGLES::Encode(), GenerateMipmap(), impeller::interop::ImpellerTextureGetOpenGLHandle(), and SetAsFramebufferAttachment().
| std::optional< HandleGLES > impeller::TextureGLES::GetSyncFence | ( | ) | const |
Definition at line 658 of file texture_gles.cc.
| TextureGLES::Type impeller::TextureGLES::GetType | ( | ) | const |
Definition at line 572 of file texture_gles.cc.
Referenced by impeller::BlitCopyBufferToTextureCommandGLES::Encode().
| bool impeller::TextureGLES::IsSliceInitialized | ( | size_t | slice | ) | const |
Definition at line 534 of file texture_gles.cc.
Referenced by impeller::BlitCopyBufferToTextureCommandGLES::Encode().
|
overridevirtual |
Implements impeller::Texture.
Definition at line 228 of file texture_gles.cc.
Referenced by GenerateMipmap(), GetGLHandle(), and SetAsFramebufferAttachment().
| bool impeller::TextureGLES::IsWrapped | ( | ) | const |
Definition at line 644 of file texture_gles.cc.
Referenced by impeller::ConfigureFBO(), impeller::BlitCopyBufferToTextureCommandGLES::Encode(), and impeller::EncodeCommandsInReactor().
| void impeller::TextureGLES::MarkContentsInitialized | ( | ) |
Indicates that all texture storage has already been allocated and contents initialized.
This is similar to calling MarkSliceInitialized with all slices.
Definition at line 524 of file texture_gles.cc.
| void impeller::TextureGLES::MarkSliceInitialized | ( | size_t | slice | ) | const |
Indicates that a specific texture slice has been initialized.
| [in] | slice | The slice to mark as being initialized. |
Definition at line 530 of file texture_gles.cc.
Referenced by impeller::BlitCopyBufferToTextureCommandGLES::Encode().
| bool impeller::TextureGLES::SetAsFramebufferAttachment | ( | GLenum | target, |
| AttachmentType | attachment_type | ||
| ) | const |
Definition at line 587 of file texture_gles.cc.
References ComputeTypeForBinding(), GetGLHandle(), IsValid(), kRenderBuffer, kRenderBufferMultisampled, kTexture, kTextureMultisampled, and impeller::ToAttachmentType().
Referenced by impeller::ConfigureFBO(), and impeller::EncodeCommandsInReactor().
| void impeller::TextureGLES::SetCachedFBO | ( | GLuint | fbo | ) |
Store the FBO object for recycling in the 2D renderer.
The color0 texture used by the 2D renderer will use this texture object to store the associated FBO the first time it is used.
Definition at line 662 of file texture_gles.cc.
Referenced by impeller::EncodeCommandsInReactor().
| void impeller::TextureGLES::SetFence | ( | HandleGLES | fence | ) |
Attach a sync fence to this texture that will be waited on before encoding a rendering operation that references it.
| [in] | fence | A handle to a sync fence. |
Definition at line 652 of file texture_gles.cc.
|
static |
Create a texture by wrapping an external framebuffer object whose lifecycle is owned by the caller.
This is useful for creating a render target for the default window managed framebuffer.
| [in] | reactor | The reactor |
| [in] | desc | The description |
| [in] | fbo | The fbo |
Definition at line 143 of file texture_gles.cc.
References TextureGLES().
Referenced by CreatePlaceholder(), and impeller::SurfaceGLES::WrapFBO().
|
static |
Create a texture by wrapping an external OpenGL texture handle. Ownership of the texture handle is assumed by the reactor.
| [in] | reactor | The reactor |
| [in] | desc | The description |
| [in] | external_handle | The external handle |
Definition at line 155 of file texture_gles.cc.
References impeller::HandleGLES::GetType(), impeller::HandleGLES::IsDead(), impeller::kTexture, TextureGLES(), and VALIDATION_LOG.
Referenced by impeller::interop::ImpellerTextureCreateWithOpenGLTextureHandleNew().