 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_ATLAS_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_ATLAS_CONTENTS_H_
12 #include "flutter/fml/macros.h"
39 void SetTexture(std::shared_ptr<Texture> texture);
49 void SetColors(std::vector<Color> colors);
63 const std::vector<Color>&
GetColors()
const;
79 Rect ComputeBoundingBox()
const;
81 std::shared_ptr<Texture> texture_;
82 std::vector<Rect> texture_coords_;
83 std::vector<Color> colors_;
84 std::vector<Matrix> transforms_;
86 std::optional<Rect> cull_rect_;
89 mutable std::optional<Rect> bounding_box_cache_;
114 void SetTexture(std::shared_ptr<Texture> texture);
118 void SetSubAtlas(
const std::shared_ptr<SubAtlasResult>& subatlas);
124 std::shared_ptr<Texture> texture_;
125 bool use_destination_ =
false;
126 std::shared_ptr<SubAtlasResult> subatlas_;
151 void SetSubAtlas(
const std::shared_ptr<SubAtlasResult>& subatlas);
157 std::shared_ptr<SubAtlasResult> subatlas_;
166 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_ATLAS_CONTENTS_H_
void SetTextureCoordinates(std::vector< Rect > texture_coords)
void SetAlpha(Scalar alpha)
void SetSamplerDescriptor(SamplerDescriptor desc)
std::vector< Matrix > result_transforms
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
AtlasColorContents(const AtlasContents &parent)
void SetCoverage(Rect coverage)
void SetAlpha(Scalar alpha)
void SetBlendMode(BlendMode blend_mode)
std::shared_ptr< SubAtlasResult > GenerateSubAtlas() const
Compress a drawAtlas call with blending into a smaller sized atlas. This atlas has no overlapping to ...
~AtlasContents() override
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
const std::vector< Matrix > & GetTransforms() const
const std::vector< Rect > & GetTextureCoordinates() const
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
std::shared_ptr< Texture > GetTexture() const
std::vector< Matrix > sub_transforms
std::vector< Color > sub_colors
void SetSubAtlas(const std::shared_ptr< SubAtlasResult > &subatlas)
void SetColors(std::vector< Color > colors)
~AtlasColorContents() override
Render passes encode render commands directed as one specific render target into an underlying comman...
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
void SetUseDestination(bool value)
~AtlasTextureContents() override
void SetAlpha(Scalar alpha)
AtlasTextureContents(const AtlasContents &parent)
void SetCullRect(std::optional< Rect > cull_rect)
void SetTexture(std::shared_ptr< Texture > texture)
std::vector< Rect > sub_texture_coords
void SetTransforms(std::vector< Matrix > transforms)
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
const SamplerDescriptor & GetSamplerDescriptor() const
void SetCoverage(Rect coverage)
void SetTexture(std::shared_ptr< Texture > texture)
std::vector< Rect > result_texture_coords
const std::vector< Color > & GetColors() const
void SetSubAtlas(const std::shared_ptr< SubAtlasResult > &subatlas)