Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
impeller::ColorAttachmentDescriptor Struct Reference

Describe the color attachment that will be used with this pipeline. More...

#include <formats.h>

Public Member Functions

constexpr bool operator== (const ColorAttachmentDescriptor &o) const
 
constexpr size_t Hash () const
 

Public Attributes

PixelFormat format = PixelFormat::kUnknown
 
bool blending_enabled = false
 
BlendFactor src_color_blend_factor = BlendFactor::kSourceAlpha
 
BlendOperation color_blend_op = BlendOperation::kAdd
 
BlendFactor dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha
 
BlendFactor src_alpha_blend_factor = BlendFactor::kSourceAlpha
 
BlendOperation alpha_blend_op = BlendOperation::kAdd
 
BlendFactor dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha
 
ColorWriteMask write_mask = ColorWriteMaskBits::kAll
 

Detailed Description

Describe the color attachment that will be used with this pipeline.

Blending at specific color attachments follows the pseudo-code:

final_color.rgb = (src_color_blend_factor * new_color.rgb)
(dst_color_blend_factor * old_color.rgb);
final_color.a = (src_alpha_blend_factor * new_color.a)
(dst_alpha_blend_factor * old_color.a);
} else {
final_color = new_color;
}
// IMPORTANT: The write mask is applied irrespective of whether
// blending_enabled is set.
final_color = final_color & write_mask;

The default blend mode is 1 - source alpha.

Definition at line 512 of file formats.h.

Member Function Documentation

◆ Hash()

constexpr size_t impeller::ColorAttachmentDescriptor::Hash ( ) const
inlineconstexpr

Definition at line 538 of file formats.h.

◆ operator==()

constexpr bool impeller::ColorAttachmentDescriptor::operator== ( const ColorAttachmentDescriptor o) const
inlineconstexpr

Definition at line 526 of file formats.h.

526 {
527 return format == o.format && //
528 blending_enabled == o.blending_enabled && //
529 src_color_blend_factor == o.src_color_blend_factor && //
530 color_blend_op == o.color_blend_op && //
531 dst_color_blend_factor == o.dst_color_blend_factor && //
532 src_alpha_blend_factor == o.src_alpha_blend_factor && //
533 alpha_blend_op == o.alpha_blend_op && //
534 dst_alpha_blend_factor == o.dst_alpha_blend_factor && //
535 write_mask == o.write_mask;
536 }

Member Data Documentation

◆ alpha_blend_op

BlendOperation impeller::ColorAttachmentDescriptor::alpha_blend_op = BlendOperation::kAdd

Definition at line 521 of file formats.h.

◆ blending_enabled

bool impeller::ColorAttachmentDescriptor::blending_enabled = false

Definition at line 514 of file formats.h.

◆ color_blend_op

BlendOperation impeller::ColorAttachmentDescriptor::color_blend_op = BlendOperation::kAdd

Definition at line 517 of file formats.h.

◆ dst_alpha_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha

Definition at line 522 of file formats.h.

◆ dst_color_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha

Definition at line 518 of file formats.h.

◆ format

PixelFormat impeller::ColorAttachmentDescriptor::format = PixelFormat::kUnknown

Definition at line 513 of file formats.h.

◆ src_alpha_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::src_alpha_blend_factor = BlendFactor::kSourceAlpha

Definition at line 520 of file formats.h.

◆ src_color_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::src_color_blend_factor = BlendFactor::kSourceAlpha

Definition at line 516 of file formats.h.

◆ write_mask

ColorWriteMask impeller::ColorAttachmentDescriptor::write_mask = ColorWriteMaskBits::kAll

Definition at line 524 of file formats.h.


The documentation for this struct was generated from the following file: