| Flutter Impeller |

Public Types | Public Member Functions | Public Attributes | List of all members
impeller::ContentContextOptions Struct Reference

`#include <content_context.h>`

## Public Types
enum class | StencilMode : uint8_t { kIgnore , kStencilNonZeroFill , kStencilEvenOddFill , kCoverCompare , kCoverCompareInverted , kOverdrawPreventionIncrement , kOverdrawPreventionRestore }

## Public Member Functions
constexpr uint64_t | ToKey () const
void | ApplyToPipelineDescriptor (PipelineDescriptor &desc) const

## Public Attributes
SampleCount | sample_count = SampleCount::kCount1
BlendMode | blend_mode = BlendMode::kSrcOver
CompareFunction | depth_compare = CompareFunction::kAlways
StencilMode | stencil_mode = ContentContextOptions::StencilMode::kIgnore
PrimitiveType | primitive_type = PrimitiveType::kTriangle
PixelFormat | color_attachment_pixel_format = PixelFormat::kUnknown
bool | has_depth_stencil_attachments = true
bool | depth_write_enabled = false
bool | is_for_rrect_blur_clear = false

## Detailed Description

Pipeline state configuration.

Each unique combination of these options requires a different pipeline state object to be built. This struct is used as a key for the per-pipeline variant cache.

When adding fields to this key, reliant features should take care to limit the combinatorical explosion of variations. A sufficiently complicated Flutter application may easily require building hundreds of PSOs in total, but they shouldn't require e.g. 10s of thousands.

Definition at line 40 of file content_context.h.

## Member Enumeration Documentation

## ◆ StencilMode

enum impeller::ContentContextOptions::StencilMode : uint8_t
| strong

Enumerator
kIgnore | Turn the stencil test off. Used when drawing without stencil-then-cover or overdraw prevention.
kStencilNonZeroFill | Draw the stencil for the NonZero fill path rule.
    The stencil ref should always be 0 on commands using this mode.
kStencilEvenOddFill | Draw the stencil for the EvenOdd fill path rule.
    The stencil ref should always be 0 on commands using this mode.
kCoverCompare | Used for draw calls which fill in the stenciled area. Intended to be used after `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set up the stencil buffer. Also cleans up the stencil buffer by resetting everything to zero. The stencil ref should always be 0 on commands using this mode.
kCoverCompareInverted | The opposite of `kCoverCompare`. Used for draw calls which fill in the non-stenciled area (intersection clips). Intended to be used after `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set up the stencil buffer. Also cleans up the stencil buffer by resetting everything to zero. The stencil ref should always be 0 on commands using this mode.
kOverdrawPreventionIncrement | For each fragment, increment the stencil value if it's currently zero. Discard fragments when the value is non-zero. This prevents self-overlapping strokes from drawing over themselves. Note that this is done for rendering correctness, not performance. If a stroke is drawn with a backdrop-reliant blend and self-intersects, then the intersected geometry will render incorrectly when overdrawn because we don't adjust the geometry prevent self-intersection. The stencil ref should always be 0 on commands using this mode.
kOverdrawPreventionRestore | Reset the stencil to a new maximum value specified by the ref (currently always 0). The stencil ref should always be 0 on commands using this mode.

Definition at line 41 of file content_context.h.

41 : uint8_t {
42 /// Turn the stencil test off. Used when drawing without stencil-then-cover
43 /// or overdraw prevention.
44 kIgnore,
45
46 // Operations used for stencil-then-cover.
47
48 /// Draw the stencil for the NonZero fill path rule.
49 ///
50 /// The stencil ref should always be 0 on commands using this mode.
51 kStencilNonZeroFill,
52 /// Draw the stencil for the EvenOdd fill path rule.
53 ///
54 /// The stencil ref should always be 0 on commands using this mode.
55 kStencilEvenOddFill,
56 /// Used for draw calls which fill in the stenciled area. Intended to be
57 /// used after `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set
58 /// up the stencil buffer. Also cleans up the stencil buffer by resetting
59 /// everything to zero.
60 ///
61 /// The stencil ref should always be 0 on commands using this mode.
62 kCoverCompare,
63 /// The opposite of `kCoverCompare`. Used for draw calls which fill in the
64 /// non-stenciled area (intersection clips). Intended to be used after
65 /// `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set up the
66 /// stencil buffer. Also cleans up the stencil buffer by resetting
67 /// everything to zero.
68 ///
69 /// The stencil ref should always be 0 on commands using this mode.
70 kCoverCompareInverted,
71
72 // Operations used for the "overdraw prevention" mechanism. This is used for
73 // drawing strokes.
74
75 /// For each fragment, increment the stencil value if it's currently zero.
76 /// Discard fragments when the value is non-zero. This prevents
77 /// self-overlapping strokes from drawing over themselves.
78 ///
79 /// Note that this is done for rendering correctness, not performance. If a
80 /// stroke is drawn with a backdrop-reliant blend and self-intersects, then
81 /// the intersected geometry will render incorrectly when overdrawn because
82 /// we don't adjust the geometry prevent self-intersection.
83 ///
84 /// The stencil ref should always be 0 on commands using this mode.
85 kOverdrawPreventionIncrement,
86 /// Reset the stencil to a new maximum value specified by the ref (currently
87 /// always 0).
88 ///
89 /// The stencil ref should always be 0 on commands using this mode.
90 kOverdrawPreventionRestore,
91 };

