[impeller] runtime effect doesnt accept opacity (flutter/engine#40579)

[impeller] runtime effect doesnt accept opacity
This commit is contained in:
Jonah Williams
2023-03-23 19:55:21 -07:00
committed by GitHub
parent 58ad9ae24e
commit 1ae57920a9
3 changed files with 11 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ void RuntimeEffectContents::SetTextureInputs(
texture_inputs_ = std::move(texture_inputs);
}
bool RuntimeEffectContents::CanAcceptOpacity(const Entity& entity) const {
return false;
}
bool RuntimeEffectContents::Render(const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) const {

View File

@@ -25,6 +25,9 @@ class RuntimeEffectContents final : public ColorSourceContents {
void SetTextureInputs(std::vector<TextureInput> texture_inputs);
// | Contents|
bool CanAcceptOpacity(const Entity& entity) const override;
// |Contents|
bool Render(const ContentContext& renderer,
const Entity& entity,

View File

@@ -2437,6 +2437,10 @@ TEST_P(EntityTest, InheritOpacityTest) {
// Clips and restores trivially accept opacity.
ASSERT_TRUE(ClipContents().CanAcceptOpacity(entity));
ASSERT_TRUE(ClipRestoreContents().CanAcceptOpacity(entity));
// Runtime effect contents can't accept opacity.
auto runtime_effect = std::make_shared<RuntimeEffectContents>();
ASSERT_FALSE(runtime_effect->CanAcceptOpacity(entity));
}
} // namespace testing