Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions impeller/entity/contents/contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ class Contents {
RenderPass& pass) const = 0;

//----------------------------------------------------------------------------
/// @brief Get the screen space bounding rectangle that this contents affects.
/// @brief Get the area of the render pass that will be affected when this
/// contents is rendered.
///
/// During rendering, coverage coordinates count pixels from the top
/// left corner of the framebuffer.
///
/// @return The coverage rectangle. An `std::nullopt` result means that
/// rendering this contents has no effect on the output color.
///
virtual std::optional<Rect> GetCoverage(const Entity& entity) const = 0;

Expand All @@ -89,11 +96,14 @@ class Contents {
virtual bool IsOpaque() const;

//----------------------------------------------------------------------------
/// @brief Given the current screen space bounding rectangle of the clip
/// @brief Given the current pass space bounding rectangle of the clip
/// buffer, return the expected clip coverage after this draw call.
/// This should only be implemented for contents that may write to the
/// clip buffer.
///
/// During rendering, coverage coordinates count pixels from the top
/// left corner of the framebuffer.
///
virtual ClipCoverage GetClipCoverage(
const Entity& entity,
const std::optional<Rect>& current_clip_coverage) const;
Expand Down
2 changes: 2 additions & 0 deletions impeller/entity/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ class Entity {

~Entity();

/// @brief Get the global transformation matrix for this Entity.
const Matrix& GetTransformation() const;

/// @brief Set the global transformation matrix for this Entity.
void SetTransformation(const Matrix& transformation);

std::optional<Rect> GetCoverage() const;
Expand Down