## Member Function Documentation

## ◆ ApplyToPipelineDescriptor()

void impeller::ContentContextOptions::ApplyToPipelineDescriptor | ( | PipelineDescriptor & | desc | ) | const

Definition at line 311 of file content_context.cc.

312 {
313 auto pipeline_blend = blend_mode;
314 if (blend_mode > Entity::kLastPipelineBlendMode) {
315 VALIDATION_LOG << "Cannot use blend mode " << static_cast<int>(blend_mode)
316 << " as a pipeline blend.";
317 pipeline_blend = BlendMode::kSrcOver;
318 }
319
320 desc.SetSampleCount(sample_count);
321
322 ColorAttachmentDescriptor color0 = *desc.GetColorAttachmentDescriptor(0u);
323 color0.format = color_attachment_pixel_format;
324 color0.alpha_blend_op = BlendOperation::kAdd;
325 color0.color_blend_op = BlendOperation::kAdd;
326 color0.write_mask = ColorWriteMaskBits::kAll;
327
328 switch (pipeline_blend) {
329 case BlendMode::kClear:
330 if (is_for_rrect_blur_clear) {
331 color0.alpha_blend_op = BlendOperation::kReverseSubtract;
332 color0.color_blend_op = BlendOperation::kReverseSubtract;
333 color0.dst_alpha_blend_factor = BlendFactor::kOne;
334 color0.dst_color_blend_factor = BlendFactor::kOne;
335 color0.src_alpha_blend_factor = BlendFactor::kDestinationColor;
336 color0.src_color_blend_factor = BlendFactor::kDestinationColor;
337 } else {
338 color0.dst_alpha_blend_factor = BlendFactor::kZero;
339 color0.dst_color_blend_factor = BlendFactor::kZero;
340 color0.src_alpha_blend_factor = BlendFactor::kZero;
341 color0.src_color_blend_factor = BlendFactor::kZero;
342 }
343 break;
344 case BlendMode::kSrc:
345 color0.blending_enabled = false;
346 color0.dst_alpha_blend_factor = BlendFactor::kZero;
347 color0.dst_color_blend_factor = BlendFactor::kZero;
348 color0.src_alpha_blend_factor = BlendFactor::kOne;
349 color0.src_color_blend_factor = BlendFactor::kOne;
350 break;
351 case BlendMode::kDst:
352 color0.dst_alpha_blend_factor = BlendFactor::kOne;
353 color0.dst_color_blend_factor = BlendFactor::kOne;
354 color0.src_alpha_blend_factor = BlendFactor::kZero;
355 color0.src_color_blend_factor = BlendFactor::kZero;
356 color0.write_mask = ColorWriteMaskBits::kNone;
357 break;
358 case BlendMode::kSrcOver:
359 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
360 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
361 color0.src_alpha_blend_factor = BlendFactor::kOne;
362 color0.src_color_blend_factor = BlendFactor::kOne;
363 break;
364 case BlendMode::kDstOver:
365 color0.dst_alpha_blend_factor = BlendFactor::kOne;
366 color0.dst_color_blend_factor = BlendFactor::kOne;
367 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
368 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
369 break;
370 case BlendMode::kSrcIn:
371 color0.dst_alpha_blend_factor = BlendFactor::kZero;
372 color0.dst_color_blend_factor = BlendFactor::kZero;
373 color0.src_alpha_blend_factor = BlendFactor::kDestinationAlpha;
374 color0.src_color_blend_factor = BlendFactor::kDestinationAlpha;
375 break;
376 case BlendMode::kDstIn:
377 color0.dst_alpha_blend_factor = BlendFactor::kSourceAlpha;
378 color0.dst_color_blend_factor = BlendFactor::kSourceAlpha;
379 color0.src_alpha_blend_factor = BlendFactor::kZero;
380 color0.src_color_blend_factor = BlendFactor::kZero;
381 break;
382 case BlendMode::kSrcOut:
383 color0.dst_alpha_blend_factor = BlendFactor::kZero;
384 color0.dst_color_blend_factor = BlendFactor::kZero;
385 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
386 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
387 break;
388 case BlendMode::kDstOut:
389 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
390 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
391 color0.src_alpha_blend_factor = BlendFactor::kZero;
392 color0.src_color_blend_factor = BlendFactor::kZero;
393 break;
394 case BlendMode::kSrcATop:
395 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
396 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
397 color0.src_alpha_blend_factor = BlendFactor::kDestinationAlpha;
398 color0.src_color_blend_factor = BlendFactor::kDestinationAlpha;
399 break;
400 case BlendMode::kDstATop:
401 color0.dst_alpha_blend_factor = BlendFactor::kSourceAlpha;
402 color0.dst_color_blend_factor = BlendFactor::kSourceAlpha;
403 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
404 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
405 break;
406 case BlendMode::kXor:
407 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
408 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
409 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
410 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
411 break;
412 case BlendMode::kPlus:
413 color0.dst_alpha_blend_factor = BlendFactor::kOne;
414 color0.dst_color_blend_factor = BlendFactor::kOne;
415 color0.src_alpha_blend_factor = BlendFactor::kOne;
416 color0.src_color_blend_factor = BlendFactor::kOne;
417 break;
418 case BlendMode::kModulate:
419 color0.dst_alpha_blend_factor = BlendFactor::kSourceAlpha;
420 color0.dst_color_blend_factor = BlendFactor::kSourceColor;
421 color0.src_alpha_blend_factor = BlendFactor::kZero;
422 color0.src_color_blend_factor = BlendFactor::kZero;
423 break;
424 default:
425 FML_UNREACHABLE();
426 }
427 desc.SetColorAttachmentDescriptor(0u, color0);
428
429 if (!has_depth_stencil_attachments) {
430 desc.ClearDepthAttachment();
431 desc.ClearStencilAttachments();
432 }
433
434 auto maybe_stencil = desc.GetFrontStencilAttachmentDescriptor();
435 auto maybe_depth = desc.GetDepthStencilAttachmentDescriptor();
436 FML_DCHECK(has_depth_stencil_attachments == maybe_depth.has_value())
437 << "Depth attachment doesn't match expected pipeline state. "
438 "has_depth_stencil_attachments="
439 << has_depth_stencil_attachments;
440 FML_DCHECK(has_depth_stencil_attachments == maybe_stencil.has_value())
441 << "Stencil attachment doesn't match expected pipeline state. "
442 "has_depth_stencil_attachments="
443 << has_depth_stencil_attachments;
444 if (maybe_stencil.has_value()) {
445 StencilAttachmentDescriptor front_stencil = maybe_stencil.value();
446 StencilAttachmentDescriptor back_stencil = front_stencil;
447
448 switch (stencil_mode) {
449 case StencilMode::kIgnore:
450 front_stencil.stencil_compare = CompareFunction::kAlways;
451 front_stencil.depth_stencil_pass = StencilOperation::kKeep;
452 desc.SetStencilAttachmentDescriptors(front_stencil);
453 break;
454 case StencilMode::kStencilNonZeroFill:
455 // The stencil ref should be 0 on commands that use this mode.
456 front_stencil.stencil_compare = CompareFunction::kAlways;
457 front_stencil.depth_stencil_pass = StencilOperation::kIncrementWrap;
458 back_stencil.stencil_compare = CompareFunction::kAlways;
459 back_stencil.depth_stencil_pass = StencilOperation::kDecrementWrap;
460 desc.SetStencilAttachmentDescriptors(front_stencil, back_stencil);
461 break;
462 case StencilMode::kStencilEvenOddFill:
463 // The stencil ref should be 0 on commands that use this mode.
464 front_stencil.stencil_compare = CompareFunction::kEqual;
465 front_stencil.depth_stencil_pass = StencilOperation::kIncrementWrap;
466 front_stencil.stencil_failure = StencilOperation::kDecrementWrap;
467 desc.SetStencilAttachmentDescriptors(front_stencil);
468 break;
469 case StencilMode::kCoverCompare:
470 // The stencil ref should be 0 on commands that use this mode.
471 front_stencil.stencil_compare = CompareFunction::kNotEqual;
472 front_stencil.depth_stencil_pass =
473 StencilOperation::kSetToReferenceValue;
474 desc.SetStencilAttachmentDescriptors(front_stencil);
475 break;
476 case StencilMode::kCoverCompareInverted:
477 // The stencil ref should be 0 on commands that use this mode.
478 front_stencil.stencil_compare = CompareFunction::kEqual;
479 front_stencil.stencil_failure = StencilOperation::kSetToReferenceValue;
480 desc.SetStencilAttachmentDescriptors(front_stencil);
481 break;
482 case StencilMode::kOverdrawPreventionIncrement:
483 front_stencil.stencil_compare = CompareFunction::kEqual;
484 front_stencil.depth_stencil_pass = StencilOperation::kIncrementClamp;
485 desc.SetStencilAttachmentDescriptors(front_stencil);
486 break;
487 case StencilMode::kOverdrawPreventionRestore:
488 front_stencil.stencil_compare = CompareFunction::kLess;
489 front_stencil.depth_stencil_pass =
490 StencilOperation::kSetToReferenceValue;
491 desc.SetStencilAttachmentDescriptors(front_stencil);
492 break;
493 }
494 }
495 if (maybe_depth.has_value()) {
496 DepthAttachmentDescriptor depth = maybe_depth.value();
497 depth.depth_write_enabled = depth_write_enabled;
498 depth.depth_compare = depth_compare;
499 desc.SetDepthStencilAttachmentDescriptor(depth);
500 }
501
502 desc.SetPrimitiveType(primitive_type);
503 desc.SetPolygonMode(PolygonMode::kFill);
504 }
impeller::Entity::kLastPipelineBlendMode
static constexpr BlendMode kLastPipelineBlendMode
Definition: entity.h:28
impeller::BlendFactor::kDestinationColor
@ kDestinationColor
impeller::BlendFactor::kOne
@ kOne
impeller::BlendFactor::kSourceColor
@ kSourceColor
impeller::BlendFactor::kZero
@ kZero
impeller::BlendFactor::kDestinationAlpha
@ kDestinationAlpha
impeller::BlendFactor::kSourceAlpha
@ kSourceAlpha
impeller::BlendFactor::kOneMinusDestinationAlpha
@ kOneMinusDestinationAlpha
impeller::BlendFactor::kOneMinusSourceAlpha
@ kOneMinusSourceAlpha
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.
impeller::CompareFunction::kNotEqual
@ kNotEqual
Comparison test passes if new_value != current_value.
impeller::StencilOperation::kDecrementWrap
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
impeller::StencilOperation::kSetToReferenceValue
@ kSetToReferenceValue
Reset the stencil value to the reference value.
impeller::StencilOperation::kIncrementClamp
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
impeller::StencilOperation::kIncrementWrap
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::BlendMode::kSrcOut
@ kSrcOut
impeller::BlendMode::kPlus
@ kPlus
impeller::BlendMode::kDst
@ kDst
impeller::BlendMode::kDstIn
@ kDstIn
impeller::BlendMode::kModulate
@ kModulate
impeller::BlendMode::kSrcOver
@ kSrcOver
impeller::BlendMode::kXor
@ kXor
impeller::BlendMode::kSrc
@ kSrc
impeller::BlendMode::kSrcATop
@ kSrcATop
impeller::BlendMode::kDstATop
@ kDstATop
impeller::BlendMode::kDstOver
@ kDstOver
impeller::BlendMode::kDstOut
@ kDstOut
impeller::BlendMode::kSrcIn
@ kSrcIn
impeller::BlendMode::kClear
@ kClear
impeller::PolygonMode::kFill
@ kFill
impeller::ColorWriteMaskBits::kAll
@ kAll
impeller::ColorWriteMaskBits::kNone
@ kNone
impeller::BlendOperation::kAdd
@ kAdd
impeller::BlendOperation::kReverseSubtract
@ kReverseSubtract
impeller::ContentContextOptions::primitive_type
PrimitiveType primitive_type
Definition: content_context.h:97
impeller::ContentContextOptions::has_depth_stencil_attachments
bool has_depth_stencil_attachments
Definition: content_context.h:99
impeller::ContentContextOptions::stencil_mode
StencilMode stencil_mode
Definition: content_context.h:96
impeller::ContentContextOptions::depth_write_enabled
bool depth_write_enabled
Definition: content_context.h:100
impeller::ContentContextOptions::blend_mode
BlendMode blend_mode
Definition: content_context.h:94
impeller::ContentContextOptions::color_attachment_pixel_format
PixelFormat color_attachment_pixel_format
Definition: content_context.h:98
impeller::ContentContextOptions::StencilMode::kOverdrawPreventionRestore
@ kOverdrawPreventionRestore
impeller::ContentContextOptions::StencilMode::kStencilEvenOddFill
@ kStencilEvenOddFill
impeller::ContentContextOptions::StencilMode::kOverdrawPreventionIncrement
@ kOverdrawPreventionIncrement
impeller::ContentContextOptions::StencilMode::kCoverCompareInverted
@ kCoverCompareInverted
impeller::ContentContextOptions::StencilMode::kStencilNonZeroFill
@ kStencilNonZeroFill
impeller::ContentContextOptions::StencilMode::kIgnore
@ kIgnore
impeller::ContentContextOptions::StencilMode::kCoverCompare
@ kCoverCompare
impeller::ContentContextOptions::sample_count
SampleCount sample_count
Definition: content_context.h:93
impeller::ContentContextOptions::is_for_rrect_blur_clear
bool is_for_rrect_blur_clear
Definition: content_context.h:101
impeller::ContentContextOptions::depth_compare
CompareFunction depth_compare
Definition: content_context.h:95
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91

