[Impeller] Propagate PopulateGlyphAtlas through filters. (flutter/engine#43920)
Resolves https://github.com/flutter/flutter/issues/131012.
This commit is contained in:
@@ -193,6 +193,14 @@ std::optional<Rect> FilterContents::GetCoverage(const Entity& entity) const {
|
||||
return GetLocalCoverage(entity_with_local_transform);
|
||||
}
|
||||
|
||||
void FilterContents::PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) {
|
||||
for (auto& input : inputs_) {
|
||||
input->PopulateGlyphAtlas(lazy_glyph_atlas, scale);
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<Rect> FilterContents::GetFilterCoverage(
|
||||
const FilterInput::Vector& inputs,
|
||||
const Entity& entity,
|
||||
|
||||
@@ -115,6 +115,11 @@ class FilterContents : public Contents {
|
||||
// |Contents|
|
||||
std::optional<Rect> GetCoverage(const Entity& entity) const override;
|
||||
|
||||
// |Contents|
|
||||
void PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) override;
|
||||
|
||||
// |Contents|
|
||||
std::optional<Snapshot> RenderToSnapshot(
|
||||
const ContentContext& renderer,
|
||||
|
||||
@@ -46,4 +46,10 @@ std::optional<Rect> ContentsFilterInput::GetCoverage(
|
||||
return contents_->GetCoverage(entity);
|
||||
}
|
||||
|
||||
void ContentsFilterInput::PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) {
|
||||
contents_->PopulateGlyphAtlas(lazy_glyph_atlas, scale);
|
||||
}
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -25,6 +25,11 @@ class ContentsFilterInput final : public FilterInput {
|
||||
// |FilterInput|
|
||||
std::optional<Rect> GetCoverage(const Entity& entity) const override;
|
||||
|
||||
// |FilterInput|
|
||||
void PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) override;
|
||||
|
||||
private:
|
||||
ContentsFilterInput(std::shared_ptr<Contents> contents, bool msaa_enabled);
|
||||
|
||||
|
||||
@@ -52,4 +52,10 @@ Matrix FilterContentsFilterInput::GetTransform(const Entity& entity) const {
|
||||
return filter_->GetTransform(entity.GetTransformation());
|
||||
}
|
||||
|
||||
void FilterContentsFilterInput::PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) {
|
||||
filter_->PopulateGlyphAtlas(lazy_glyph_atlas, scale);
|
||||
}
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -31,6 +31,11 @@ class FilterContentsFilterInput final : public FilterInput {
|
||||
// |FilterInput|
|
||||
Matrix GetTransform(const Entity& entity) const override;
|
||||
|
||||
// |FilterInput|
|
||||
void PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) override;
|
||||
|
||||
private:
|
||||
FilterContentsFilterInput(std::shared_ptr<FilterContents> filter);
|
||||
|
||||
|
||||
@@ -64,6 +64,10 @@ Matrix FilterInput::GetTransform(const Entity& entity) const {
|
||||
return entity.GetTransformation() * GetLocalTransform(entity);
|
||||
}
|
||||
|
||||
void FilterInput::PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale) {}
|
||||
|
||||
FilterInput::~FilterInput() = default;
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -62,6 +62,11 @@ class FilterInput {
|
||||
/// @brief Get the transform of this `FilterInput`. This is equivalent to
|
||||
/// calling `entity.GetTransformation() * GetLocalTransform()`.
|
||||
virtual Matrix GetTransform(const Entity& entity) const;
|
||||
|
||||
/// @see `Contents::PopulateGlyphAtlas`
|
||||
virtual void PopulateGlyphAtlas(
|
||||
const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
|
||||
Scalar scale);
|
||||
};
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
Reference in New Issue
Block a user