Factor destination alpha into color blend output (flutter/engine#36338)

This commit is contained in:
Brandon DeRosier 2022-09-22 00:19:37 -07:00 committed by GitHub
parent 4cf02644fa
commit 2682bdb322
4 changed files with 4 additions and 6 deletions

View File

@ -16,9 +16,6 @@
namespace impeller {
const BlendMode Entity::kLastPipelineBlendMode = BlendMode::kModulate;
const BlendMode Entity::kLastAdvancedBlendMode = BlendMode::kLuminosity;
Entity::Entity() = default;
Entity::~Entity() = default;

View File

@ -19,8 +19,8 @@ class RenderPass;
class Entity {
public:
static const BlendMode kLastPipelineBlendMode;
static const BlendMode kLastAdvancedBlendMode;
static constexpr BlendMode kLastPipelineBlendMode = BlendMode::kModulate;
static constexpr BlendMode kLastAdvancedBlendMode = BlendMode::kLuminosity;
/// An enum to define how to repeat, fold, or omit colors outside of the
/// typically defined range of the source of the colors (such as the

View File

@ -662,6 +662,7 @@ TEST_P(EntityTest, BlendingModeOptions) {
static_assert(b == BlendMode::kClear); // Ensure the first item in
// the switch is the first
// item in the enum.
static_assert(Entity::kLastPipelineBlendMode == BlendMode::kModulate);
switch (b) {
case BlendMode::kClear:
blend_mode_names.push_back("Clear");

View File

@ -40,5 +40,5 @@ void main() {
vec3 blended = Blend(dst.rgb, src.rgb);
frag_color = vec4(blended * src.a, src.a);
frag_color = vec4(blended, 1) * src.a * dst.a;
}