Flutter Impeller
impeller::ContentContext Class Reference

#include <content_context.h>

Inheritance diagram for impeller::ContentContext:
impeller::testing::FlushTestContentContext

Classes

struct  Pipelines
 

Public Types

using SubpassCallback = std::function< bool(const ContentContext &, RenderPass &)>
 

Public Member Functions

 ContentContext (std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
 
 ~ContentContext ()
 
bool IsValid () const
 
TessellatorGetTessellator () const
 
PipelineRef GetBlendColorBurnPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendColorDodgePipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendColorPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendDarkenPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendDifferencePipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendExclusionPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendHardLightPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendHuePipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendLightenPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendLuminosityPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendMultiplyPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendOverlayPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendSaturationPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendScreenPipeline (ContentContextOptions opts) const
 
PipelineRef GetBlendSoftLightPipeline (ContentContextOptions opts) const
 
PipelineRef GetBorderMaskBlurPipeline (ContentContextOptions opts) const
 
PipelineRef GetClearBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetClipPipeline (ContentContextOptions opts) const
 
PipelineRef GetColorMatrixColorFilterPipeline (ContentContextOptions opts) const
 
PipelineRef GetConicalGradientFillPipeline (ContentContextOptions opts, ConicalKind kind) const
 
PipelineRef GetConicalGradientSSBOFillPipeline (ContentContextOptions opts, ConicalKind kind) const
 
PipelineRef GetConicalGradientUniformFillPipeline (ContentContextOptions opts, ConicalKind kind) const
 
PipelineRef GetDestinationATopBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetDestinationBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetDestinationInBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetDestinationOutBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetDestinationOverBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetDownsamplePipeline (ContentContextOptions opts) const
 
PipelineRef GetDrawVerticesUberPipeline (BlendMode blend_mode, ContentContextOptions opts) const
 
PipelineRef GetFastGradientPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendColorBurnPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendColorDodgePipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendColorPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendDarkenPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendDifferencePipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendExclusionPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendHardLightPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendHuePipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendLightenPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendLuminosityPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendMultiplyPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendOverlayPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendSaturationPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendScreenPipeline (ContentContextOptions opts) const
 
PipelineRef GetFramebufferBlendSoftLightPipeline (ContentContextOptions opts) const
 
PipelineRef GetGaussianBlurPipeline (ContentContextOptions opts) const
 
PipelineRef GetGlyphAtlasPipeline (ContentContextOptions opts) const
 
PipelineRef GetLinePipeline (ContentContextOptions opts) const
 
PipelineRef GetLinearGradientFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetLinearGradientSSBOFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetLinearGradientUniformFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetLinearToSrgbFilterPipeline (ContentContextOptions opts) const
 
PipelineRef GetModulateBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetMorphologyFilterPipeline (ContentContextOptions opts) const
 
PipelineRef GetPlusBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetPorterDuffPipeline (BlendMode mode, ContentContextOptions opts) const
 
PipelineRef GetRadialGradientFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetRadialGradientSSBOFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetRadialGradientUniformFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetRRectBlurPipeline (ContentContextOptions opts) const
 
PipelineRef GetRSuperellipseBlurPipeline (ContentContextOptions opts) const
 
PipelineRef GetScreenBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetSolidFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetSourceATopBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetSourceBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetSourceInBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetSourceOutBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetSourceOverBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetSrgbToLinearFilterPipeline (ContentContextOptions opts) const
 
PipelineRef GetSweepGradientFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetSweepGradientSSBOFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetSweepGradientUniformFillPipeline (ContentContextOptions opts) const
 
PipelineRef GetTexturePipeline (ContentContextOptions opts) const
 
PipelineRef GetTextureStrictSrcPipeline (ContentContextOptions opts) const
 
PipelineRef GetTiledTexturePipeline (ContentContextOptions opts) const
 
PipelineRef GetXorBlendPipeline (ContentContextOptions opts) const
 
PipelineRef GetYUVToRGBFilterPipeline (ContentContextOptions opts) const
 
std::shared_ptr< TextureGetEmptyTexture () const
 
std::shared_ptr< ContextGetContext () const
 
const CapabilitiesGetDeviceCapabilities () const
 
fml::StatusOr< RenderTargetMakeSubpass (std::string_view label, ISize texture_size, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback, bool msaa_enabled=true, bool depth_stencil_enabled=false, int32_t mip_count=1) const
 Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing to the texture. More...
 
fml::StatusOr< RenderTargetMakeSubpass (std::string_view label, const RenderTarget &subpass_target, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback) const
 Makes a subpass that will render to subpass_target. More...
 
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas () const
 
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache () const
 
PipelineRef GetCachedRuntimeEffectPipeline (const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor >>()> &create_callback) const
 
void ClearCachedRuntimeEffectPipeline (const std::string &unique_entrypoint_name) const
 
HostBufferGetTransientsIndexesBuffer () const
 Retrieve the current host buffer for transient storage of indexes used for indexed draws. More...
 
HostBufferGetTransientsDataBuffer () const
 Retrieve the current host buffer for transient storage of other non-index data. More...
 
void ResetTransientsBuffers ()
 Resets the transients buffers held onto by the content context. More...
 
TextShadowCacheGetTextShadowCache () const
 

Protected Member Functions

void SetTransientsIndexesBuffer (std::shared_ptr< HostBuffer > host_buffer)
 
void SetTransientsDataBuffer (std::shared_ptr< HostBuffer > host_buffer)
 

Detailed Description

Definition at line 138 of file content_context.h.

Member Typedef Documentation

◆ SubpassCallback

Definition at line 244 of file content_context.h.

Constructor & Destructor Documentation

◆ ContentContext()

impeller::ContentContext::ContentContext ( std::shared_ptr< Context context,
std::shared_ptr< TypographerContext typographer_context,
std::shared_ptr< RenderTargetAllocator render_target_allocator = nullptr 
)
explicit

Setup default clip pipeline.

Definition at line 545 of file content_context.cc.

549  : context_(std::move(context)),
550  lazy_glyph_atlas_(
551  std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
552  pipelines_(new Pipelines()),
553  tessellator_(std::make_shared<Tessellator>()),
554  render_target_cache_(render_target_allocator == nullptr
555  ? std::make_shared<RenderTargetCache>(
556  context_->GetResourceAllocator())
557  : std::move(render_target_allocator)),
558  data_host_buffer_(HostBuffer::Create(
559  context_->GetResourceAllocator(),
560  context_->GetIdleWaiter(),
561  context_->GetCapabilities()->GetMinimumUniformAlignment())),
562  text_shadow_cache_(std::make_unique<TextShadowCache>()) {
563  if (!context_ || !context_->IsValid()) {
564  return;
565  }
566 
567  // On most backends, indexes and other data can be allocated into the same
568  // buffers. However, some backends (namely WebGL) require indexes used in
569  // indexed draws to be allocated separately from other data. For those
570  // backends, we allocate a separate host buffer just for indexes.
571  indexes_host_buffer_ =
572  context_->GetCapabilities()->NeedsPartitionedHostBuffer()
574  context_->GetResourceAllocator(), context_->GetIdleWaiter(),
575  context_->GetCapabilities()->GetMinimumUniformAlignment())
576  : data_host_buffer_;
577  {
578  TextureDescriptor desc;
579  desc.storage_mode = StorageMode::kDevicePrivate;
580  desc.format = PixelFormat::kR8G8B8A8UNormInt;
581  desc.size = ISize{1, 1};
582  empty_texture_ = GetContext()->GetResourceAllocator()->CreateTexture(desc);
583 
584  std::array<uint8_t, 4> data = Color::BlackTransparent().ToR8G8B8A8();
585  std::shared_ptr<CommandBuffer> cmd_buffer =
586  GetContext()->CreateCommandBuffer();
587  std::shared_ptr<BlitPass> blit_pass = cmd_buffer->CreateBlitPass();
588  HostBuffer& data_host_buffer = GetTransientsDataBuffer();
589  BufferView buffer_view = data_host_buffer.Emplace(data);
590  blit_pass->AddCopy(buffer_view, empty_texture_);
591 
592  if (!blit_pass->EncodeCommands() || !GetContext()
593  ->GetCommandQueue()
594  ->Submit({std::move(cmd_buffer)})
595  .ok()) {
596  VALIDATION_LOG << "Failed to create empty texture.";
597  }
598  }
599 
600  auto options = ContentContextOptions{
601  .sample_count = SampleCount::kCount4,
602  .color_attachment_pixel_format =
603  context_->GetCapabilities()->GetDefaultColorFormat()};
604  auto options_trianglestrip = ContentContextOptions{
605  .sample_count = SampleCount::kCount4,
606  .primitive_type = PrimitiveType::kTriangleStrip,
607  .color_attachment_pixel_format =
608  context_->GetCapabilities()->GetDefaultColorFormat()};
609  auto options_no_msaa_no_depth_stencil = ContentContextOptions{
610  .sample_count = SampleCount::kCount1,
611  .primitive_type = PrimitiveType::kTriangleStrip,
612  .color_attachment_pixel_format =
613  context_->GetCapabilities()->GetDefaultColorFormat(),
614  .has_depth_stencil_attachments = false};
615  const auto supports_decal = static_cast<Scalar>(
616  context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
617 
618  // Futures for the following pipelines may block in case the first frame is
619  // rendered without the pipelines being ready. Put pipelines that are more
620  // likely to be used first.
621  {
622  pipelines_->glyph_atlas.CreateDefault(
623  *context_, options,
624  {static_cast<Scalar>(
625  GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
627  pipelines_->solid_fill.CreateDefault(*context_, options);
628  pipelines_->texture.CreateDefault(*context_, options);
629  pipelines_->fast_gradient.CreateDefault(*context_, options);
630  pipelines_->line.CreateDefault(*context_, options);
631 
632  if (context_->GetCapabilities()->SupportsSSBO()) {
633  pipelines_->linear_gradient_ssbo_fill.CreateDefault(*context_, options);
634  pipelines_->radial_gradient_ssbo_fill.CreateDefault(*context_, options);
635  pipelines_->conical_gradient_ssbo_fill.CreateDefault(*context_, options,
636  {3.0});
637  pipelines_->conical_gradient_ssbo_fill_radial.CreateDefault(
638  *context_, options, {1.0});
639  pipelines_->conical_gradient_ssbo_fill_strip.CreateDefault(
640  *context_, options, {2.0});
641  pipelines_->conical_gradient_ssbo_fill_strip_and_radial.CreateDefault(
642  *context_, options, {0.0});
643  pipelines_->sweep_gradient_ssbo_fill.CreateDefault(*context_, options);
644  } else {
645  pipelines_->linear_gradient_uniform_fill.CreateDefault(*context_,
646  options);
647  pipelines_->radial_gradient_uniform_fill.CreateDefault(*context_,
648  options);
649  pipelines_->conical_gradient_uniform_fill.CreateDefault(*context_,
650  options);
651  pipelines_->conical_gradient_uniform_fill_radial.CreateDefault(*context_,
652  options);
653  pipelines_->conical_gradient_uniform_fill_strip.CreateDefault(*context_,
654  options);
655  pipelines_->conical_gradient_uniform_fill_strip_and_radial.CreateDefault(
656  *context_, options);
657  pipelines_->sweep_gradient_uniform_fill.CreateDefault(*context_, options);
658 
659  pipelines_->linear_gradient_fill.CreateDefault(*context_, options);
660  pipelines_->radial_gradient_fill.CreateDefault(*context_, options);
661  pipelines_->conical_gradient_fill.CreateDefault(*context_, options);
662  pipelines_->conical_gradient_fill_radial.CreateDefault(*context_,
663  options);
664  pipelines_->conical_gradient_fill_strip.CreateDefault(*context_, options);
665  pipelines_->conical_gradient_fill_strip_and_radial.CreateDefault(
666  *context_, options);
667  pipelines_->sweep_gradient_fill.CreateDefault(*context_, options);
668  }
669 
670  /// Setup default clip pipeline.
671  auto clip_pipeline_descriptor =
673  if (!clip_pipeline_descriptor.has_value()) {
674  return;
675  }
676  ContentContextOptions{
677  .sample_count = SampleCount::kCount4,
678  .color_attachment_pixel_format =
679  context_->GetCapabilities()->GetDefaultColorFormat()}
680  .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
681  // Disable write to all color attachments.
682  auto clip_color_attachments =
683  clip_pipeline_descriptor->GetColorAttachmentDescriptors();
684  for (auto& color_attachment : clip_color_attachments) {
685  color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
686  }
687  clip_pipeline_descriptor->SetColorAttachmentDescriptors(
688  std::move(clip_color_attachments));
689  if (GetContext()->GetFlags().lazy_shader_mode) {
690  pipelines_->clip.SetDefaultDescriptor(clip_pipeline_descriptor);
691  pipelines_->clip.SetDefault(options, nullptr);
692  } else {
693  pipelines_->clip.SetDefault(
694  options,
695  std::make_unique<ClipPipeline>(*context_, clip_pipeline_descriptor));
696  }
697  pipelines_->texture_downsample.CreateDefault(
698  *context_, options_no_msaa_no_depth_stencil);
699  pipelines_->rrect_blur.CreateDefault(*context_, options_trianglestrip);
700  pipelines_->rsuperellipse_blur.CreateDefault(*context_,
701  options_trianglestrip);
702  pipelines_->texture_strict_src.CreateDefault(*context_, options);
703  pipelines_->tiled_texture.CreateDefault(*context_, options,
704  {supports_decal});
705  pipelines_->gaussian_blur.CreateDefault(
706  *context_, options_no_msaa_no_depth_stencil, {supports_decal});
707  pipelines_->border_mask_blur.CreateDefault(*context_,
708  options_trianglestrip);
709  pipelines_->color_matrix_color_filter.CreateDefault(*context_,
710  options_trianglestrip);
711  pipelines_->vertices_uber_1_.CreateDefault(*context_, options,
712  {supports_decal});
713  pipelines_->vertices_uber_2_.CreateDefault(*context_, options,
714  {supports_decal});
715 
716  const std::array<std::vector<Scalar>, 15> porter_duff_constants =
717  GetPorterDuffSpecConstants(supports_decal);
718  pipelines_->clear_blend.CreateDefault(*context_, options_trianglestrip,
719  porter_duff_constants[0]);
720  pipelines_->source_blend.CreateDefault(*context_, options_trianglestrip,
721  porter_duff_constants[1]);
722  pipelines_->destination_blend.CreateDefault(
723  *context_, options_trianglestrip, porter_duff_constants[2]);
724  pipelines_->source_over_blend.CreateDefault(
725  *context_, options_trianglestrip, porter_duff_constants[3]);
726  pipelines_->destination_over_blend.CreateDefault(
727  *context_, options_trianglestrip, porter_duff_constants[4]);
728  pipelines_->source_in_blend.CreateDefault(*context_, options_trianglestrip,
729  porter_duff_constants[5]);
730  pipelines_->destination_in_blend.CreateDefault(
731  *context_, options_trianglestrip, porter_duff_constants[6]);
732  pipelines_->source_out_blend.CreateDefault(*context_, options_trianglestrip,
733  porter_duff_constants[7]);
734  pipelines_->destination_out_blend.CreateDefault(
735  *context_, options_trianglestrip, porter_duff_constants[8]);
736  pipelines_->source_a_top_blend.CreateDefault(
737  *context_, options_trianglestrip, porter_duff_constants[9]);
738  pipelines_->destination_a_top_blend.CreateDefault(
739  *context_, options_trianglestrip, porter_duff_constants[10]);
740  pipelines_->xor_blend.CreateDefault(*context_, options_trianglestrip,
741  porter_duff_constants[11]);
742  pipelines_->plus_blend.CreateDefault(*context_, options_trianglestrip,
743  porter_duff_constants[12]);
744  pipelines_->modulate_blend.CreateDefault(*context_, options_trianglestrip,
745  porter_duff_constants[13]);
746  pipelines_->screen_blend.CreateDefault(*context_, options_trianglestrip,
747  porter_duff_constants[14]);
748  }
749 
750  if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
751  pipelines_->framebuffer_blend_color.CreateDefault(
752  *context_, options_trianglestrip,
753  {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
754  pipelines_->framebuffer_blend_colorburn.CreateDefault(
755  *context_, options_trianglestrip,
756  {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
757  pipelines_->framebuffer_blend_colordodge.CreateDefault(
758  *context_, options_trianglestrip,
759  {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
760  pipelines_->framebuffer_blend_darken.CreateDefault(
761  *context_, options_trianglestrip,
762  {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
763  pipelines_->framebuffer_blend_difference.CreateDefault(
764  *context_, options_trianglestrip,
765  {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
766  pipelines_->framebuffer_blend_exclusion.CreateDefault(
767  *context_, options_trianglestrip,
768  {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
769  pipelines_->framebuffer_blend_hardlight.CreateDefault(
770  *context_, options_trianglestrip,
771  {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
772  pipelines_->framebuffer_blend_hue.CreateDefault(
773  *context_, options_trianglestrip,
774  {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
775  pipelines_->framebuffer_blend_lighten.CreateDefault(
776  *context_, options_trianglestrip,
777  {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
778  pipelines_->framebuffer_blend_luminosity.CreateDefault(
779  *context_, options_trianglestrip,
780  {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
781  pipelines_->framebuffer_blend_multiply.CreateDefault(
782  *context_, options_trianglestrip,
783  {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
784  pipelines_->framebuffer_blend_overlay.CreateDefault(
785  *context_, options_trianglestrip,
786  {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
787  pipelines_->framebuffer_blend_saturation.CreateDefault(
788  *context_, options_trianglestrip,
789  {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
790  pipelines_->framebuffer_blend_screen.CreateDefault(
791  *context_, options_trianglestrip,
792  {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
793  pipelines_->framebuffer_blend_softlight.CreateDefault(
794  *context_, options_trianglestrip,
795  {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
796  } else {
797  pipelines_->blend_color.CreateDefault(
798  *context_, options_trianglestrip,
799  {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
800  pipelines_->blend_colorburn.CreateDefault(
801  *context_, options_trianglestrip,
802  {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
803  pipelines_->blend_colordodge.CreateDefault(
804  *context_, options_trianglestrip,
805  {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
806  pipelines_->blend_darken.CreateDefault(
807  *context_, options_trianglestrip,
808  {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
809  pipelines_->blend_difference.CreateDefault(
810  *context_, options_trianglestrip,
811  {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
812  pipelines_->blend_exclusion.CreateDefault(
813  *context_, options_trianglestrip,
814  {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
815  pipelines_->blend_hardlight.CreateDefault(
816  *context_, options_trianglestrip,
817  {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
818  pipelines_->blend_hue.CreateDefault(
819  *context_, options_trianglestrip,
820  {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
821  pipelines_->blend_lighten.CreateDefault(
822  *context_, options_trianglestrip,
823  {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
824  pipelines_->blend_luminosity.CreateDefault(
825  *context_, options_trianglestrip,
826  {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
827  pipelines_->blend_multiply.CreateDefault(
828  *context_, options_trianglestrip,
829  {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
830  pipelines_->blend_overlay.CreateDefault(
831  *context_, options_trianglestrip,
832  {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
833  pipelines_->blend_saturation.CreateDefault(
834  *context_, options_trianglestrip,
835  {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
836  pipelines_->blend_screen.CreateDefault(
837  *context_, options_trianglestrip,
838  {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
839  pipelines_->blend_softlight.CreateDefault(
840  *context_, options_trianglestrip,
841  {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
842  }
843 
844  pipelines_->morphology_filter.CreateDefault(*context_, options_trianglestrip,
845  {supports_decal});
846  pipelines_->linear_to_srgb_filter.CreateDefault(*context_,
847  options_trianglestrip);
848  pipelines_->srgb_to_linear_filter.CreateDefault(*context_,
849  options_trianglestrip);
850  pipelines_->yuv_to_rgb_filter.CreateDefault(*context_, options_trianglestrip);
851 
852 #if defined(IMPELLER_ENABLE_OPENGLES)
853  if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
854 #if !defined(FML_OS_MACOSX)
855  // GLES only shader that is unsupported on macOS.
856  pipelines_->tiled_texture_external.CreateDefault(*context_, options);
857  pipelines_->tiled_texture_uv_external.CreateDefault(*context_, options);
858 #endif // !defined(FML_OS_MACOSX)
859  pipelines_->texture_downsample_gles.CreateDefault(*context_,
860  options_trianglestrip);
861  }
862 #endif // IMPELLER_ENABLE_OPENGLES
863 
864  is_valid_ = true;
865  InitializeCommonlyUsedShadersIfNeeded();
866 }
BufferView buffer_view
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
std::shared_ptr< Context > GetContext() const
static std::shared_ptr< HostBuffer > Create(const std::shared_ptr< Allocator > &allocator, const std::shared_ptr< const IdleWaiter > &idle_waiter, size_t minimum_uniform_alignment)
Definition: host_buffer.cc:21
float Scalar
Definition: scalar.h:19
std::array< std::vector< Scalar >, 15 > GetPorterDuffSpecConstants(bool supports_decal)
ISize64 ISize
Definition: size.h:162
std::array< uint8_t, 4 > ToR8G8B8A8() const
Convert to R8G8B8A8 representation.
Definition: color.h:246
static constexpr Color BlackTransparent()
Definition: color.h:270
static std::optional< PipelineDescriptor > MakeDefaultPipelineDescriptor(const Context &context, const std::vector< Scalar > &constants={})
Create a default pipeline descriptor using the combination reflected shader information....
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:68
#define VALIDATION_LOG
Definition: validation.h:91

References impeller::Color::BlackTransparent(), buffer_view, impeller::HostBuffer::Create(), data, impeller::HostBuffer::Emplace(), impeller::TextureDescriptor::format, GetContext(), impeller::GetPorterDuffSpecConstants(), GetTransientsDataBuffer(), impeller::kA8UNormInt, impeller::kColor, impeller::kColorBurn, impeller::kColorDodge, impeller::kCount1, impeller::kCount4, impeller::kDarken, impeller::kDevicePrivate, impeller::kDifference, impeller::kExclusion, impeller::kHardLight, impeller::kHue, impeller::kLighten, impeller::kLuminosity, impeller::kMultiply, impeller::kNone, impeller::Context::kOpenGLES, impeller::kOverlay, impeller::kR8G8B8A8UNormInt, impeller::kSaturation, impeller::kScreen, impeller::kSoftLight, impeller::kTriangleStrip, impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::MakeDefaultPipelineDescriptor(), pipelines_, impeller::ContentContextOptions::sample_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, impeller::Color::ToR8G8B8A8(), and VALIDATION_LOG.

◆ ~ContentContext()

impeller::ContentContext::~ContentContext ( )
default

Member Function Documentation

◆ ClearCachedRuntimeEffectPipeline()

void impeller::ContentContext::ClearCachedRuntimeEffectPipeline ( const std::string &  unique_entrypoint_name) const

Used by hot reload/hot restart to clear a cached pipeline from GetCachedRuntimeEffectPipeline.

Definition at line 971 of file content_context.cc.

972  {
973 #ifdef IMPELLER_DEBUG
974  // destroying in-use pipleines is a validation error.
975  const auto& idle_waiter = GetContext()->GetIdleWaiter();
976  if (idle_waiter) {
977  idle_waiter->WaitIdle();
978  }
979 #endif // IMPELLER_DEBUG
980  for (auto it = runtime_effect_pipelines_.begin();
981  it != runtime_effect_pipelines_.end();) {
982  if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
983  it = runtime_effect_pipelines_.erase(it);
984  } else {
985  it++;
986  }
987  }
988 }

References GetContext().

◆ GetBlendColorBurnPipeline()

PipelineRef impeller::ContentContext::GetBlendColorBurnPipeline ( ContentContextOptions  opts) const

Definition at line 1324 of file content_context.cc.

1325  {
1326  return GetPipeline(this, pipelines_->blend_colorburn, opts);
1327 }

References pipelines_.

◆ GetBlendColorDodgePipeline()

PipelineRef impeller::ContentContext::GetBlendColorDodgePipeline ( ContentContextOptions  opts) const

Definition at line 1329 of file content_context.cc.

1330  {
1331  return GetPipeline(this, pipelines_->blend_colordodge, opts);
1332 }

References pipelines_.

◆ GetBlendColorPipeline()

PipelineRef impeller::ContentContext::GetBlendColorPipeline ( ContentContextOptions  opts) const

Definition at line 1319 of file content_context.cc.

1320  {
1321  return GetPipeline(this, pipelines_->blend_color, opts);
1322 }

References pipelines_.

◆ GetBlendDarkenPipeline()

PipelineRef impeller::ContentContext::GetBlendDarkenPipeline ( ContentContextOptions  opts) const

Definition at line 1334 of file content_context.cc.

1335  {
1336  return GetPipeline(this, pipelines_->blend_darken, opts);
1337 }

References pipelines_.

◆ GetBlendDifferencePipeline()

PipelineRef impeller::ContentContext::GetBlendDifferencePipeline ( ContentContextOptions  opts) const

Definition at line 1339 of file content_context.cc.

1340  {
1341  return GetPipeline(this, pipelines_->blend_difference, opts);
1342 }

References pipelines_.

◆ GetBlendExclusionPipeline()

PipelineRef impeller::ContentContext::GetBlendExclusionPipeline ( ContentContextOptions  opts) const

Definition at line 1344 of file content_context.cc.

1345  {
1346  return GetPipeline(this, pipelines_->blend_exclusion, opts);
1347 }

References pipelines_.

◆ GetBlendHardLightPipeline()

PipelineRef impeller::ContentContext::GetBlendHardLightPipeline ( ContentContextOptions  opts) const

Definition at line 1349 of file content_context.cc.

1350  {
1351  return GetPipeline(this, pipelines_->blend_hardlight, opts);
1352 }

References pipelines_.

◆ GetBlendHuePipeline()

PipelineRef impeller::ContentContext::GetBlendHuePipeline ( ContentContextOptions  opts) const

Definition at line 1354 of file content_context.cc.

1355  {
1356  return GetPipeline(this, pipelines_->blend_hue, opts);
1357 }

References pipelines_.

◆ GetBlendLightenPipeline()

PipelineRef impeller::ContentContext::GetBlendLightenPipeline ( ContentContextOptions  opts) const

Definition at line 1359 of file content_context.cc.

1360  {
1361  return GetPipeline(this, pipelines_->blend_lighten, opts);
1362 }

References pipelines_.

◆ GetBlendLuminosityPipeline()

PipelineRef impeller::ContentContext::GetBlendLuminosityPipeline ( ContentContextOptions  opts) const

Definition at line 1364 of file content_context.cc.

1365  {
1366  return GetPipeline(this, pipelines_->blend_luminosity, opts);
1367 }

References pipelines_.

◆ GetBlendMultiplyPipeline()

PipelineRef impeller::ContentContext::GetBlendMultiplyPipeline ( ContentContextOptions  opts) const

Definition at line 1369 of file content_context.cc.

1370  {
1371  return GetPipeline(this, pipelines_->blend_multiply, opts);
1372 }

References pipelines_.

◆ GetBlendOverlayPipeline()

PipelineRef impeller::ContentContext::GetBlendOverlayPipeline ( ContentContextOptions  opts) const

Definition at line 1374 of file content_context.cc.

1375  {
1376  return GetPipeline(this, pipelines_->blend_overlay, opts);
1377 }

References pipelines_.

◆ GetBlendSaturationPipeline()

PipelineRef impeller::ContentContext::GetBlendSaturationPipeline ( ContentContextOptions  opts) const

Definition at line 1379 of file content_context.cc.

1380  {
1381  return GetPipeline(this, pipelines_->blend_saturation, opts);
1382 }

References pipelines_.

◆ GetBlendScreenPipeline()

PipelineRef impeller::ContentContext::GetBlendScreenPipeline ( ContentContextOptions  opts) const

Definition at line 1384 of file content_context.cc.

1385  {
1386  return GetPipeline(this, pipelines_->blend_screen, opts);
1387 }

References pipelines_.

◆ GetBlendSoftLightPipeline()

PipelineRef impeller::ContentContext::GetBlendSoftLightPipeline ( ContentContextOptions  opts) const

Definition at line 1389 of file content_context.cc.

1390  {
1391  return GetPipeline(this, pipelines_->blend_softlight, opts);
1392 }

References pipelines_.

◆ GetBorderMaskBlurPipeline()

PipelineRef impeller::ContentContext::GetBorderMaskBlurPipeline ( ContentContextOptions  opts) const

Definition at line 1150 of file content_context.cc.

1151  {
1152  return GetPipeline(this, pipelines_->border_mask_blur, opts);
1153 }

References pipelines_.

◆ GetCachedRuntimeEffectPipeline()

PipelineRef impeller::ContentContext::GetCachedRuntimeEffectPipeline ( const std::string &  unique_entrypoint_name,
const ContentContextOptions options,
const std::function< std::shared_ptr< Pipeline< PipelineDescriptor >>()> &  create_callback 
) const

RuntimeEffect pipelines must be obtained via this method to avoid re-creating them every frame.

The unique_entrypoint_name comes from RuntimeEffect::GetEntrypoint. Impellerc generates a unique entrypoint name for runtime effect shaders based on the input file name and shader stage.

The create_callback is synchronously invoked exactly once if a cached pipeline is not found.

Definition at line 958 of file content_context.cc.

962  {
963  RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
964  auto it = runtime_effect_pipelines_.find(key);
965  if (it == runtime_effect_pipelines_.end()) {
966  it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
967  }
968  return raw_ptr(it->second);
969 }

Referenced by impeller::RuntimeEffectContents::Render().

◆ GetClearBlendPipeline()

PipelineRef impeller::ContentContext::GetClearBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1244 of file content_context.cc.

1245  {
1246  return GetPipeline(this, pipelines_->clear_blend, opts);
1247 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetClipPipeline()

PipelineRef impeller::ContentContext::GetClipPipeline ( ContentContextOptions  opts) const

Definition at line 1175 of file content_context.cc.

1175  {
1176  return GetPipeline(this, pipelines_->clip, opts);
1177 }

References pipelines_.

Referenced by impeller::ColorSourceContents::DrawGeometry(), impeller::ClipContents::Render(), and impeller::RenderClipRestore().

◆ GetColorMatrixColorFilterPipeline()

PipelineRef impeller::ContentContext::GetColorMatrixColorFilterPipeline ( ContentContextOptions  opts) const

Definition at line 1160 of file content_context.cc.

1161  {
1162  return GetPipeline(this, pipelines_->color_matrix_color_filter, opts);
1163 }

References pipelines_.

Referenced by impeller::ColorFilterAtlasContents::Render().

◆ GetConicalGradientFillPipeline()

PipelineRef impeller::ContentContext::GetConicalGradientFillPipeline ( ContentContextOptions  opts,
ConicalKind  kind 
) const

Definition at line 1094 of file content_context.cc.

1096  {
1097  switch (kind) {
1098  case ConicalKind::kConical:
1099  return GetPipeline(this, pipelines_->conical_gradient_fill, opts);
1100  case ConicalKind::kRadial:
1101  return GetPipeline(this, pipelines_->conical_gradient_fill_radial, opts);
1102  case ConicalKind::kStrip:
1103  return GetPipeline(this, pipelines_->conical_gradient_fill_strip, opts);
1105  return GetPipeline(
1106  this, pipelines_->conical_gradient_fill_strip_and_radial, opts);
1107  }
1108 }

References impeller::kConical, impeller::kRadial, impeller::kStrip, impeller::kStripAndRadial, and pipelines_.

◆ GetConicalGradientSSBOFillPipeline()

PipelineRef impeller::ContentContext::GetConicalGradientSSBOFillPipeline ( ContentContextOptions  opts,
ConicalKind  kind 
) const

Definition at line 1064 of file content_context.cc.

1066  {
1067  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1068  switch (kind) {
1069  case ConicalKind::kConical:
1070  return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill, opts);
1071  case ConicalKind::kRadial:
1072  return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_radial,
1073  opts);
1074  case ConicalKind::kStrip:
1075  return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_strip,
1076  opts);
1078  return GetPipeline(
1079  this, pipelines_->conical_gradient_ssbo_fill_strip_and_radial, opts);
1080  }
1081 }
const Capabilities & GetDeviceCapabilities() const

References GetDeviceCapabilities(), impeller::kConical, impeller::kRadial, impeller::kStrip, impeller::kStripAndRadial, and pipelines_.

◆ GetConicalGradientUniformFillPipeline()

PipelineRef impeller::ContentContext::GetConicalGradientUniformFillPipeline ( ContentContextOptions  opts,
ConicalKind  kind 
) const

Definition at line 1045 of file content_context.cc.

1047  {
1048  switch (kind) {
1049  case ConicalKind::kConical:
1050  return GetPipeline(this, pipelines_->conical_gradient_uniform_fill, opts);
1051  case ConicalKind::kRadial:
1052  return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_radial,
1053  opts);
1054  case ConicalKind::kStrip:
1055  return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_strip,
1056  opts);
1058  return GetPipeline(
1059  this, pipelines_->conical_gradient_uniform_fill_strip_and_radial,
1060  opts);
1061  }
1062 }

References impeller::kConical, impeller::kRadial, impeller::kStrip, impeller::kStripAndRadial, and pipelines_.

◆ GetContext()

◆ GetDestinationATopBlendPipeline()

PipelineRef impeller::ContentContext::GetDestinationATopBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1294 of file content_context.cc.

1295  {
1296  return GetPipeline(this, pipelines_->destination_a_top_blend, opts);
1297 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetDestinationBlendPipeline()

PipelineRef impeller::ContentContext::GetDestinationBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1254 of file content_context.cc.

1255  {
1256  return GetPipeline(this, pipelines_->destination_blend, opts);
1257 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetDestinationInBlendPipeline()

PipelineRef impeller::ContentContext::GetDestinationInBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1274 of file content_context.cc.

1275  {
1276  return GetPipeline(this, pipelines_->destination_in_blend, opts);
1277 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetDestinationOutBlendPipeline()

PipelineRef impeller::ContentContext::GetDestinationOutBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1284 of file content_context.cc.

1285  {
1286  return GetPipeline(this, pipelines_->destination_out_blend, opts);
1287 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetDestinationOverBlendPipeline()

PipelineRef impeller::ContentContext::GetDestinationOverBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1264 of file content_context.cc.

1265  {
1266  return GetPipeline(this, pipelines_->destination_over_blend, opts);
1267 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetDeviceCapabilities()

◆ GetDownsamplePipeline()

PipelineRef impeller::ContentContext::GetDownsamplePipeline ( ContentContextOptions  opts) const

Definition at line 1394 of file content_context.cc.

1395  {
1396  return GetPipeline(this, pipelines_->texture_downsample, opts);
1397 }

References pipelines_.

◆ GetDrawVerticesUberPipeline()

PipelineRef impeller::ContentContext::GetDrawVerticesUberPipeline ( BlendMode  blend_mode,
ContentContextOptions  opts 
) const

Definition at line 1489 of file content_context.cc.

1491  {
1492  if (blend_mode <= BlendMode::kHardLight) {
1493  return GetPipeline(this, pipelines_->vertices_uber_1_, opts);
1494  } else {
1495  return GetPipeline(this, pipelines_->vertices_uber_2_, opts);
1496  }
1497 }

References impeller::kHardLight, and pipelines_.

Referenced by impeller::AtlasContents::Render(), and impeller::VerticesSimpleBlendContents::Render().

◆ GetEmptyTexture()

std::shared_ptr< Texture > impeller::ContentContext::GetEmptyTexture ( ) const

Definition at line 874 of file content_context.cc.

874  {
875  return empty_texture_;
876 }

Referenced by impeller::VerticesSimpleBlendContents::Render().

◆ GetFastGradientPipeline()

PipelineRef impeller::ContentContext::GetFastGradientPipeline ( ContentContextOptions  opts) const

Definition at line 1008 of file content_context.cc.

1009  {
1010  return GetPipeline(this, pipelines_->fast_gradient, opts);
1011 }

References pipelines_.

◆ GetFramebufferBlendColorBurnPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendColorBurnPipeline ( ContentContextOptions  opts) const

Definition at line 1405 of file content_context.cc.

1406  {
1407  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1408  return GetPipeline(this, pipelines_->framebuffer_blend_colorburn, opts);
1409 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendColorDodgePipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendColorDodgePipeline ( ContentContextOptions  opts) const

Definition at line 1411 of file content_context.cc.

1412  {
1413  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1414  return GetPipeline(this, pipelines_->framebuffer_blend_colordodge, opts);
1415 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendColorPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendColorPipeline ( ContentContextOptions  opts) const

Definition at line 1399 of file content_context.cc.

1400  {
1401  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1402  return GetPipeline(this, pipelines_->framebuffer_blend_color, opts);
1403 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendDarkenPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendDarkenPipeline ( ContentContextOptions  opts) const

Definition at line 1417 of file content_context.cc.

1418  {
1419  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1420  return GetPipeline(this, pipelines_->framebuffer_blend_darken, opts);
1421 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendDifferencePipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendDifferencePipeline ( ContentContextOptions  opts) const

Definition at line 1423 of file content_context.cc.

1424  {
1425  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1426  return GetPipeline(this, pipelines_->framebuffer_blend_difference, opts);
1427 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendExclusionPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendExclusionPipeline ( ContentContextOptions  opts) const

Definition at line 1429 of file content_context.cc.

1430  {
1431  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1432  return GetPipeline(this, pipelines_->framebuffer_blend_exclusion, opts);
1433 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendHardLightPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendHardLightPipeline ( ContentContextOptions  opts) const

Definition at line 1435 of file content_context.cc.

1436  {
1437  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1438  return GetPipeline(this, pipelines_->framebuffer_blend_hardlight, opts);
1439 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendHuePipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendHuePipeline ( ContentContextOptions  opts) const

Definition at line 1441 of file content_context.cc.

1442  {
1443  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1444  return GetPipeline(this, pipelines_->framebuffer_blend_hue, opts);
1445 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendLightenPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendLightenPipeline ( ContentContextOptions  opts) const

Definition at line 1447 of file content_context.cc.

1448  {
1449  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1450  return GetPipeline(this, pipelines_->framebuffer_blend_lighten, opts);
1451 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendLuminosityPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendLuminosityPipeline ( ContentContextOptions  opts) const

Definition at line 1453 of file content_context.cc.

1454  {
1455  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1456  return GetPipeline(this, pipelines_->framebuffer_blend_luminosity, opts);
1457 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendMultiplyPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendMultiplyPipeline ( ContentContextOptions  opts) const

Definition at line 1459 of file content_context.cc.

1460  {
1461  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1462  return GetPipeline(this, pipelines_->framebuffer_blend_multiply, opts);
1463 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendOverlayPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendOverlayPipeline ( ContentContextOptions  opts) const

Definition at line 1465 of file content_context.cc.

1466  {
1467  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1468  return GetPipeline(this, pipelines_->framebuffer_blend_overlay, opts);
1469 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendSaturationPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendSaturationPipeline ( ContentContextOptions  opts) const

Definition at line 1471 of file content_context.cc.

1472  {
1473  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1474  return GetPipeline(this, pipelines_->framebuffer_blend_saturation, opts);
1475 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendScreenPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendScreenPipeline ( ContentContextOptions  opts) const

Definition at line 1477 of file content_context.cc.

1478  {
1479  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1480  return GetPipeline(this, pipelines_->framebuffer_blend_screen, opts);
1481 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetFramebufferBlendSoftLightPipeline()

PipelineRef impeller::ContentContext::GetFramebufferBlendSoftLightPipeline ( ContentContextOptions  opts) const

Definition at line 1483 of file content_context.cc.

1484  {
1485  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1486  return GetPipeline(this, pipelines_->framebuffer_blend_softlight, opts);
1487 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetGaussianBlurPipeline()

PipelineRef impeller::ContentContext::GetGaussianBlurPipeline ( ContentContextOptions  opts) const

Definition at line 1145 of file content_context.cc.

1146  {
1147  return GetPipeline(this, pipelines_->gaussian_blur, opts);
1148 }

References pipelines_.

◆ GetGlyphAtlasPipeline()

PipelineRef impeller::ContentContext::GetGlyphAtlasPipeline ( ContentContextOptions  opts) const

Definition at line 1179 of file content_context.cc.

1180  {
1181  return GetPipeline(this, pipelines_->glyph_atlas, opts);
1182 }

References pipelines_.

Referenced by impeller::TextContents::Render().

◆ GetLazyGlyphAtlas()

const std::shared_ptr<LazyGlyphAtlas>& impeller::ContentContext::GetLazyGlyphAtlas ( ) const
inline

Definition at line 265 of file content_context.h.

265  {
266  return lazy_glyph_atlas_;
267  }

Referenced by impeller::FirstPassDispatcher::drawText(), impeller::TextContents::Render(), impeller::RenderToTarget(), and impeller::testing::TEST_P().

◆ GetLinearGradientFillPipeline()

PipelineRef impeller::ContentContext::GetLinearGradientFillPipeline ( ContentContextOptions  opts) const

Definition at line 1013 of file content_context.cc.

1014  {
1015  return GetPipeline(this, pipelines_->linear_gradient_fill, opts);
1016 }

References pipelines_.

◆ GetLinearGradientSSBOFillPipeline()

PipelineRef impeller::ContentContext::GetLinearGradientSSBOFillPipeline ( ContentContextOptions  opts) const

Definition at line 1033 of file content_context.cc.

1034  {
1035  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1036  return GetPipeline(this, pipelines_->linear_gradient_ssbo_fill, opts);
1037 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetLinearGradientUniformFillPipeline()

PipelineRef impeller::ContentContext::GetLinearGradientUniformFillPipeline ( ContentContextOptions  opts) const

Definition at line 1018 of file content_context.cc.

1019  {
1020  return GetPipeline(this, pipelines_->linear_gradient_uniform_fill, opts);
1021 }

References pipelines_.

◆ GetLinearToSrgbFilterPipeline()

PipelineRef impeller::ContentContext::GetLinearToSrgbFilterPipeline ( ContentContextOptions  opts) const

Definition at line 1165 of file content_context.cc.

1166  {
1167  return GetPipeline(this, pipelines_->linear_to_srgb_filter, opts);
1168 }

References pipelines_.

◆ GetLinePipeline()

PipelineRef impeller::ContentContext::GetLinePipeline ( ContentContextOptions  opts) const

Definition at line 1499 of file content_context.cc.

1499  {
1500  return GetPipeline(this, pipelines_->line, opts);
1501 }

References pipelines_.

Referenced by impeller::LineContents::Render().

◆ GetModulateBlendPipeline()

PipelineRef impeller::ContentContext::GetModulateBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1309 of file content_context.cc.

1310  {
1311  return GetPipeline(this, pipelines_->modulate_blend, opts);
1312 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetMorphologyFilterPipeline()

PipelineRef impeller::ContentContext::GetMorphologyFilterPipeline ( ContentContextOptions  opts) const

Definition at line 1155 of file content_context.cc.

1156  {
1157  return GetPipeline(this, pipelines_->morphology_filter, opts);
1158 }

References pipelines_.

◆ GetPlusBlendPipeline()

PipelineRef impeller::ContentContext::GetPlusBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1304 of file content_context.cc.

1305  {
1306  return GetPipeline(this, pipelines_->plus_blend, opts);
1307 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetPorterDuffPipeline()

PipelineRef impeller::ContentContext::GetPorterDuffPipeline ( BlendMode  mode,
ContentContextOptions  opts 
) const

Definition at line 1189 of file content_context.cc.

1191  {
1192  switch (mode) {
1193  case BlendMode::kClear:
1194  return GetClearBlendPipeline(opts);
1195  case BlendMode::kSrc:
1196  return GetSourceBlendPipeline(opts);
1197  case BlendMode::kDst:
1198  return GetDestinationBlendPipeline(opts);
1199  case BlendMode::kSrcOver:
1200  return GetSourceOverBlendPipeline(opts);
1201  case BlendMode::kDstOver:
1202  return GetDestinationOverBlendPipeline(opts);
1203  case BlendMode::kSrcIn:
1204  return GetSourceInBlendPipeline(opts);
1205  case BlendMode::kDstIn:
1206  return GetDestinationInBlendPipeline(opts);
1207  case BlendMode::kSrcOut:
1208  return GetSourceOutBlendPipeline(opts);
1209  case BlendMode::kDstOut:
1210  return GetDestinationOutBlendPipeline(opts);
1211  case BlendMode::kSrcATop:
1212  return GetSourceATopBlendPipeline(opts);
1213  case BlendMode::kDstATop:
1214  return GetDestinationATopBlendPipeline(opts);
1215  case BlendMode::kXor:
1216  return GetXorBlendPipeline(opts);
1217  case BlendMode::kPlus:
1218  return GetPlusBlendPipeline(opts);
1219  case BlendMode::kModulate:
1220  return GetModulateBlendPipeline(opts);
1221  case BlendMode::kScreen:
1222  return GetScreenBlendPipeline(opts);
1223  case BlendMode::kOverlay:
1224  case BlendMode::kDarken:
1225  case BlendMode::kLighten:
1227  case BlendMode::kColorBurn:
1228  case BlendMode::kHardLight:
1229  case BlendMode::kSoftLight:
1231  case BlendMode::kExclusion:
1232  case BlendMode::kMultiply:
1233  case BlendMode::kHue:
1235  case BlendMode::kColor:
1237  VALIDATION_LOG << "Invalid porter duff blend mode "
1238  << BlendModeToString(mode);
1239  return GetClearBlendPipeline(opts);
1240  break;
1241  }
1242 }
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
const char * BlendModeToString(BlendMode blend_mode)
Definition: color.cc:47

References impeller::BlendModeToString(), GetClearBlendPipeline(), GetDestinationATopBlendPipeline(), GetDestinationBlendPipeline(), GetDestinationInBlendPipeline(), GetDestinationOutBlendPipeline(), GetDestinationOverBlendPipeline(), GetModulateBlendPipeline(), GetPlusBlendPipeline(), GetScreenBlendPipeline(), GetSourceATopBlendPipeline(), GetSourceBlendPipeline(), GetSourceInBlendPipeline(), GetSourceOutBlendPipeline(), GetSourceOverBlendPipeline(), GetXorBlendPipeline(), impeller::kClear, impeller::kColor, impeller::kColorBurn, impeller::kColorDodge, impeller::kDarken, impeller::kDifference, impeller::kDst, impeller::kDstATop, impeller::kDstIn, impeller::kDstOut, impeller::kDstOver, impeller::kExclusion, impeller::kHardLight, impeller::kHue, impeller::kLighten, impeller::kLuminosity, impeller::kModulate, impeller::kMultiply, impeller::kOverlay, impeller::kPlus, impeller::kSaturation, impeller::kScreen, impeller::kSoftLight, impeller::kSrc, impeller::kSrcATop, impeller::kSrcIn, impeller::kSrcOut, impeller::kSrcOver, impeller::kXor, and VALIDATION_LOG.

Referenced by impeller::AtlasContents::Render(), and impeller::VerticesSimpleBlendContents::Render().

◆ GetRadialGradientFillPipeline()

PipelineRef impeller::ContentContext::GetRadialGradientFillPipeline ( ContentContextOptions  opts) const

Definition at line 1089 of file content_context.cc.

1090  {
1091  return GetPipeline(this, pipelines_->radial_gradient_fill, opts);
1092 }

References pipelines_.

◆ GetRadialGradientSSBOFillPipeline()

PipelineRef impeller::ContentContext::GetRadialGradientSSBOFillPipeline ( ContentContextOptions  opts) const

Definition at line 1039 of file content_context.cc.

1040  {
1041  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1042  return GetPipeline(this, pipelines_->radial_gradient_ssbo_fill, opts);
1043 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetRadialGradientUniformFillPipeline()

PipelineRef impeller::ContentContext::GetRadialGradientUniformFillPipeline ( ContentContextOptions  opts) const

Definition at line 1023 of file content_context.cc.

1024  {
1025  return GetPipeline(this, pipelines_->radial_gradient_uniform_fill, opts);
1026 }

References pipelines_.

◆ GetRenderTargetCache()

const std::shared_ptr<RenderTargetAllocator>& impeller::ContentContext::GetRenderTargetCache ( ) const
inline

◆ GetRRectBlurPipeline()

PipelineRef impeller::ContentContext::GetRRectBlurPipeline ( ContentContextOptions  opts) const

Definition at line 1110 of file content_context.cc.

1111  {
1112  return GetPipeline(this, pipelines_->rrect_blur, opts);
1113 }

References pipelines_.

Referenced by impeller::SolidRRectBlurContents::SetPassInfo().

◆ GetRSuperellipseBlurPipeline()

PipelineRef impeller::ContentContext::GetRSuperellipseBlurPipeline ( ContentContextOptions  opts) const

Definition at line 1115 of file content_context.cc.

1116  {
1117  return GetPipeline(this, pipelines_->rsuperellipse_blur, opts);
1118 }

References pipelines_.

◆ GetScreenBlendPipeline()

PipelineRef impeller::ContentContext::GetScreenBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1314 of file content_context.cc.

1315  {
1316  return GetPipeline(this, pipelines_->screen_blend, opts);
1317 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetSolidFillPipeline()

PipelineRef impeller::ContentContext::GetSolidFillPipeline ( ContentContextOptions  opts) const

Definition at line 1125 of file content_context.cc.

1126  {
1127  return GetPipeline(this, pipelines_->solid_fill, opts);
1128 }

References pipelines_.

Referenced by impeller::SolidColorContents::Render(), and impeller::testing::TEST_P().

◆ GetSourceATopBlendPipeline()

PipelineRef impeller::ContentContext::GetSourceATopBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1289 of file content_context.cc.

1290  {
1291  return GetPipeline(this, pipelines_->source_a_top_blend, opts);
1292 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetSourceBlendPipeline()

PipelineRef impeller::ContentContext::GetSourceBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1249 of file content_context.cc.

1250  {
1251  return GetPipeline(this, pipelines_->source_blend, opts);
1252 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetSourceInBlendPipeline()

PipelineRef impeller::ContentContext::GetSourceInBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1269 of file content_context.cc.

1270  {
1271  return GetPipeline(this, pipelines_->source_in_blend, opts);
1272 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetSourceOutBlendPipeline()

PipelineRef impeller::ContentContext::GetSourceOutBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1279 of file content_context.cc.

1280  {
1281  return GetPipeline(this, pipelines_->source_out_blend, opts);
1282 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetSourceOverBlendPipeline()

PipelineRef impeller::ContentContext::GetSourceOverBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1259 of file content_context.cc.

1260  {
1261  return GetPipeline(this, pipelines_->source_over_blend, opts);
1262 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetSrgbToLinearFilterPipeline()

PipelineRef impeller::ContentContext::GetSrgbToLinearFilterPipeline ( ContentContextOptions  opts) const

Definition at line 1170 of file content_context.cc.

1171  {
1172  return GetPipeline(this, pipelines_->srgb_to_linear_filter, opts);
1173 }

References pipelines_.

◆ GetSweepGradientFillPipeline()

PipelineRef impeller::ContentContext::GetSweepGradientFillPipeline ( ContentContextOptions  opts) const

Definition at line 1120 of file content_context.cc.

1121  {
1122  return GetPipeline(this, pipelines_->sweep_gradient_fill, opts);
1123 }

References pipelines_.

◆ GetSweepGradientSSBOFillPipeline()

PipelineRef impeller::ContentContext::GetSweepGradientSSBOFillPipeline ( ContentContextOptions  opts) const

Definition at line 1083 of file content_context.cc.

1084  {
1085  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1086  return GetPipeline(this, pipelines_->sweep_gradient_ssbo_fill, opts);
1087 }

References GetDeviceCapabilities(), and pipelines_.

◆ GetSweepGradientUniformFillPipeline()

PipelineRef impeller::ContentContext::GetSweepGradientUniformFillPipeline ( ContentContextOptions  opts) const

Definition at line 1028 of file content_context.cc.

1029  {
1030  return GetPipeline(this, pipelines_->sweep_gradient_uniform_fill, opts);
1031 }

References pipelines_.

◆ GetTessellator()

Tessellator & impeller::ContentContext::GetTessellator ( ) const

Definition at line 946 of file content_context.cc.

946  {
947  return *tessellator_;
948 }

Referenced by impeller::StrokeRectGeometry::GetPositionBuffer().

◆ GetTextShadowCache()

TextShadowCache& impeller::ContentContext::GetTextShadowCache ( ) const
inline

Definition at line 315 of file content_context.h.

315 { return *text_shadow_cache_; }

Referenced by impeller::DisplayListToTexture(), impeller::RenderToTarget(), and impeller::testing::TEST_P().

◆ GetTexturePipeline()

PipelineRef impeller::ContentContext::GetTexturePipeline ( ContentContextOptions  opts) const

Definition at line 1130 of file content_context.cc.

1131  {
1132  return GetPipeline(this, pipelines_->texture, opts);
1133 }

References pipelines_.

Referenced by impeller::PipelineBlend(), impeller::AtlasContents::Render(), and impeller::TextureContents::Render().

◆ GetTextureStrictSrcPipeline()

PipelineRef impeller::ContentContext::GetTextureStrictSrcPipeline ( ContentContextOptions  opts) const

Definition at line 1135 of file content_context.cc.

1136  {
1137  return GetPipeline(this, pipelines_->texture_strict_src, opts);
1138 }

References pipelines_.

Referenced by impeller::TextureContents::Render().

◆ GetTiledTexturePipeline()

PipelineRef impeller::ContentContext::GetTiledTexturePipeline ( ContentContextOptions  opts) const

Definition at line 1140 of file content_context.cc.

1141  {
1142  return GetPipeline(this, pipelines_->tiled_texture, opts);
1143 }

References pipelines_.

Referenced by impeller::TiledTextureContents::Render().

◆ GetTransientsDataBuffer()

◆ GetTransientsIndexesBuffer()

HostBuffer& impeller::ContentContext::GetTransientsIndexesBuffer ( ) const
inline

Retrieve the current host buffer for transient storage of indexes used for indexed draws.

This may or may not return the same value as GetTransientsDataBuffer depending on the backend.

This is only safe to use from the raster threads. Other threads should allocate their own device buffers.

Definition at line 301 of file content_context.h.

301  {
302  return *indexes_host_buffer_;
303  }

Referenced by impeller::DlVerticesGeometry::GetPositionBuffer(), impeller::DlVerticesGeometry::GetPositionUVColorBuffer(), impeller::EntityPlayground::OpenPlaygroundHere(), impeller::TextContents::Render(), and impeller::testing::TEST_P().

◆ GetXorBlendPipeline()

PipelineRef impeller::ContentContext::GetXorBlendPipeline ( ContentContextOptions  opts) const

Definition at line 1299 of file content_context.cc.

1300  {
1301  return GetPipeline(this, pipelines_->xor_blend, opts);
1302 }

References pipelines_.

Referenced by GetPorterDuffPipeline().

◆ GetYUVToRGBFilterPipeline()

PipelineRef impeller::ContentContext::GetYUVToRGBFilterPipeline ( ContentContextOptions  opts) const

Definition at line 1184 of file content_context.cc.

1185  {
1186  return GetPipeline(this, pipelines_->yuv_to_rgb_filter, opts);
1187 }

References pipelines_.

◆ IsValid()

bool impeller::ContentContext::IsValid ( ) const

Definition at line 870 of file content_context.cc.

870  {
871  return is_valid_;
872 }

Referenced by impeller::EntityPlayground::OpenPlaygroundHere().

◆ MakeSubpass() [1/2]

fml::StatusOr< RenderTarget > impeller::ContentContext::MakeSubpass ( std::string_view  label,
const RenderTarget subpass_target,
const std::shared_ptr< CommandBuffer > &  command_buffer,
const SubpassCallback subpass_callback 
) const

Makes a subpass that will render to subpass_target.

Definition at line 907 of file content_context.cc.

911  {
912  const std::shared_ptr<Context>& context = GetContext();
913 
914  auto subpass_texture = subpass_target.GetRenderTargetTexture();
915  if (!subpass_texture) {
916  return fml::Status(fml::StatusCode::kUnknown, "");
917  }
918 
919  auto sub_renderpass = command_buffer->CreateRenderPass(subpass_target);
920  if (!sub_renderpass) {
921  return fml::Status(fml::StatusCode::kUnknown, "");
922  }
923  sub_renderpass->SetLabel(label);
924 
925  if (!subpass_callback(*this, *sub_renderpass)) {
926  return fml::Status(fml::StatusCode::kUnknown, "");
927  }
928 
929  if (!sub_renderpass->EncodeCommands()) {
930  return fml::Status(fml::StatusCode::kUnknown, "");
931  }
932 
933  const std::shared_ptr<Texture>& target_texture =
934  subpass_target.GetRenderTargetTexture();
935  if (target_texture->GetMipCount() > 1) {
936  fml::Status mipmap_status =
937  AddMipmapGeneration(command_buffer, context, target_texture);
938  if (!mipmap_status.ok()) {
939  return mipmap_status;
940  }
941  }
942 
943  return subpass_target;
944 }
fml::Status AddMipmapGeneration(const std::shared_ptr< CommandBuffer > &command_buffer, const std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
Adds a blit command to the render pass.
Definition: texture_util.cc:37

References impeller::AddMipmapGeneration(), GetContext(), and impeller::RenderTarget::GetRenderTargetTexture().

◆ MakeSubpass() [2/2]

fml::StatusOr< RenderTarget > impeller::ContentContext::MakeSubpass ( std::string_view  label,
ISize  texture_size,
const std::shared_ptr< CommandBuffer > &  command_buffer,
const SubpassCallback subpass_callback,
bool  msaa_enabled = true,
bool  depth_stencil_enabled = false,
int32_t  mip_count = 1 
) const

Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing to the texture.

Definition at line 878 of file content_context.cc.

885  {
886  const std::shared_ptr<Context>& context = GetContext();
887  RenderTarget subpass_target;
888 
889  std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
890  depth_stencil_enabled ? RenderTarget::kDefaultStencilAttachmentConfig
891  : std::optional<RenderTarget::AttachmentConfig>();
892 
893  if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
894  subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
895  *context, texture_size,
896  /*mip_count=*/mip_count, label,
898  } else {
899  subpass_target = GetRenderTargetCache()->CreateOffscreen(
900  *context, texture_size,
901  /*mip_count=*/mip_count, label,
902  RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
903  }
904  return MakeSubpass(label, subpass_target, command_buffer, subpass_callback);
905 }
fml::StatusOr< RenderTarget > MakeSubpass(std::string_view label, ISize texture_size, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback, bool msaa_enabled=true, bool depth_stencil_enabled=false, int32_t mip_count=1) const
Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing t...
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
Definition: render_target.h:55
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
Definition: render_target.h:61
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
Definition: render_target.h:68

References GetContext(), GetRenderTargetCache(), impeller::RenderTarget::kDefaultColorAttachmentConfig, impeller::RenderTarget::kDefaultColorAttachmentConfigMSAA, and impeller::RenderTarget::kDefaultStencilAttachmentConfig.

Referenced by impeller::AdvancedBlend(), impeller::PipelineBlend(), and impeller::Contents::RenderToSnapshot().

◆ ResetTransientsBuffers()

void impeller::ContentContext::ResetTransientsBuffers ( )

Resets the transients buffers held onto by the content context.

Definition at line 990 of file content_context.cc.

990  {
991  data_host_buffer_->Reset();
992 
993  // We should only reset the indexes host buffer if it is actually different
994  // from the data host buffer. Otherwise we'll end up resetting the same host
995  // buffer twice.
996  if (data_host_buffer_ != indexes_host_buffer_) {
997  indexes_host_buffer_->Reset();
998  }
999 }

Referenced by impeller::RenderToTarget().

◆ SetTransientsDataBuffer()

void impeller::ContentContext::SetTransientsDataBuffer ( std::shared_ptr< HostBuffer host_buffer)
inlineprotected

Definition at line 324 of file content_context.h.

324  {
325  data_host_buffer_ = std::move(host_buffer);
326  }

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

◆ SetTransientsIndexesBuffer()

void impeller::ContentContext::SetTransientsIndexesBuffer ( std::shared_ptr< HostBuffer host_buffer)
inlineprotected

Definition at line 319 of file content_context.h.

319  {
320  indexes_host_buffer_ = std::move(host_buffer);
321  }

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


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