mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Factor destination alpha into color blend output (flutter/engine#36338)
This commit is contained in:
parent
4cf02644fa
commit
2682bdb322
@ -16,9 +16,6 @@
|
||||
|
||||
namespace impeller {
|
||||
|
||||
const BlendMode Entity::kLastPipelineBlendMode = BlendMode::kModulate;
|
||||
const BlendMode Entity::kLastAdvancedBlendMode = BlendMode::kLuminosity;
|
||||
|
||||
Entity::Entity() = default;
|
||||
|
||||
Entity::~Entity() = default;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user