References impeller::ColorAttachmentDescriptor::alpha_blend_op, blend_mode, impeller::ColorAttachmentDescriptor::blending_enabled, impeller::PipelineDescriptor::ClearDepthAttachment(), impeller::PipelineDescriptor::ClearStencilAttachments(), color_attachment_pixel_format, impeller::ColorAttachmentDescriptor::color_blend_op, impeller::DepthAttachmentDescriptor::depth_compare, depth_compare, impeller::StencilAttachmentDescriptor::depth_stencil_pass, impeller::DepthAttachmentDescriptor::depth_write_enabled, depth_write_enabled, impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor, impeller::ColorAttachmentDescriptor::dst_color_blend_factor, impeller::ColorAttachmentDescriptor::format, impeller::PipelineDescriptor::GetColorAttachmentDescriptor(), impeller::PipelineDescriptor::GetDepthStencilAttachmentDescriptor(), impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor(), has_depth_stencil_attachments, is_for_rrect_blur_clear, impeller::kAdd, impeller::kAll, impeller::kAlways, impeller::kClear, kCoverCompare, kCoverCompareInverted, impeller::kDecrementWrap, impeller::kDestinationAlpha, impeller::kDestinationColor, impeller::kDst, impeller::kDstATop, impeller::kDstIn, impeller::kDstOut, impeller::kDstOver, impeller::kEqual, impeller::kFill, kIgnore, impeller::kIncrementClamp, impeller::kIncrementWrap, impeller::kKeep, impeller::Entity::kLastPipelineBlendMode, impeller::kLess, impeller::kModulate, impeller::kNone, impeller::kNotEqual, impeller::kOne, impeller::kOneMinusDestinationAlpha, impeller::kOneMinusSourceAlpha, kOverdrawPreventionIncrement, kOverdrawPreventionRestore, impeller::kPlus, impeller::kReverseSubtract, impeller::kSetToReferenceValue, impeller::kSourceAlpha, impeller::kSourceColor, impeller::kSrc, impeller::kSrcATop, impeller::kSrcIn, impeller::kSrcOut, impeller::kSrcOver, kStencilEvenOddFill, kStencilNonZeroFill, impeller::kXor, impeller::kZero, primitive_type, sample_count, impeller::PipelineDescriptor::SetColorAttachmentDescriptor(), impeller::PipelineDescriptor::SetDepthStencilAttachmentDescriptor(), impeller::PipelineDescriptor::SetPolygonMode(), impeller::PipelineDescriptor::SetPrimitiveType(), impeller::PipelineDescriptor::SetSampleCount(), impeller::PipelineDescriptor::SetStencilAttachmentDescriptors(), impeller::ColorAttachmentDescriptor::src_alpha_blend_factor, impeller::ColorAttachmentDescriptor::src_color_blend_factor, impeller::StencilAttachmentDescriptor::stencil_compare, impeller::StencilAttachmentDescriptor::stencil_failure, stencil_mode, VALIDATION_LOG, and impeller::ColorAttachmentDescriptor::write_mask.

