Flutter Impeller
impeller::ContentContext Class Reference

#include <content_context.h>

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
 
std::shared_ptr< TessellatorGetTessellator () const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetLinearGradientFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetLinearGradientSSBOFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRadialGradientSSBOFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetConicalGradientSSBOFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSweepGradientSSBOFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRadialGradientFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetConicalGradientFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRRectBlurPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSweepGradientFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTexturePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTextureStrictSrcPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetPositionUVPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTiledTexturePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGaussianBlurDecalPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGaussianBlurPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetKernelDecalPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetKernelPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBorderMaskBlurPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetMorphologyFilterPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetColorMatrixColorFilterPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetLinearToSrgbFilterPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSrgbToLinearFilterPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetClipPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGlyphAtlasPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGlyphAtlasColorPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGeometryColorPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetYUVToRGBFilterPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetPorterDuffBlendPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendColorPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendColorBurnPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendColorDodgePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendDarkenPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendDifferencePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendExclusionPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendHardLightPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendHuePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendLightenPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendLuminosityPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendMultiplyPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendOverlayPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendSaturationPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendScreenPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendSoftLightPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendColorPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendColorBurnPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendColorDodgePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendDarkenPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendDifferencePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendExclusionPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendHardLightPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendHuePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendLightenPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendLuminosityPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendMultiplyPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendOverlayPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendSaturationPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendScreenPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendSoftLightPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< ComputePipelineDescriptor > > GetPointComputePipeline () const
 
std::shared_ptr< Pipeline< ComputePipelineDescriptor > > GetUvComputePipeline () const
 
std::shared_ptr< ContextGetContext () const
 
const CapabilitiesGetDeviceCapabilities () const
 
void SetWireframe (bool wireframe)
 
