Skip to content

Commit 0e4bebf

Browse files
authored
Added docstring for FilterContents::RenderFilter (flutter#167227)
fixes flutter#137704 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 434cb54 commit 0e4bebf

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

engine/src/flutter/impeller/entity/contents/filters/filter_contents.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,29 @@ class FilterContents : public Contents {
190190
const Matrix& effect_transform,
191191
const Rect& output_limit) const = 0;
192192

193-
/// @brief Converts zero or more filter inputs into a render instruction.
193+
/// Applies the specific filter logic to the given inputs and returns an
194+
/// Entity representing the filtered result.
195+
///
196+
/// This is the primary method that subclasses must implement to define their
197+
/// filtering behavior. It takes the results of evaluating the filter inputs
198+
/// (as Snapshots) and produces a new Entity containing the filtered output.
199+
///
200+
/// @param[in] inputs The evaluated inputs to the filter, typically as
201+
/// Snapshots.
202+
/// @param[in] renderer The content context providing rendering resources.
203+
/// @param[in] entity The entity applying this filter, providing transform,
204+
/// blend mode, and other context.
205+
/// @param[in] effect_transform An additional transform applied after the
206+
/// entity's transform, often used in subpass scenarios.
207+
/// @param[in] coverage The calculated coverage area of the filter's output
208+
/// in the coordinate space after applying the entity and effect transforms.
209+
/// @param[in] coverage_hint An optional hint representing the desired output
210+
/// coverage area, which can be used for optimization (e.g., rendering only a
211+
/// portion of the input).
212+
///
213+
/// @return An optional Entity containing the rendered result of the filter.
214+
/// Returns `std::nullopt` if the filter cannot be applied or results in empty
215+
/// output.
194216
virtual std::optional<Entity> RenderFilter(
195217
const FilterInput::Vector& inputs,
196218
const ContentContext& renderer,

0 commit comments

Comments
 (0)