Represents a texture and its intended draw transform/sampler configuration. More...
#include <snapshot.h>
Public Member Functions | |
| bool | ShouldRasterizeForRuntimeEffects () const |
| std::optional< Rect > | GetCoverage () const |
| std::optional< Matrix > | GetUVTransform () const |
| Get the transform that converts screen space coordinates to the UV space of this snapshot. | |
| std::optional< std::array< Point, 4 > > | GetCoverageUVs (const Rect &coverage) const |
| Map a coverage rect to this filter input's UV space. Result order: Top left, top right, bottom left, bottom right. | |
Public Attributes | |
| std::shared_ptr< Texture > | texture |
| Matrix | transform |
| The transform that should be applied to this texture for rendering. | |
| SamplerDescriptor | sampler_descriptor |
| Scalar | opacity = 1.0f |
| bool | needs_rasterization_for_runtime_effects = false |
| Whether this snapshot needs to be re-rasterized when used as an input to a runtime effect. | |
Represents a texture and its intended draw transform/sampler configuration.
Definition at line 24 of file snapshot.h.
| std::optional< Rect > impeller::Snapshot::GetCoverage | ( | ) | const |
Definition at line 11 of file snapshot.cc.
References impeller::TRect< Scalar >::MakeSize(), texture, transform, and impeller::TRect< T >::TransformBounds().
| std::optional< std::array< Point, 4 > > impeller::Snapshot::GetCoverageUVs | ( | const Rect & | coverage | ) | const |
Map a coverage rect to this filter input's UV space. Result order: Top left, top right, bottom left, bottom right.
Definition at line 26 of file snapshot.cc.
References impeller::TRect< T >::GetTransformedPoints(), and GetUVTransform().
| std::optional< Matrix > impeller::Snapshot::GetUVTransform | ( | ) | const |
Get the transform that converts screen space coordinates to the UV space of this snapshot.
Definition at line 18 of file snapshot.cc.
References impeller::Matrix::Invert(), impeller::Matrix::MakeScale(), texture, and transform.
Referenced by GetCoverageUVs().
|
inline |
Any snapshot that is scaled should rerasterize because we should be performing the RuntimeEffect at the resolution of the screen, not the scaled up or scaled down version of the snapshot.
Definition at line 51 of file snapshot.h.
References impeller::Matrix::IsTranslationOnly(), needs_rasterization_for_runtime_effects, and transform.
| bool impeller::Snapshot::needs_rasterization_for_runtime_effects = false |
Whether this snapshot needs to be re-rasterized when used as an input to a runtime effect.
This is required because there is no good heuristic to determine if a Snapshot needs to be rerasterized before applying a RuntimeFilter. In particular the GaussianBlurContents will return a Snapshot that includes padding for the blur halo which is not possible for the RuntimeEffectContents to know about. This value will tell RuntimeEffectContents that the Snapshot will have to be rerasterized to capture the padding.
Definition at line 46 of file snapshot.h.
Referenced by impeller::Entity::FromSnapshot(), and ShouldRasterizeForRuntimeEffects().
| Scalar impeller::Snapshot::opacity = 1.0f |
Definition at line 35 of file snapshot.h.
Referenced by impeller::Entity::FromSnapshot().
| SamplerDescriptor impeller::Snapshot::sampler_descriptor |
Definition at line 29 of file snapshot.h.
Referenced by impeller::Entity::FromSnapshot(), and impeller::Canvas::SaveLayer().
| std::shared_ptr<Texture> impeller::Snapshot::texture |
Definition at line 25 of file snapshot.h.
Referenced by impeller::AdvancedBlend(), impeller::Entity::FromSnapshot(), GetCoverage(), impeller::TextureFilterInput::GetSnapshot(), GetUVTransform(), impeller::PipelineBlend(), impeller::Contents::RenderToSnapshot(), impeller::TextureContents::RenderToSnapshot(), impeller::TiledTextureContents::RenderToSnapshot(), and impeller::Canvas::SaveLayer().
| Matrix impeller::Snapshot::transform |
The transform that should be applied to this texture for rendering.
Definition at line 27 of file snapshot.h.
Referenced by impeller::Entity::FromSnapshot(), GetCoverage(), GetUVTransform(), impeller::Canvas::SaveLayer(), and ShouldRasterizeForRuntimeEffects().