[impeller] runtime effect doesnt accept opacity (flutter/engine#40579)
[impeller] runtime effect doesnt accept opacity
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user