fml::StatusOr< RenderTargetMakeSubpass (const std::string &label, ISize texture_size, 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 (const std::string &label, const RenderTarget &subpass_target, 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
 
std::shared_ptr< Pipeline< PipelineDescriptor > > 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
 
HostBufferGetTransientsBuffer () const
 Retrieve the currnent host buffer for transient storage. More...
 

Static Public Attributes

static constexpr bool kEnableStencilThenCover = true
 

Detailed Description

Definition at line 392 of file content_context.h.

Member Typedef Documentation

◆ SubpassCallback

Definition at line 783 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 248 of file content_context.cc.

252  : context_(std::move(context)),
253  lazy_glyph_atlas_(
254  std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
255  tessellator_(std::make_shared<Tessellator>()),
256 #if IMPELLER_ENABLE_3D
257  scene_context_(std::make_shared<scene::SceneContext>(context_)),
258 #endif // IMPELLER_ENABLE_3D
259  render_target_cache_(render_target_allocator == nullptr
260  ? std::make_shared<RenderTargetCache>(
261  context_->GetResourceAllocator())
262  : std::move(render_target_allocator)),
263  host_buffer_(HostBuffer::Create(context_->GetResourceAllocator())),
264  pending_command_buffers_(std::make_unique<PendingCommandBuffers>()) {
265  if (!context_ || !context_->IsValid()) {
266  return;
267  }
268 
269  auto options = ContentContextOptions{
270  .sample_count = SampleCount::kCount4,
271  .color_attachment_pixel_format =
272  context_->GetCapabilities()->GetDefaultColorFormat()};
273  auto options_trianglestrip = ContentContextOptions{
274  .sample_count = SampleCount::kCount4,
275  .primitive_type = PrimitiveType::kTriangleStrip,
276  .color_attachment_pixel_format =
277  context_->GetCapabilities()->GetDefaultColorFormat()};
278  const auto supports_decal = static_cast<Scalar>(
279  context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
280 
281 #ifdef IMPELLER_DEBUG
282  checkerboard_pipelines_.CreateDefault(*context_, options);
283 #endif // IMPELLER_DEBUG
284 
285  solid_fill_pipelines_.CreateDefault(*context_, options);
286 
287  if (context_->GetCapabilities()->SupportsSSBO()) {
288  linear_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
289  radial_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
290  conical_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
291  sweep_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
292  } else {
293  linear_gradient_fill_pipelines_.CreateDefault(*context_, options);
294  radial_gradient_fill_pipelines_.CreateDefault(*context_, options);
295  conical_gradient_fill_pipelines_.CreateDefault(*context_, options);
296  sweep_gradient_fill_pipelines_.CreateDefault(*context_, options);
297  }
298 
299  if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
300  framebuffer_blend_color_pipelines_.CreateDefault(
301  *context_, options_trianglestrip,
302  {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
303  framebuffer_blend_colorburn_pipelines_.CreateDefault(
304  *context_, options_trianglestrip,
305  {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
306  framebuffer_blend_colordodge_pipelines_.CreateDefault(
307  *context_, options_trianglestrip,
308  {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
309  framebuffer_blend_darken_pipelines_.CreateDefault(
310  *context_, options_trianglestrip,
311  {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
312  framebuffer_blend_difference_pipelines_.CreateDefault(
313  *context_, options_trianglestrip,
314  {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
315  framebuffer_blend_exclusion_pipelines_.CreateDefault(
316  *context_, options_trianglestrip,
317  {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
318  framebuffer_blend_hardlight_pipelines_.CreateDefault(
319  *context_, options_trianglestrip,
320  {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
321  framebuffer_blend_hue_pipelines_.CreateDefault(
322  *context_, options_trianglestrip,
323  {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
324  framebuffer_blend_lighten_pipelines_.CreateDefault(
325  *context_, options_trianglestrip,
326  {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
327  framebuffer_blend_luminosity_pipelines_.CreateDefault(
328  *context_, options_trianglestrip,
329  {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
330  framebuffer_blend_multiply_pipelines_.CreateDefault(
331  *context_, options_trianglestrip,
332  {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
333  framebuffer_blend_overlay_pipelines_.CreateDefault(
334  *context_, options_trianglestrip,
335  {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
336  framebuffer_blend_saturation_pipelines_.CreateDefault(
337  *context_, options_trianglestrip,
338  {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
339  framebuffer_blend_screen_pipelines_.CreateDefault(
340  *context_, options_trianglestrip,
341  {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
342  framebuffer_blend_softlight_pipelines_.CreateDefault(
343  *context_, options_trianglestrip,
344  {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
345  }
346 
347  blend_color_pipelines_.CreateDefault(
348  *context_, options_trianglestrip,
349  {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
350  blend_colorburn_pipelines_.CreateDefault(
351  *context_, options_trianglestrip,
352  {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
353  blend_colordodge_pipelines_.CreateDefault(
354  *context_, options_trianglestrip,
355  {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
356  blend_darken_pipelines_.CreateDefault(
357  *context_, options_trianglestrip,
358  {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
359  blend_difference_pipelines_.CreateDefault(
360  *context_, options_trianglestrip,
361  {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
362  blend_exclusion_pipelines_.CreateDefault(
363  *context_, options_trianglestrip,
364  {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
365  blend_hardlight_pipelines_.CreateDefault(
366  *context_, options_trianglestrip,
367  {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
368  blend_hue_pipelines_.CreateDefault(
369  *context_, options_trianglestrip,
370  {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
371  blend_lighten_pipelines_.CreateDefault(
372  *context_, options_trianglestrip,
373  {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
374  blend_luminosity_pipelines_.CreateDefault(
375  *context_, options_trianglestrip,
376  {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
377  blend_multiply_pipelines_.CreateDefault(
378  *context_, options_trianglestrip,
379  {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
380  blend_overlay_pipelines_.CreateDefault(
381  *context_, options_trianglestrip,
382  {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
383  blend_saturation_pipelines_.CreateDefault(
384  *context_, options_trianglestrip,
385  {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
386  blend_screen_pipelines_.CreateDefault(
387  *context_, options_trianglestrip,
388  {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
389  blend_softlight_pipelines_.CreateDefault(
390  *context_, options_trianglestrip,
391  {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
392 
393  rrect_blur_pipelines_.CreateDefault(*context_, options_trianglestrip);
394  texture_blend_pipelines_.CreateDefault(*context_, options);
395  texture_pipelines_.CreateDefault(*context_, options);
396  texture_strict_src_pipelines_.CreateDefault(*context_, options);
397  position_uv_pipelines_.CreateDefault(*context_, options);
398  tiled_texture_pipelines_.CreateDefault(*context_, options);
399  gaussian_blur_noalpha_decal_pipelines_.CreateDefault(*context_,
400  options_trianglestrip);
401  gaussian_blur_noalpha_nodecal_pipelines_.CreateDefault(*context_,
402  options_trianglestrip);
403  kernel_decal_pipelines_.CreateDefault(*context_, options_trianglestrip);
404  kernel_nodecal_pipelines_.CreateDefault(*context_, options_trianglestrip);
405  border_mask_blur_pipelines_.CreateDefault(*context_, options_trianglestrip);
406  morphology_filter_pipelines_.CreateDefault(*context_, options_trianglestrip,
407  {supports_decal});
408  color_matrix_color_filter_pipelines_.CreateDefault(*context_,
409  options_trianglestrip);
410  linear_to_srgb_filter_pipelines_.CreateDefault(*context_,
411  options_trianglestrip);
412  srgb_to_linear_filter_pipelines_.CreateDefault(*context_,
413  options_trianglestrip);
414  glyph_atlas_pipelines_.CreateDefault(
415  *context_, options,
416  {static_cast<Scalar>(
417  GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
419  glyph_atlas_color_pipelines_.CreateDefault(*context_, options);
420  geometry_color_pipelines_.CreateDefault(*context_, options);
421  yuv_to_rgb_filter_pipelines_.CreateDefault(*context_, options_trianglestrip);
422  porter_duff_blend_pipelines_.CreateDefault(*context_, options_trianglestrip,
423  {supports_decal});
424  // GLES only shader that is unsupported on macOS.
425 #if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX)
426  if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
427  texture_external_pipelines_.CreateDefault(*context_, options);
428  }
429  if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
430  tiled_texture_external_pipelines_.CreateDefault(*context_, options);
431  }
432 #endif // IMPELLER_ENABLE_OPENGLES
433  if (context_->GetCapabilities()->SupportsCompute()) {
434  auto pipeline_desc =
436  point_field_compute_pipelines_ =
437  context_->GetPipelineLibrary()->GetPipeline(pipeline_desc).Get();
438 
439  auto uv_pipeline_desc =
441  uv_compute_pipelines_ =
442  context_->GetPipelineLibrary()->GetPipeline(uv_pipeline_desc).Get();
443  }
444 
445  /// Setup default clip pipeline.
446 
447  auto clip_pipeline_descriptor =
449  if (!clip_pipeline_descriptor.has_value()) {
450  return;
451  }
452  ContentContextOptions{
453  .sample_count = SampleCount::kCount4,
454  .color_attachment_pixel_format =
455  context_->GetCapabilities()->GetDefaultColorFormat()}
456  .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
457  // Disable write to all color attachments.
458  auto clip_color_attachments =
459  clip_pipeline_descriptor->GetColorAttachmentDescriptors();
460  for (auto& color_attachment : clip_color_attachments) {
461  color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
462  }
463  clip_pipeline_descriptor->SetColorAttachmentDescriptors(
464  std::move(clip_color_attachments));
465  clip_pipelines_.SetDefault(options, std::make_unique<ClipPipeline>(
466  *context_, clip_pipeline_descriptor));
467 
468  is_valid_ = true;
469  InitializeCommonlyUsedShadersIfNeeded();
470 }

References GetContext(), impeller::kA8UNormInt, impeller::kColor, impeller::kColorBurn, impeller::kColorDodge, impeller::kCount4, impeller::kDarken, impeller::kDifference, impeller::kExclusion, impeller::kHardLight, impeller::kHue, impeller::kLighten, impeller::kLuminosity, impeller::kMultiply, impeller::kNone, impeller::Context::kOpenGLES, impeller::kOverlay, impeller::kSaturation, impeller::kScreen, impeller::kSoftLight, impeller::kTriangleStrip, impeller::ComputePipelineBuilder< ComputeShader_ >::MakeDefaultPipelineDescriptor(), impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::MakeDefaultPipelineDescriptor(), and impeller::ContentContextOptions::sample_count.

◆ ~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 590 of file content_context.cc.

591  {
592  for (auto it = runtime_effect_pipelines_.begin();
593  it != runtime_effect_pipelines_.end();) {
594  if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
595  it = runtime_effect_pipelines_.erase(it);
596  } else {
597  it++;
598  }
599  }
600 }

Referenced by impeller::RuntimeEffectContents::Render(), and impeller::testing::TEST().

◆ GetBlendColorBurnPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendColorBurnPipeline ( ContentContextOptions  opts) const
inline

Definition at line 603 of file content_context.h.

604  {
605  return GetPipeline(blend_colorburn_pipelines_, opts);
606  }

◆ GetBlendColorDodgePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendColorDodgePipeline ( ContentContextOptions  opts) const
inline

Definition at line 608 of file content_context.h.

609  {
610  return GetPipeline(blend_colordodge_pipelines_, opts);
611  }

◆ GetBlendColorPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendColorPipeline ( ContentContextOptions  opts) const
inline

Definition at line 598 of file content_context.h.

599  {
600  return GetPipeline(blend_color_pipelines_, opts);
601  }

◆ GetBlendDarkenPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendDarkenPipeline ( ContentContextOptions  opts) const
inline

Definition at line 613 of file content_context.h.

614  {
615  return GetPipeline(blend_darken_pipelines_, opts);
616  }

◆ GetBlendDifferencePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendDifferencePipeline ( ContentContextOptions  opts) const
inline

Definition at line 618 of file content_context.h.

619  {
620  return GetPipeline(blend_difference_pipelines_, opts);
621  }

◆ GetBlendExclusionPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendExclusionPipeline ( ContentContextOptions  opts) const
inline

Definition at line 623 of file content_context.h.

624  {
625  return GetPipeline(blend_exclusion_pipelines_, opts);
626  }

◆ GetBlendHardLightPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendHardLightPipeline ( ContentContextOptions  opts) const
inline

Definition at line 628 of file content_context.h.

629  {
630  return GetPipeline(blend_hardlight_pipelines_, opts);
631  }

◆ GetBlendHuePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendHuePipeline ( ContentContextOptions  opts) const
inline

Definition at line 633 of file content_context.h.

634  {
635  return GetPipeline(blend_hue_pipelines_, opts);
636  }

◆ GetBlendLightenPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendLightenPipeline ( ContentContextOptions  opts) const
inline

Definition at line 638 of file content_context.h.

639  {
640  return GetPipeline(blend_lighten_pipelines_, opts);
641  }

◆ GetBlendLuminosityPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendLuminosityPipeline ( ContentContextOptions  opts) const
inline

Definition at line 643 of file content_context.h.

644  {
645  return GetPipeline(blend_luminosity_pipelines_, opts);
646  }

◆ GetBlendMultiplyPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendMultiplyPipeline ( ContentContextOptions  opts) const
inline

Definition at line 648 of file content_context.h.

649  {
650  return GetPipeline(blend_multiply_pipelines_, opts);
651  }

◆ GetBlendOverlayPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendOverlayPipeline ( ContentContextOptions  opts) const
inline

Definition at line 653 of file content_context.h.

654  {
655  return GetPipeline(blend_overlay_pipelines_, opts);
656  }

◆ GetBlendPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendPipeline ( ContentContextOptions  opts) const
inline

Definition at line 480 of file content_context.h.

481  {
482  return GetPipeline(texture_blend_pipelines_, opts);
483  }

Referenced by impeller::PipelineBlend().

◆ GetBlendSaturationPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendSaturationPipeline ( ContentContextOptions  opts) const
inline

Definition at line 658 of file content_context.h.

659  {
660  return GetPipeline(blend_saturation_pipelines_, opts);
661  }

◆ GetBlendScreenPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendScreenPipeline ( ContentContextOptions  opts) const
inline

Definition at line 663 of file content_context.h.

664  {
665  return GetPipeline(blend_screen_pipelines_, opts);
666  }

◆ GetBlendSoftLightPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBlendSoftLightPipeline ( ContentContextOptions  opts) const
inline

Definition at line 668 of file content_context.h.

669  {
670  return GetPipeline(blend_softlight_pipelines_, opts);
671  }

◆ GetBorderMaskBlurPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetBorderMaskBlurPipeline ( ContentContextOptions  opts) const
inline

Definition at line 541 of file content_context.h.

542  {
543  return GetPipeline(border_mask_blur_pipelines_, opts);
544  }

◆ GetCachedRuntimeEffectPipeline()

std::shared_ptr< Pipeline< PipelineDescriptor > > 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 577 of file content_context.cc.

581  {
582  RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
583  auto it = runtime_effect_pipelines_.find(key);
584  if (it == runtime_effect_pipelines_.end()) {
585  it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
586  }
587  return it->second;
588 }

Referenced by impeller::RuntimeEffectContents::Render(), and impeller::testing::TEST().

◆ GetClipPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetClipPipeline ( ContentContextOptions  opts) const
inline

Definition at line 566 of file content_context.h.

567  {
568  return GetPipeline(clip_pipelines_, opts);
569  }

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

◆ GetColorMatrixColorFilterPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetColorMatrixColorFilterPipeline ( ContentContextOptions  opts) const
inline

Definition at line 552 of file content_context.h.

552  {
553  return GetPipeline(color_matrix_color_filter_pipelines_, opts);
554  }

◆ GetConicalGradientFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetConicalGradientFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 460 of file content_context.h.

461  {
462  return GetPipeline(conical_gradient_fill_pipelines_, opts);
463  }

◆ GetConicalGradientSSBOFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetConicalGradientSSBOFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 444 of file content_context.h.

444  {
445  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
446  return GetPipeline(conical_gradient_ssbo_fill_pipelines_, opts);
447  }

References GetDeviceCapabilities().

◆ GetContext()

◆ GetDeviceCapabilities()

◆ GetFramebufferBlendColorBurnPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendColorBurnPipeline ( ContentContextOptions  opts) const
inline

Definition at line 681 of file content_context.h.

681  {
682  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
683  return GetPipeline(framebuffer_blend_colorburn_pipelines_, opts);
684  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendColorDodgePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendColorDodgePipeline ( ContentContextOptions  opts) const
inline

Definition at line 687 of file content_context.h.

687  {
688  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
689  return GetPipeline(framebuffer_blend_colordodge_pipelines_, opts);
690  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendColorPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendColorPipeline ( ContentContextOptions  opts) const
inline

Definition at line 675 of file content_context.h.

675  {
676  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
677  return GetPipeline(framebuffer_blend_color_pipelines_, opts);
678  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendDarkenPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendDarkenPipeline ( ContentContextOptions  opts) const
inline

Definition at line 693 of file content_context.h.

693  {
694  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
695  return GetPipeline(framebuffer_blend_darken_pipelines_, opts);
696  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendDifferencePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendDifferencePipeline ( ContentContextOptions  opts) const
inline

Definition at line 699 of file content_context.h.

699  {
700  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
701  return GetPipeline(framebuffer_blend_difference_pipelines_, opts);
702  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendExclusionPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendExclusionPipeline ( ContentContextOptions  opts) const
inline

Definition at line 705 of file content_context.h.

705  {
706  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
707  return GetPipeline(framebuffer_blend_exclusion_pipelines_, opts);
708  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendHardLightPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendHardLightPipeline ( ContentContextOptions  opts) const
inline

Definition at line 711 of file content_context.h.

711  {
712  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
713  return GetPipeline(framebuffer_blend_hardlight_pipelines_, opts);
714  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendHuePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendHuePipeline ( ContentContextOptions  opts) const
inline

Definition at line 716 of file content_context.h.

717  {
718  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
719  return GetPipeline(framebuffer_blend_hue_pipelines_, opts);
720  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendLightenPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendLightenPipeline ( ContentContextOptions  opts) const
inline

Definition at line 723 of file content_context.h.

723  {
724  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
725  return GetPipeline(framebuffer_blend_lighten_pipelines_, opts);
726  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendLuminosityPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendLuminosityPipeline ( ContentContextOptions  opts) const
inline

Definition at line 729 of file content_context.h.

729  {
730  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
731  return GetPipeline(framebuffer_blend_luminosity_pipelines_, opts);
732  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendMultiplyPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendMultiplyPipeline ( ContentContextOptions  opts) const
inline

Definition at line 735 of file content_context.h.

735  {
736  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
737  return GetPipeline(framebuffer_blend_multiply_pipelines_, opts);
738  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendOverlayPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendOverlayPipeline ( ContentContextOptions  opts) const
inline

Definition at line 741 of file content_context.h.

741  {
742  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
743  return GetPipeline(framebuffer_blend_overlay_pipelines_, opts);
744  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendSaturationPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendSaturationPipeline ( ContentContextOptions  opts) const
inline

Definition at line 747 of file content_context.h.

747  {
748  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
749  return GetPipeline(framebuffer_blend_saturation_pipelines_, opts);
750  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendScreenPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendScreenPipeline ( ContentContextOptions  opts) const
inline

Definition at line 753 of file content_context.h.

753  {
754  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
755  return GetPipeline(framebuffer_blend_screen_pipelines_, opts);
756  }

References GetDeviceCapabilities().

◆ GetFramebufferBlendSoftLightPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetFramebufferBlendSoftLightPipeline ( ContentContextOptions  opts) const
inline

Definition at line 759 of file content_context.h.

759  {
760  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
761  return GetPipeline(framebuffer_blend_softlight_pipelines_, opts);
762  }

References GetDeviceCapabilities().

◆ GetGaussianBlurDecalPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetGaussianBlurDecalPipeline ( ContentContextOptions  opts) const
inline

Definition at line 521 of file content_context.h.

522  {
523  return GetPipeline(gaussian_blur_noalpha_decal_pipelines_, opts);
524  }

◆ GetGaussianBlurPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetGaussianBlurPipeline ( ContentContextOptions  opts) const
inline

Definition at line 526 of file content_context.h.

527  {
528  return GetPipeline(gaussian_blur_noalpha_nodecal_pipelines_, opts);
529  }

◆ GetGeometryColorPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetGeometryColorPipeline ( ContentContextOptions  opts) const
inline

Definition at line 581 of file content_context.h.

582  {
583  return GetPipeline(geometry_color_pipelines_, opts);
584  }

Referenced by impeller::VerticesColorContents::Render(), and impeller::AtlasColorContents::Render().

◆ GetGlyphAtlasColorPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetGlyphAtlasColorPipeline ( ContentContextOptions  opts) const
inline

Definition at line 576 of file content_context.h.

577  {
578  return GetPipeline(glyph_atlas_color_pipelines_, opts);
579  }

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

◆ GetGlyphAtlasPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetGlyphAtlasPipeline ( ContentContextOptions  opts) const
inline

Definition at line 571 of file content_context.h.

572  {
573  return GetPipeline(glyph_atlas_pipelines_, opts);
574  }

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

◆ GetKernelDecalPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetKernelDecalPipeline ( ContentContextOptions  opts) const
inline

Definition at line 531 of file content_context.h.

532  {
533  return GetPipeline(kernel_decal_pipelines_, opts);
534  }

◆ GetKernelPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetKernelPipeline ( ContentContextOptions  opts) const
inline

Definition at line 536 of file content_context.h.

537  {
538  return GetPipeline(kernel_nodecal_pipelines_, opts);
539  }

◆ GetLazyGlyphAtlas()

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

Definition at line 801 of file content_context.h.

801  {
802  return lazy_glyph_atlas_;
803  }

Referenced by impeller::TextContents::Render(), and impeller::EntityPass::Render().

◆ GetLinearGradientFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetLinearGradientFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 426 of file content_context.h.

427  {
428  return GetPipeline(linear_gradient_fill_pipelines_, opts);
429  }

◆ GetLinearGradientSSBOFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetLinearGradientSSBOFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 432 of file content_context.h.

432  {
433  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
434  return GetPipeline(linear_gradient_ssbo_fill_pipelines_, opts);
435  }

References GetDeviceCapabilities().

◆ GetLinearToSrgbFilterPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetLinearToSrgbFilterPipeline ( ContentContextOptions  opts) const
inline

Definition at line 556 of file content_context.h.

557  {
558  return GetPipeline(linear_to_srgb_filter_pipelines_, opts);
559  }

◆ GetMorphologyFilterPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetMorphologyFilterPipeline ( ContentContextOptions  opts) const
inline

Definition at line 546 of file content_context.h.

547  {
548  return GetPipeline(morphology_filter_pipelines_, opts);
549  }

◆ GetPointComputePipeline()

std::shared_ptr<Pipeline<ComputePipelineDescriptor> > impeller::ContentContext::GetPointComputePipeline ( ) const
inline

Definition at line 764 of file content_context.h.

765  {
766  FML_DCHECK(GetDeviceCapabilities().SupportsCompute());
767  return point_field_compute_pipelines_;
768  }

References GetDeviceCapabilities().

◆ GetPorterDuffBlendPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetPorterDuffBlendPipeline ( ContentContextOptions  opts) const
inline

Definition at line 591 of file content_context.h.

592  {
593  return GetPipeline(porter_duff_blend_pipelines_, opts);
594  }

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

◆ GetPositionUVPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetPositionUVPipeline ( ContentContextOptions  opts) const
inline

Definition at line 511 of file content_context.h.

512  {
513  return GetPipeline(position_uv_pipelines_, opts);
514  }

◆ GetRadialGradientFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetRadialGradientFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 455 of file content_context.h.

456  {
457  return GetPipeline(radial_gradient_fill_pipelines_, opts);
458  }

◆ GetRadialGradientSSBOFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetRadialGradientSSBOFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 438 of file content_context.h.

438  {
439  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
440  return GetPipeline(radial_gradient_ssbo_fill_pipelines_, opts);
441  }

References GetDeviceCapabilities().

◆ GetRenderTargetCache()

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

◆ GetRRectBlurPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetRRectBlurPipeline ( ContentContextOptions  opts) const
inline

Definition at line 465 of file content_context.h.

466  {
467  return GetPipeline(rrect_blur_pipelines_, opts);
468  }

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

◆ GetSolidFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetSolidFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 475 of file content_context.h.

476  {
477  return GetPipeline(solid_fill_pipelines_, opts);
478  }

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

◆ GetSrgbToLinearFilterPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetSrgbToLinearFilterPipeline ( ContentContextOptions  opts) const
inline

Definition at line 561 of file content_context.h.

562  {
563  return GetPipeline(srgb_to_linear_filter_pipelines_, opts);
564  }

◆ GetSweepGradientFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetSweepGradientFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 470 of file content_context.h.

471  {
472  return GetPipeline(sweep_gradient_fill_pipelines_, opts);
473  }

◆ GetSweepGradientSSBOFillPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetSweepGradientSSBOFillPipeline ( ContentContextOptions  opts) const
inline

Definition at line 450 of file content_context.h.

450  {
451  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
452  return GetPipeline(sweep_gradient_ssbo_fill_pipelines_, opts);
453  }

References GetDeviceCapabilities().

◆ GetTessellator()

std::shared_ptr< Tessellator > impeller::ContentContext::GetTessellator ( ) const

Definition at line 560 of file content_context.cc.

560  {
561  return tessellator_;
562 }

◆ GetTexturePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetTexturePipeline ( ContentContextOptions  opts) const
inline

Definition at line 485 of file content_context.h.

486  {
487  return GetPipeline(texture_pipelines_, opts);
488  }

Referenced by impeller::TiledTextureContents::Render(), impeller::TextureContents::Render(), impeller::VerticesUVContents::Render(), and impeller::AtlasTextureContents::Render().

◆ GetTextureStrictSrcPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetTextureStrictSrcPipeline ( ContentContextOptions  opts) const
inline

Definition at line 490 of file content_context.h.

491  {
492  return GetPipeline(texture_strict_src_pipelines_, opts);
493  }

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

◆ GetTiledTexturePipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetTiledTexturePipeline ( ContentContextOptions  opts) const
inline

Definition at line 516 of file content_context.h.

517  {
518  return GetPipeline(tiled_texture_pipelines_, opts);
519  }

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

◆ GetTransientsBuffer()

◆ GetUvComputePipeline()

std::shared_ptr<Pipeline<ComputePipelineDescriptor> > impeller::ContentContext::GetUvComputePipeline ( ) const
inline

Definition at line 770 of file content_context.h.

771  {
772  FML_DCHECK(GetDeviceCapabilities().SupportsCompute());
773  return uv_compute_pipelines_;
774  }

References GetDeviceCapabilities().

◆ GetYUVToRGBFilterPipeline()

std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::ContentContext::GetYUVToRGBFilterPipeline ( ContentContextOptions  opts) const
inline

Definition at line 586 of file content_context.h.

587  {
588  return GetPipeline(yuv_to_rgb_filter_pipelines_, opts);
589  }

◆ IsValid()

bool impeller::ContentContext::IsValid ( ) const

Definition at line 474 of file content_context.cc.

474  {
475  return is_valid_;
476 }

Referenced by impeller::EntityPlayground::OpenPlaygroundHere(), and impeller::testing::TEST_P().

◆ MakeSubpass() [1/2]

fml::StatusOr< RenderTarget > impeller::ContentContext::MakeSubpass ( const std::string &  label,
const RenderTarget subpass_target,
const SubpassCallback subpass_callback 
) const

Makes a subpass that will render to subpass_target.

Definition at line 506 of file content_context.cc.

509  {
510  const std::shared_ptr<Context>& context = GetContext();
511 
512  auto subpass_texture = subpass_target.GetRenderTargetTexture();
513  if (!subpass_texture) {
514  return fml::Status(fml::StatusCode::kUnknown, "");
515  }
516 
517  auto sub_command_buffer = context->CreateCommandBuffer();
518  sub_command_buffer->SetLabel(SPrintF("%s CommandBuffer", label.c_str()));
519  if (!sub_command_buffer) {
520  return fml::Status(fml::StatusCode::kUnknown, "");
521  }
522 
523  auto sub_renderpass = sub_command_buffer->CreateRenderPass(subpass_target);
524  if (!sub_renderpass) {
525  return fml::Status(fml::StatusCode::kUnknown, "");
526  }
527  sub_renderpass->SetLabel(SPrintF("%s RenderPass", label.c_str()));
528 
529  if (!subpass_callback(*this, *sub_renderpass)) {
530  return fml::Status(fml::StatusCode::kUnknown, "");
531  }
532 
533  if (!sub_renderpass->EncodeCommands()) {
534  return fml::Status(fml::StatusCode::kUnknown, "");
535  }
536 
537  const std::shared_ptr<Texture>& target_texture =
538  subpass_target.GetRenderTargetTexture();
539  if (target_texture->GetMipCount() > 1) {
540  fml::Status mipmap_status =
541  AddMipmapGeneration(sub_command_buffer, context, target_texture);
542  if (!mipmap_status.ok()) {
543  return mipmap_status;
544  }
545  }
546 
547  if (!context->GetCommandQueue()->Submit({sub_command_buffer}).ok()) {
548  return fml::Status(fml::StatusCode::kUnknown, "");
549  }
550 
551  return subpass_target;
552 }

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

◆ MakeSubpass() [2/2]

fml::StatusOr< RenderTarget > impeller::ContentContext::MakeSubpass ( const std::string &  label,
ISize  texture_size,
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 478 of file content_context.cc.

484  {
485  const std::shared_ptr<Context>& context = GetContext();
486  RenderTarget subpass_target;
487 
488  std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
489  depth_stencil_enabled ? RenderTarget::kDefaultStencilAttachmentConfig
490  : std::optional<RenderTarget::AttachmentConfig>();
491 
492  if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
493  subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
494  *context, texture_size,
495  /*mip_count=*/mip_count, SPrintF("%s Offscreen", label.c_str()),
497  } else {
498  subpass_target = GetRenderTargetCache()->CreateOffscreen(
499  *context, texture_size,
500  /*mip_count=*/mip_count, SPrintF("%s Offscreen", label.c_str()),
501  RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
502  }
503  return MakeSubpass(label, subpass_target, subpass_callback);
504 }

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

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

◆ SetWireframe()

void impeller::ContentContext::SetWireframe ( bool  wireframe)

Definition at line 572 of file content_context.cc.

572  {
573  wireframe_ = wireframe;
574 }

Referenced by impeller::EntityPlayground::OpenPlaygroundHere(), and impeller::AiksInspector::RenderInspector().

Member Data Documentation

◆ kEnableStencilThenCover

constexpr bool impeller::ContentContext::kEnableStencilThenCover = true
staticconstexpr

This setting does two things:

  1. Enables clipping with the depth buffer, freeing up the stencil buffer. See also: https://github.com/flutter/flutter/issues/138460
  2. Switches the generic tessellation fallback to use stencil-then-cover. See also: https://github.com/flutter/flutter/issues/123671

Definition at line 411 of file content_context.h.

Referenced by impeller::EntityPassClipStack::ApplyClipState(), impeller::InlinePassContext::GetRenderPass(), impeller::OptionsFromPass(), impeller::ClipContents::Render(), impeller::SetClipScissor(), and impeller::testing::TEST_P().


The documentation for this class was generated from the following files:
impeller::BlendSelectValues::kSaturation
@ kSaturation
impeller::kColor
@ kColor
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::BlendSelectValues::kColorBurn
@ kColorBurn
impeller::RenderTarget::kDefaultColorAttachmentConfig
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
Definition: render_target.h:55
impeller::BlendSelectValues::kMultiply
@ kMultiply
impeller::AddMipmapGeneration
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_mipmap.cc:11
impeller::ColorWriteMaskBits::kNone
@ kNone
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::RenderTarget::kDefaultColorAttachmentConfigMSAA
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
Definition: render_target.h:61
impeller::HostBuffer::Create
static std::shared_ptr< HostBuffer > Create(const std::shared_ptr< Allocator > &allocator)
Definition: host_buffer.cc:20
impeller::BlendSelectValues::kSoftLight
@ kSoftLight
impeller::BlendSelectValues::kDifference
@ kDifference
impeller::BlendSelectValues::kDarken
@ kDarken
impeller::BlendSelectValues::kExclusion
@ kExclusion
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::ComputePipelineBuilder::MakeDefaultPipelineDescriptor
static std::optional< ComputePipelineDescriptor > MakeDefaultPipelineDescriptor(const Context &context)
Create a default pipeline descriptor using the combination reflected shader information....
Definition: compute_pipeline_builder.h:40
impeller::Context::BackendType::kOpenGLES
@ kOpenGLES
impeller::SPrintF
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
impeller::ContentContext::MakeSubpass
fml::StatusOr< RenderTarget > MakeSubpass(const std::string &label, ISize texture_size, 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...
Definition: content_context.cc:478
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:564
impeller::RenderTarget::kDefaultStencilAttachmentConfig
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
Definition: render_target.h:68
impeller::ContentContext::GetRenderTargetCache
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
Definition: content_context.h:805
impeller::ContentContext::GetDeviceCapabilities
const Capabilities & GetDeviceCapabilities() const
Definition: content_context.cc:568
impeller::BlendSelectValues::kHardLight
@ kHardLight
impeller::BlendSelectValues::kScreen
@ kScreen
impeller::BlendSelectValues::kLighten
@ kLighten
impeller::BlendSelectValues::kHue
@ kHue
impeller::SampleCount::kCount4
@ kCount4
impeller::BlendSelectValues::kLuminosity
@ kLuminosity
impeller::PipelineBuilder::MakeDefaultPipelineDescriptor
static std::optional< PipelineDescriptor > MakeDefaultPipelineDescriptor(const Context &context, const std::vector< Scalar > &constants={})
Create a default pipeline descriptor using the combination reflected shader information....
Definition: pipeline_builder.h:51
impeller::BlendSelectValues::kColorDodge
@ kColorDodge
impeller::BlendSelectValues::kOverlay
@ kOverlay