Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | List of all members
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 > > GetFastGradientPipeline (ContentContextOptions opts) 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 > > GetTexturePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTextureStrictSrcPipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTiledTexturePipeline (ContentContextOptions opts) const
 
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGaussianBlurPipeline (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 > > 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< PipelineDescriptor > > GetDrawVerticesUberShader (ContentContextOptions opts) const
 
std::shared_ptr< TextureGetEmptyTexture () const
 
std::shared_ptr< ContextGetContext () const
 
const CapabilitiesGetDeviceCapabilities () const
 
void SetWireframe (bool wireframe)
 
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
 
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...
 

Detailed Description

Definition at line 366 of file content_context.h.

Member Typedef Documentation

◆ SubpassCallback

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

245 : context_(std::move(context)),
246 lazy_glyph_atlas_(
247 std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
248 tessellator_(std::make_shared<Tessellator>()),
249#if IMPELLER_ENABLE_3D
250 scene_context_(std::make_shared<scene::SceneContext>(context_)),
251#endif // IMPELLER_ENABLE_3D
252 render_target_cache_(render_target_allocator == nullptr
253 ? std::make_shared<RenderTargetCache>(
254 context_->GetResourceAllocator())
255 : std::move(render_target_allocator)),
256 host_buffer_(HostBuffer::Create(context_->GetResourceAllocator())) {
257 if (!context_ || !context_->IsValid()) {
258 return;
259 }
260
261 {
262 TextureDescriptor desc;
263 desc.storage_mode = StorageMode::kHostVisible;
265 desc.size = ISize{1, 1};
266 empty_texture_ = GetContext()->GetResourceAllocator()->CreateTexture(desc);
268 auto cmd_buffer = GetContext()->CreateCommandBuffer();
269 auto blit_pass = cmd_buffer->CreateBlitPass();
270 auto& host_buffer = GetTransientsBuffer();
271 auto buffer_view = host_buffer.Emplace(data);
272 blit_pass->AddCopy(buffer_view, empty_texture_);
273
274 if (!blit_pass->EncodeCommands(GetContext()->GetResourceAllocator()) ||
275 !GetContext()
276 ->GetCommandQueue()
277 ->Submit({std::move(cmd_buffer)})
278 .ok()) {
279 VALIDATION_LOG << "Failed to create empty texture.";
280 }
281 }
282
283 auto options = ContentContextOptions{
284 .sample_count = SampleCount::kCount4,
285 .color_attachment_pixel_format =
286 context_->GetCapabilities()->GetDefaultColorFormat()};
287 auto options_trianglestrip = ContentContextOptions{
288 .sample_count = SampleCount::kCount4,
289 .primitive_type = PrimitiveType::kTriangleStrip,
290 .color_attachment_pixel_format =
291 context_->GetCapabilities()->GetDefaultColorFormat()};
292 const auto supports_decal = static_cast<Scalar>(
293 context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
294
295 {
296 solid_fill_pipelines_.CreateDefault(*context_, options);
297 texture_pipelines_.CreateDefault(*context_, options);
298 fast_gradient_pipelines_.CreateDefault(*context_, options);
299
300 if (context_->GetCapabilities()->SupportsSSBO()) {
301 linear_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
302 radial_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
303 conical_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
304 sweep_gradient_ssbo_fill_pipelines_.CreateDefault(*context_, options);
305 } else {
306 linear_gradient_fill_pipelines_.CreateDefault(*context_, options);
307 radial_gradient_fill_pipelines_.CreateDefault(*context_, options);
308 conical_gradient_fill_pipelines_.CreateDefault(*context_, options);
309 sweep_gradient_fill_pipelines_.CreateDefault(*context_, options);
310 }
311
312 /// Setup default clip pipeline.
313
314 auto clip_pipeline_descriptor =
316 if (!clip_pipeline_descriptor.has_value()) {
317 return;
318 }
319 ContentContextOptions{
320 .sample_count = SampleCount::kCount4,
321 .color_attachment_pixel_format =
322 context_->GetCapabilities()->GetDefaultColorFormat()}
323 .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
324 // Disable write to all color attachments.
325 auto clip_color_attachments =
326 clip_pipeline_descriptor->GetColorAttachmentDescriptors();
327 for (auto& color_attachment : clip_color_attachments) {
328 color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
329 }
330 clip_pipeline_descriptor->SetColorAttachmentDescriptors(
331 std::move(clip_color_attachments));
332 clip_pipelines_.SetDefault(
333 options,
334 std::make_unique<ClipPipeline>(*context_, clip_pipeline_descriptor));
335 }
336
337 if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
338 framebuffer_blend_color_pipelines_.CreateDefault(
339 *context_, options_trianglestrip,
340 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
341 framebuffer_blend_colorburn_pipelines_.CreateDefault(
342 *context_, options_trianglestrip,
343 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
344 framebuffer_blend_colordodge_pipelines_.CreateDefault(
345 *context_, options_trianglestrip,
346 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
347 framebuffer_blend_darken_pipelines_.CreateDefault(
348 *context_, options_trianglestrip,
349 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
350 framebuffer_blend_difference_pipelines_.CreateDefault(
351 *context_, options_trianglestrip,
352 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
353 framebuffer_blend_exclusion_pipelines_.CreateDefault(
354 *context_, options_trianglestrip,
355 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
356 framebuffer_blend_hardlight_pipelines_.CreateDefault(
357 *context_, options_trianglestrip,
358 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
359 framebuffer_blend_hue_pipelines_.CreateDefault(
360 *context_, options_trianglestrip,
361 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
362 framebuffer_blend_lighten_pipelines_.CreateDefault(
363 *context_, options_trianglestrip,
364 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
365 framebuffer_blend_luminosity_pipelines_.CreateDefault(
366 *context_, options_trianglestrip,
367 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
368 framebuffer_blend_multiply_pipelines_.CreateDefault(
369 *context_, options_trianglestrip,
370 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
371 framebuffer_blend_overlay_pipelines_.CreateDefault(
372 *context_, options_trianglestrip,
373 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
374 framebuffer_blend_saturation_pipelines_.CreateDefault(
375 *context_, options_trianglestrip,
376 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
377 framebuffer_blend_screen_pipelines_.CreateDefault(
378 *context_, options_trianglestrip,
379 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
380 framebuffer_blend_softlight_pipelines_.CreateDefault(
381 *context_, options_trianglestrip,
382 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
383 } else {
384 blend_color_pipelines_.CreateDefault(
385 *context_, options_trianglestrip,
386 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
387 blend_colorburn_pipelines_.CreateDefault(
388 *context_, options_trianglestrip,
389 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
390 blend_colordodge_pipelines_.CreateDefault(
391 *context_, options_trianglestrip,
392 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
393 blend_darken_pipelines_.CreateDefault(
394 *context_, options_trianglestrip,
395 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
396 blend_difference_pipelines_.CreateDefault(
397 *context_, options_trianglestrip,
398 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
399 blend_exclusion_pipelines_.CreateDefault(
400 *context_, options_trianglestrip,
401 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
402 blend_hardlight_pipelines_.CreateDefault(
403 *context_, options_trianglestrip,
404 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
405 blend_hue_pipelines_.CreateDefault(
406 *context_, options_trianglestrip,
407 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
408 blend_lighten_pipelines_.CreateDefault(
409 *context_, options_trianglestrip,
410 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
411 blend_luminosity_pipelines_.CreateDefault(
412 *context_, options_trianglestrip,
413 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
414 blend_multiply_pipelines_.CreateDefault(
415 *context_, options_trianglestrip,
416 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
417 blend_overlay_pipelines_.CreateDefault(
418 *context_, options_trianglestrip,
419 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
420 blend_saturation_pipelines_.CreateDefault(
421 *context_, options_trianglestrip,
422 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
423 blend_screen_pipelines_.CreateDefault(
424 *context_, options_trianglestrip,
425 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
426 blend_softlight_pipelines_.CreateDefault(
427 *context_, options_trianglestrip,
428 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
429 }
430
431 rrect_blur_pipelines_.CreateDefault(*context_, options_trianglestrip);
432 texture_strict_src_pipelines_.CreateDefault(*context_, options);
433 tiled_texture_pipelines_.CreateDefault(*context_, options, {supports_decal});
434 gaussian_blur_pipelines_.CreateDefault(*context_, options_trianglestrip,
435 {supports_decal});
436 border_mask_blur_pipelines_.CreateDefault(*context_, options_trianglestrip);
437 morphology_filter_pipelines_.CreateDefault(*context_, options_trianglestrip,
438 {supports_decal});
439 color_matrix_color_filter_pipelines_.CreateDefault(*context_,
440 options_trianglestrip);
441 linear_to_srgb_filter_pipelines_.CreateDefault(*context_,
442 options_trianglestrip);
443 srgb_to_linear_filter_pipelines_.CreateDefault(*context_,
444 options_trianglestrip);
445 glyph_atlas_pipelines_.CreateDefault(
446 *context_, options,
447 {static_cast<Scalar>(
448 GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
450 yuv_to_rgb_filter_pipelines_.CreateDefault(*context_, options_trianglestrip);
451 porter_duff_blend_pipelines_.CreateDefault(*context_, options_trianglestrip,
452 {supports_decal});
453 vertices_uber_shader_.CreateDefault(*context_, options, {supports_decal});
454 // GLES only shader that is unsupported on macOS.
455#if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX)
456 if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
457 tiled_texture_external_pipelines_.CreateDefault(*context_, options);
458 }
459#endif // IMPELLER_ENABLE_OPENGLES
460
461 is_valid_ = true;
462 InitializeCommonlyUsedShadersIfNeeded();
463}
const char * options
static bool ok(int result)
BufferView buffer_view
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
std::shared_ptr< Context > GetContext() const
static std::shared_ptr< HostBuffer > Create(const std::shared_ptr< Allocator > &allocator)
Definition: host_buffer.cc:20
float Scalar
Definition: scalar.h:18
ISize64 ISize
Definition: size.h:140
constexpr std::array< uint8_t, 4 > ToR8G8B8A8() const
Convert to R8G8B8A8 representation.
Definition: color.h:248
static constexpr Color BlackTransparent()
Definition: color.h:272
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:63
#define VALIDATION_LOG
Definition: validation.h:73

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

580 {
581 for (auto it = runtime_effect_pipelines_.begin();
582 it != runtime_effect_pipelines_.end();) {
583 if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
584 it = runtime_effect_pipelines_.erase(it);
585 } else {
586 it++;
587 }
588 }
589}

◆ GetBlendColorBurnPipeline()

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

Definition at line 523 of file content_context.h.

524 {
525 return GetPipeline(blend_colorburn_pipelines_, opts);
526 }

◆ GetBlendColorDodgePipeline()

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

Definition at line 528 of file content_context.h.

529 {
530 return GetPipeline(blend_colordodge_pipelines_, opts);
531 }

◆ GetBlendColorPipeline()

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

Definition at line 518 of file content_context.h.

519 {
520 return GetPipeline(blend_color_pipelines_, opts);
521 }

◆ GetBlendDarkenPipeline()

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

Definition at line 533 of file content_context.h.

534 {
535 return GetPipeline(blend_darken_pipelines_, opts);
536 }

◆ GetBlendDifferencePipeline()

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

Definition at line 538 of file content_context.h.

539 {
540 return GetPipeline(blend_difference_pipelines_, opts);
541 }

◆ GetBlendExclusionPipeline()

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

Definition at line 543 of file content_context.h.

544 {
545 return GetPipeline(blend_exclusion_pipelines_, opts);
546 }

◆ GetBlendHardLightPipeline()

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

Definition at line 548 of file content_context.h.

549 {
550 return GetPipeline(blend_hardlight_pipelines_, opts);
551 }

◆ GetBlendHuePipeline()

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

Definition at line 553 of file content_context.h.

554 {
555 return GetPipeline(blend_hue_pipelines_, opts);
556 }

◆ GetBlendLightenPipeline()

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

Definition at line 558 of file content_context.h.

559 {
560 return GetPipeline(blend_lighten_pipelines_, opts);
561 }

◆ GetBlendLuminosityPipeline()

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

Definition at line 563 of file content_context.h.

564 {
565 return GetPipeline(blend_luminosity_pipelines_, opts);
566 }

◆ GetBlendMultiplyPipeline()

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

Definition at line 568 of file content_context.h.

569 {
570 return GetPipeline(blend_multiply_pipelines_, opts);
571 }

◆ GetBlendOverlayPipeline()

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

Definition at line 573 of file content_context.h.

574 {
575 return GetPipeline(blend_overlay_pipelines_, opts);
576 }

◆ GetBlendSaturationPipeline()

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

Definition at line 578 of file content_context.h.

579 {
580 return GetPipeline(blend_saturation_pipelines_, opts);
581 }

◆ GetBlendScreenPipeline()

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

Definition at line 583 of file content_context.h.

584 {
585 return GetPipeline(blend_screen_pipelines_, opts);
586 }

◆ GetBlendSoftLightPipeline()

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

Definition at line 588 of file content_context.h.

589 {
590 return GetPipeline(blend_softlight_pipelines_, opts);
591 }

◆ GetBorderMaskBlurPipeline()

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

Definition at line 471 of file content_context.h.

472 {
473 return GetPipeline(border_mask_blur_pipelines_, opts);
474 }

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

570 {
571 RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
572 auto it = runtime_effect_pipelines_.find(key);
573 if (it == runtime_effect_pipelines_.end()) {
574 it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
575 }
576 return it->second;
577}

◆ GetClipPipeline()

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

Definition at line 496 of file content_context.h.

497 {
498 return GetPipeline(clip_pipelines_, opts);
499 }

◆ GetColorMatrixColorFilterPipeline()

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

Definition at line 482 of file content_context.h.

482 {
483 return GetPipeline(color_matrix_color_filter_pipelines_, opts);
484 }

◆ GetConicalGradientFillPipeline()

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

Definition at line 422 of file content_context.h.

423 {
424 return GetPipeline(conical_gradient_fill_pipelines_, opts);
425 }

◆ GetConicalGradientSSBOFillPipeline()

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

Definition at line 406 of file content_context.h.

406 {
407 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
408 return GetPipeline(conical_gradient_ssbo_fill_pipelines_, opts);
409 }
const Capabilities & GetDeviceCapabilities() const
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ GetContext()

std::shared_ptr< Context > impeller::ContentContext::GetContext ( ) const

Definition at line 553 of file content_context.cc.

553 {
554 return context_;
555}

◆ GetDeviceCapabilities()

const Capabilities & impeller::ContentContext::GetDeviceCapabilities ( ) const

Definition at line 557 of file content_context.cc.

557 {
558 return *context_->GetCapabilities();
559}

◆ GetDrawVerticesUberShader()

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

Definition at line 684 of file content_context.h.

685 {
686 return GetPipeline(vertices_uber_shader_, opts);
687 }

◆ GetEmptyTexture()

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

Definition at line 471 of file content_context.cc.

471 {
472 return empty_texture_;
473}

◆ GetFastGradientPipeline()

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

Definition at line 383 of file content_context.h.

384 {
385 return GetPipeline(fast_gradient_pipelines_, opts);
386 }

◆ GetFramebufferBlendColorBurnPipeline()

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

Definition at line 601 of file content_context.h.

601 {
602 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
603 return GetPipeline(framebuffer_blend_colorburn_pipelines_, opts);
604 }

◆ GetFramebufferBlendColorDodgePipeline()

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

Definition at line 607 of file content_context.h.

607 {
608 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
609 return GetPipeline(framebuffer_blend_colordodge_pipelines_, opts);
610 }

◆ GetFramebufferBlendColorPipeline()

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

Definition at line 595 of file content_context.h.

595 {
596 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
597 return GetPipeline(framebuffer_blend_color_pipelines_, opts);
598 }

◆ GetFramebufferBlendDarkenPipeline()

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

Definition at line 613 of file content_context.h.

613 {
614 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
615 return GetPipeline(framebuffer_blend_darken_pipelines_, opts);
616 }

◆ GetFramebufferBlendDifferencePipeline()

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

Definition at line 619 of file content_context.h.

619 {
620 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
621 return GetPipeline(framebuffer_blend_difference_pipelines_, opts);
622 }

◆ GetFramebufferBlendExclusionPipeline()

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

Definition at line 625 of file content_context.h.

625 {
626 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
627 return GetPipeline(framebuffer_blend_exclusion_pipelines_, opts);
628 }

◆ GetFramebufferBlendHardLightPipeline()

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

Definition at line 631 of file content_context.h.

631 {
632 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
633 return GetPipeline(framebuffer_blend_hardlight_pipelines_, opts);
634 }

◆ GetFramebufferBlendHuePipeline()

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

Definition at line 636 of file content_context.h.

637 {
638 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
639 return GetPipeline(framebuffer_blend_hue_pipelines_, opts);
640 }

◆ GetFramebufferBlendLightenPipeline()

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

Definition at line 643 of file content_context.h.

643 {
644 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
645 return GetPipeline(framebuffer_blend_lighten_pipelines_, opts);
646 }

◆ GetFramebufferBlendLuminosityPipeline()

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

Definition at line 649 of file content_context.h.

649 {
650 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
651 return GetPipeline(framebuffer_blend_luminosity_pipelines_, opts);
652 }

◆ GetFramebufferBlendMultiplyPipeline()

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

Definition at line 655 of file content_context.h.

655 {
656 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
657 return GetPipeline(framebuffer_blend_multiply_pipelines_, opts);
658 }

◆ GetFramebufferBlendOverlayPipeline()

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

Definition at line 661 of file content_context.h.

661 {
662 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
663 return GetPipeline(framebuffer_blend_overlay_pipelines_, opts);
664 }

◆ GetFramebufferBlendSaturationPipeline()

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

Definition at line 667 of file content_context.h.

667 {
668 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
669 return GetPipeline(framebuffer_blend_saturation_pipelines_, opts);
670 }

◆ GetFramebufferBlendScreenPipeline()

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

Definition at line 673 of file content_context.h.

673 {
674 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
675 return GetPipeline(framebuffer_blend_screen_pipelines_, opts);
676 }

◆ GetFramebufferBlendSoftLightPipeline()

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

Definition at line 679 of file content_context.h.

679 {
680 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
681 return GetPipeline(framebuffer_blend_softlight_pipelines_, opts);
682 }

◆ GetGaussianBlurPipeline()

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

Definition at line 466 of file content_context.h.

467 {
468 return GetPipeline(gaussian_blur_pipelines_, opts);
469 }

◆ GetGlyphAtlasPipeline()

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

Definition at line 501 of file content_context.h.

502 {
503 return GetPipeline(glyph_atlas_pipelines_, opts);
504 }

◆ GetLazyGlyphAtlas()

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

Definition at line 720 of file content_context.h.

720 {
721 return lazy_glyph_atlas_;
722 }

◆ GetLinearGradientFillPipeline()

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

Definition at line 388 of file content_context.h.

389 {
390 return GetPipeline(linear_gradient_fill_pipelines_, opts);
391 }

◆ GetLinearGradientSSBOFillPipeline()

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

Definition at line 394 of file content_context.h.

394 {
395 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
396 return GetPipeline(linear_gradient_ssbo_fill_pipelines_, opts);
397 }

◆ GetLinearToSrgbFilterPipeline()

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

Definition at line 486 of file content_context.h.

487 {
488 return GetPipeline(linear_to_srgb_filter_pipelines_, opts);
489 }

◆ GetMorphologyFilterPipeline()

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

Definition at line 476 of file content_context.h.

477 {
478 return GetPipeline(morphology_filter_pipelines_, opts);
479 }

◆ GetPorterDuffBlendPipeline()

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

Definition at line 511 of file content_context.h.

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

◆ GetRadialGradientFillPipeline()

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

Definition at line 417 of file content_context.h.

418 {
419 return GetPipeline(radial_gradient_fill_pipelines_, opts);
420 }

◆ GetRadialGradientSSBOFillPipeline()

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

Definition at line 400 of file content_context.h.

400 {
401 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
402 return GetPipeline(radial_gradient_ssbo_fill_pipelines_, opts);
403 }

◆ GetRenderTargetCache()

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

Definition at line 724 of file content_context.h.

724 {
725 return render_target_cache_;
726 }

◆ GetRRectBlurPipeline()

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

Definition at line 427 of file content_context.h.

428 {
429 return GetPipeline(rrect_blur_pipelines_, opts);
430 }

◆ GetSolidFillPipeline()

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

Definition at line 437 of file content_context.h.

438 {
439 return GetPipeline(solid_fill_pipelines_, opts);
440 }

◆ GetSrgbToLinearFilterPipeline()

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

Definition at line 491 of file content_context.h.

492 {
493 return GetPipeline(srgb_to_linear_filter_pipelines_, opts);
494 }

◆ GetSweepGradientFillPipeline()

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

Definition at line 432 of file content_context.h.

433 {
434 return GetPipeline(sweep_gradient_fill_pipelines_, opts);
435 }

◆ GetSweepGradientSSBOFillPipeline()

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

Definition at line 412 of file content_context.h.

412 {
413 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
414 return GetPipeline(sweep_gradient_ssbo_fill_pipelines_, opts);
415 }

◆ GetTessellator()

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

Definition at line 549 of file content_context.cc.

549 {
550 return tessellator_;
551}

◆ GetTexturePipeline()

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

Definition at line 442 of file content_context.h.

443 {
444 return GetPipeline(texture_pipelines_, opts);
445 }

◆ GetTextureStrictSrcPipeline()

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

Definition at line 447 of file content_context.h.

448 {
449 return GetPipeline(texture_strict_src_pipelines_, opts);
450 }

◆ GetTiledTexturePipeline()

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

Definition at line 461 of file content_context.h.

462 {
463 return GetPipeline(tiled_texture_pipelines_, opts);
464 }

◆ GetTransientsBuffer()

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

Retrieve the currnent host buffer for transient storage.

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

Definition at line 752 of file content_context.h.

752{ return *host_buffer_; }

◆ GetYUVToRGBFilterPipeline()

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

Definition at line 506 of file content_context.h.

507 {
508 return GetPipeline(yuv_to_rgb_filter_pipelines_, opts);
509 }

◆ IsValid()

bool impeller::ContentContext::IsValid ( ) const

Definition at line 467 of file content_context.cc.

467 {
468 return is_valid_;
469}

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

508 {
509 const std::shared_ptr<Context>& context = GetContext();
510
511 auto subpass_texture = subpass_target.GetRenderTargetTexture();
512 if (!subpass_texture) {
514 }
515
516 auto sub_renderpass = command_buffer->CreateRenderPass(subpass_target);
517 if (!sub_renderpass) {
519 }
520 sub_renderpass->SetLabel(SPrintF("%s RenderPass", label.data()));
521
522 if (!subpass_callback(*this, *sub_renderpass)) {
524 }
525
526 if (!sub_renderpass->EncodeCommands()) {
528 }
529
530 const std::shared_ptr<Texture>& target_texture =
531 subpass_target.GetRenderTargetTexture();
532 if (target_texture->GetMipCount() > 1) {
533 fml::Status mipmap_status =
534 AddMipmapGeneration(command_buffer, context, target_texture);
535 if (!mipmap_status.ok()) {
536 return mipmap_status;
537 }
538 }
539
540 return subpass_target;
541}
bool ok() const
Definition: status.h:71
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
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.
Task::Status Status
Definition: TaskList.cpp:15

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

482 {
483 const std::shared_ptr<Context>& context = GetContext();
484 RenderTarget subpass_target;
485
486 std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
488 : std::optional<RenderTarget::AttachmentConfig>();
489
490 if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
491 subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
492 *context, texture_size,
493 /*mip_count=*/mip_count, SPrintF("%s Offscreen", label.data()),
495 } else {
496 subpass_target = GetRenderTargetCache()->CreateOffscreen(
497 *context, texture_size,
498 /*mip_count=*/mip_count, SPrintF("%s Offscreen", label.data()),
499 RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
500 }
501 return MakeSubpass(label, subpass_target, command_buffer, subpass_callback);
502}
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
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...
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
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)

◆ SetWireframe()

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

Definition at line 561 of file content_context.cc.

561 {
562 wireframe_ = wireframe;
563}

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