## ◆ ToKey()

constexpr uint64_t impeller::ContentContextOptions::ToKey | ( |  | ) | const
| inline constexpr

Definition at line 103 of file content_context.h.

103 {
104 static_assert(sizeof(sample_count) == 1);
105 static_assert(sizeof(blend_mode) == 1);
106 static_assert(sizeof(sample_count) == 1);
107 static_assert(sizeof(depth_compare) == 1);
108 static_assert(sizeof(stencil_mode) == 1);
109 static_assert(sizeof(primitive_type) == 1);
110 static_assert(sizeof(color_attachment_pixel_format) == 1);
111
112 return (is_for_rrect_blur_clear ? 1llu : 0llu) << 0 |
113 (0) << 1 | // // Unused, previously wireframe.
114 (has_depth_stencil_attachments ? 1llu : 0llu) << 2 |
115 (depth_write_enabled ? 1llu : 0llu) << 3 |
116 // enums
117 static_cast<uint64_t>(color_attachment_pixel_format) << 8 |
118 static_cast<uint64_t>(primitive_type) << 16 |
119 static_cast<uint64_t>(stencil_mode) << 24 |
120 static_cast<uint64_t>(depth_compare) << 32 |
121 static_cast<uint64_t>(blend_mode) << 40 |
122 static_cast<uint64_t>(sample_count) << 48;
123 }

