Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 500 of file formats.h.

Member Function Documentation

◆ Hash()

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

Definition at line 526 of file formats.h.

◆ operator==()

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

Definition at line 514 of file formats.h.

514 {
515 return format == o.format && //
516 blending_enabled == o.blending_enabled && //
517 src_color_blend_factor == o.src_color_blend_factor && //
518 color_blend_op == o.color_blend_op && //
519 dst_color_blend_factor == o.dst_color_blend_factor && //
520 src_alpha_blend_factor == o.src_alpha_blend_factor && //
521 alpha_blend_op == o.alpha_blend_op && //
522 dst_alpha_blend_factor == o.dst_alpha_blend_factor && //
523 write_mask == o.write_mask;
524 }

Member Data Documentation

◆ alpha_blend_op

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

Definition at line 509 of file formats.h.

◆ blending_enabled

bool impeller::ColorAttachmentDescriptor::blending_enabled = false

Definition at line 502 of file formats.h.

◆ color_blend_op

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

Definition at line 505 of file formats.h.

◆ dst_alpha_blend_factor

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

Definition at line 510 of file formats.h.

◆ dst_color_blend_factor

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

Definition at line 506 of file formats.h.

◆ format

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

Definition at line 501 of file formats.h.

◆ src_alpha_blend_factor

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

Definition at line 508 of file formats.h.

◆ src_color_blend_factor

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

Definition at line 504 of file formats.h.

◆ write_mask

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

Definition at line 512 of file formats.h.


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