[Impeller] Remove duplicated code. (flutter/engine#44024)

Contents::ShouldRender already checks whether the stencil_coverage.has_value.
This commit is contained in:
Dan Field 2023-07-25 22:37:23 -07:00 committed by GitHub
parent 17530e0b22
commit dee698f80c
4 changed files with 0 additions and 26 deletions

View File

@ -51,13 +51,4 @@ void ColorSourceContents::SetInheritedOpacity(Scalar opacity) {
inherited_opacity_ = opacity;
}
bool ColorSourceContents::ShouldRender(
const Entity& entity,
const std::optional<Rect>& stencil_coverage) const {
if (!stencil_coverage.has_value()) {
return false;
}
return Contents::ShouldRender(entity, stencil_coverage);
}
} // namespace impeller

View File

@ -93,10 +93,6 @@ class ColorSourceContents : public Contents {
// |Contents|
std::optional<Rect> GetCoverage(const Entity& entity) const override;
// |Contents|
bool ShouldRender(const Entity& entity,
const std::optional<Rect>& stencil_coverage) const override;
// |Contents|
bool CanInheritOpacity(const Entity& entity) const override;

View File

@ -41,15 +41,6 @@ std::optional<Rect> SolidColorContents::GetCoverage(
return geometry->GetCoverage(entity.GetTransformation());
};
bool SolidColorContents::ShouldRender(
const Entity& entity,
const std::optional<Rect>& stencil_coverage) const {
if (!stencil_coverage.has_value()) {
return false;
}
return Contents::ShouldRender(entity, stencil_coverage);
}
bool SolidColorContents::Render(const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) const {

View File

@ -40,10 +40,6 @@ class SolidColorContents final : public ColorSourceContents {
// |Contents|
std::optional<Rect> GetCoverage(const Entity& entity) const override;
// |Contents|
bool ShouldRender(const Entity& entity,
const std::optional<Rect>& stencil_coverage) const override;
// |Contents|
bool Render(const ContentContext& renderer,
const Entity& entity,