References blend_mode, color_attachment_pixel_format, depth_compare, depth_write_enabled, has_depth_stencil_attachments, is_for_rrect_blur_clear, primitive_type, sample_count, and stencil_mode.

Referenced by impeller::testing::TEST_P().

## Member Data Documentation

## ◆ blend_mode

BlendMode impeller::ContentContextOptions::blend_mode = BlendMode::kSrcOver

Definition at line 94 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::OptionsFromPassAndEntity(), impeller::testing::TEST_P(), and ToKey().

## ◆ color_attachment_pixel_format

PixelFormat impeller::ContentContextOptions::color_attachment_pixel_format = PixelFormat::kUnknown

Definition at line 98 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::RuntimeEffectContents::BootstrapShader(), impeller::OptionsFromPass(), and ToKey().

## ◆ depth_compare

CompareFunction impeller::ContentContextOptions::depth_compare = CompareFunction::kAlways

Definition at line 95 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::OptionsFromPass(), and ToKey().

## ◆ depth_write_enabled

bool impeller::ContentContextOptions::depth_write_enabled = false

Definition at line 100 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), and ToKey().

## ◆ has_depth_stencil_attachments

bool impeller::ContentContextOptions::has_depth_stencil_attachments = true

Definition at line 99 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::OptionsFromPass(), impeller::testing::TEST_P(), and ToKey().

## ◆ is_for_rrect_blur_clear

bool impeller::ContentContextOptions::is_for_rrect_blur_clear = false

Definition at line 101 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::SolidRRectLikeBlurContents::Render(), and ToKey().

## ◆ primitive_type

PrimitiveType impeller::ContentContextOptions::primitive_type = PrimitiveType::kTriangle

Definition at line 97 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::SolidRRectLikeBlurContents::Render(), impeller::testing::TEST_P(), and ToKey().

## ◆ sample_count

SampleCount impeller::ContentContextOptions::sample_count = SampleCount::kCount1

Definition at line 93 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::ContentContext::ContentContext(), impeller::CreateDefaultPipeline(), impeller::OptionsFromPass(), and ToKey().

## ◆ stencil_mode

StencilMode impeller::ContentContextOptions::stencil_mode = ContentContextOptions::StencilMode::kIgnore

Definition at line 96 of file content_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::OptionsFromPass(), and ToKey().

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

- impeller/entity/contents/content_context.h
- impeller/entity/contents/content_context.cc