mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Remove duplicated code. (flutter/engine#44024)
Contents::ShouldRender already checks whether the stencil_coverage.has_value.
This commit is contained in:
parent
17530e0b22
commit
dee698f80c
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user