| Flutter Impeller |

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:

if (blending_enabled) {
final_color.rgb = (src_color_blend_factor * new_color.rgb)
<color_blend_op>
(dst_color_blend_factor * old_color.rgb);
final_color.a = (src_alpha_blend_factor * new_color.a)
<alpha_blend_op>
(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;
impeller::ColorAttachmentDescriptor::blending_enabled
bool blending_enabled
Definition: formats.h:524
impeller::ColorAttachmentDescriptor::color_blend_op
BlendOperation color_blend_op
Definition: formats.h:527
impeller::ColorAttachmentDescriptor::dst_color_blend_factor
BlendFactor dst_color_blend_factor
Definition: formats.h:528
impeller::ColorAttachmentDescriptor::write_mask
ColorWriteMask write_mask
Definition: formats.h:534
impeller::ColorAttachmentDescriptor::src_alpha_blend_factor
BlendFactor src_alpha_blend_factor
Definition: formats.h:530
impeller::ColorAttachmentDescriptor::alpha_blend_op
BlendOperation alpha_blend_op
Definition: formats.h:531
impeller::ColorAttachmentDescriptor::src_color_blend_factor
BlendFactor src_color_blend_factor
Definition: formats.h:526
impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor
BlendFactor dst_alpha_blend_factor
Definition: formats.h:532

The default blend mode is 1 - source alpha.

Definition at line 522 of file formats.h.

## Member Function Documentation

## ◆ Hash()

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

Definition at line 548 of file formats.h.

548 {
549 return fml::HashCombine(
550 format, blending_enabled, src_color_blend_factor, color_blend_op,
551 dst_color_blend_factor, src_alpha_blend_factor, alpha_blend_op,
552 dst_alpha_blend_factor, static_cast<uint64_t>(write_mask));
553 }
impeller::ColorAttachmentDescriptor::format
PixelFormat format
Definition: formats.h:523

References alpha_blend_op, blending_enabled, color_blend_op, dst_alpha_blend_factor, dst_color_blend_factor, format, src_alpha_blend_factor, src_color_blend_factor, and write_mask.

## ◆ operator==()

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

Definition at line 536 of file formats.h.

536 {
537 return format == o.format && //
538 blending_enabled == o.blending_enabled && //
539 src_color_blend_factor == o.src_color_blend_factor && //
540 color_blend_op == o.color_blend_op && //
541 dst_color_blend_factor == o.dst_color_blend_factor && //
542 src_alpha_blend_factor == o.src_alpha_blend_factor && //
543 alpha_blend_op == o.alpha_blend_op && //
544 dst_alpha_blend_factor == o.dst_alpha_blend_factor && //
545 write_mask == o.write_mask;
546 }

References alpha_blend_op, blending_enabled, color_blend_op, dst_alpha_blend_factor, dst_color_blend_factor, format, src_alpha_blend_factor, src_color_blend_factor, and write_mask.

## Member Data Documentation

## ◆ alpha_blend_op

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

Definition at line 531 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ blending_enabled

bool impeller::ColorAttachmentDescriptor::blending_enabled = false

Definition at line 524 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::InitializePipelineDescriptorDefaults(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ color_blend_op

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

Definition at line 527 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ dst_alpha_blend_factor

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

Definition at line 532 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ dst_color_blend_factor

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

Definition at line 528 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ format

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

Definition at line 523 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::InitializePipelineDescriptorDefaults(), operator==(), impeller::testing::TEST_P(), and impeller::ToMTLRenderPipelineColorAttachmentDescriptor().

## ◆ src_alpha_blend_factor

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

Definition at line 530 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ src_color_blend_factor

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

Definition at line 526 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ write_mask

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

Definition at line 534 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ConfigureBlending(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

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

- impeller/core/formats.h