Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
content_context.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7#include <format>
8#include <memory>
9#include <utility>
10
12#include "fml/trace_event.h"
29
30namespace impeller {
31
32namespace {
33
34/// A generic version of `Variants` which mostly exists to reduce code size.
35class GenericVariants {
36 public:
37 void Set(const ContentContextOptions& options,
38 std::unique_ptr<GenericRenderPipelineHandle> pipeline) {
39 uint64_t p_key = options.ToKey();
40 for (const auto& [key, pipeline] : pipelines_) {
41 if (key == p_key) {
42 return;
43 }
44 }
45 pipelines_.push_back(std::make_pair(p_key, std::move(pipeline)));
46 }
47
48 void SetDefault(const ContentContextOptions& options,
49 std::unique_ptr<GenericRenderPipelineHandle> pipeline) {
50 default_options_ = options;
51 if (pipeline) {
52 Set(options, std::move(pipeline));
53 }
54 }
55
56 GenericRenderPipelineHandle* Get(const ContentContextOptions& options) const {
57 uint64_t p_key = options.ToKey();
58 for (const auto& [key, pipeline] : pipelines_) {
59 if (key == p_key) {
60 return pipeline.get();
61 }
62 }
63 return nullptr;
64 }
65
66 void SetDefaultDescriptor(std::optional<PipelineDescriptor> desc) {
67 desc_ = std::move(desc);
68 }
69
70 size_t GetPipelineCount() const { return pipelines_.size(); }
71
72 bool IsDefault(const ContentContextOptions& opts) {
73 return default_options_.has_value() &&
74 opts.ToKey() == default_options_.value().ToKey();
75 }
76
77 protected:
78 std::optional<PipelineDescriptor> desc_;
79 std::optional<ContentContextOptions> default_options_;
80 std::vector<std::pair<uint64_t, std::unique_ptr<GenericRenderPipelineHandle>>>
82};
83
84/// Holds multiple Pipelines associated with the same PipelineHandle types.
85///
86/// For example, it may have multiple
87/// RenderPipelineHandle<SolidFillVertexShader, SolidFillFragmentShader>
88/// instances for different blend modes. From them you can access the
89/// Pipeline.
90///
91/// See also:
92/// - impeller::ContentContextOptions - options from which variants are
93/// created.
94/// - impeller::Pipeline::CreateVariant
95/// - impeller::RenderPipelineHandle<> - The type of objects this typically
96/// contains.
97template <class PipelineHandleT>
98class Variants : public GenericVariants {
99 static_assert(
100 ShaderStageCompatibilityChecker<
101 typename PipelineHandleT::VertexShader,
102 typename PipelineHandleT::FragmentShader>::Check(),
103 "The output slots for the fragment shader don't have matches in the "
104 "vertex shader's output slots. This will result in a linker error.");
105
106 public:
107 Variants() = default;
108
109 void Set(const ContentContextOptions& options,
110 std::unique_ptr<PipelineHandleT> pipeline) {
111 GenericVariants::Set(options, std::move(pipeline));
112 }
113
114 void SetDefault(const ContentContextOptions& options,
115 std::unique_ptr<PipelineHandleT> pipeline) {
116 GenericVariants::SetDefault(options, std::move(pipeline));
117 }
118
119 void CreateDefault(const Context& context,
120 const ContentContextOptions& options,
121 const std::vector<Scalar>& constants = {}) {
122 std::optional<PipelineDescriptor> desc =
123 PipelineHandleT::Builder::MakeDefaultPipelineDescriptor(context,
124 constants);
125 if (!desc.has_value()) {
126 VALIDATION_LOG << "Failed to create default pipeline.";
127 return;
128 }
129 context.GetPipelineLibrary()->LogPipelineCreation(*desc);
130 options.ApplyToPipelineDescriptor(*desc);
131 desc_ = desc;
132 SetDefault(options, std::make_unique<PipelineHandleT>(context, desc_,
133 /*async=*/true));
134 }
135
136 PipelineHandleT* Get(const ContentContextOptions& options) const {
137 return static_cast<PipelineHandleT*>(GenericVariants::Get(options));
138 }
139
140 PipelineHandleT* GetDefault(const Context& context) {
141 if (!default_options_.has_value()) {
142 return nullptr;
143 }
144 PipelineHandleT* result = Get(default_options_.value());
145 if (result != nullptr) {
146 return result;
147 }
148 SetDefault(default_options_.value(), std::make_unique<PipelineHandleT>(
149 context, desc_, /*async=*/false));
150 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
151 return Get(default_options_.value());
152 }
153
154 private:
155 Variants(const Variants&) = delete;
156
157 Variants& operator=(const Variants&) = delete;
158};
159
160template <class RenderPipelineHandleT>
161RenderPipelineHandleT* CreateIfNeeded(
162 const ContentContext* context,
163 Variants<RenderPipelineHandleT>& container,
164 ContentContextOptions opts,
165 PipelineCompileQueue* compile_queue) {
166 if (!context->IsValid()) {
167 return nullptr;
168 }
169
170 if (RenderPipelineHandleT* found = container.Get(opts)) {
171 return found;
172 }
173
174 RenderPipelineHandleT* default_handle =
175 container.GetDefault(*context->GetContext());
176 if (container.IsDefault(opts)) {
177 return default_handle;
178 }
179
180 // The default must always be initialized in the constructor.
181 FML_CHECK(default_handle != nullptr);
182
183 const std::shared_ptr<Pipeline<PipelineDescriptor>>& pipeline =
184 default_handle->WaitAndGet(compile_queue);
185 if (!pipeline) {
186 return nullptr;
187 }
188
189 auto variant_future = pipeline->CreateVariant(
190 /*async=*/false, [&opts, variants_count = container.GetPipelineCount()](
191 PipelineDescriptor& desc) {
192 opts.ApplyToPipelineDescriptor(desc);
193 desc.SetLabel(std::format("{} V#{}", desc.GetLabel(), variants_count));
194 });
195 std::unique_ptr<RenderPipelineHandleT> variant =
196 std::make_unique<RenderPipelineHandleT>(std::move(variant_future));
197 container.Set(opts, std::move(variant));
198 return container.Get(opts);
199}
200
201template <class TypedPipeline>
202PipelineRef GetPipeline(const ContentContext* context,
203 Variants<TypedPipeline>& container,
204 ContentContextOptions opts) {
205 auto compile_queue =
206 context->GetContext()->GetPipelineLibrary()->GetPipelineCompileQueue();
207 TypedPipeline* pipeline =
208 CreateIfNeeded(context, container, opts, compile_queue);
209 if (!pipeline) {
210 return raw_ptr<Pipeline<PipelineDescriptor>>();
211 }
212 return raw_ptr(pipeline->WaitAndGet(compile_queue));
213}
214
215} // namespace
216
218 // clang-format off
219 Variants<BlendColorBurnPipeline> blend_colorburn;
220 Variants<BlendColorDodgePipeline> blend_colordodge;
221 Variants<BlendColorPipeline> blend_color;
222 Variants<BlendDarkenPipeline> blend_darken;
223 Variants<BlendDifferencePipeline> blend_difference;
224 Variants<BlendExclusionPipeline> blend_exclusion;
225 Variants<BlendHardLightPipeline> blend_hardlight;
226 Variants<BlendHuePipeline> blend_hue;
227 Variants<BlendLightenPipeline> blend_lighten;
228 Variants<BlendLuminosityPipeline> blend_luminosity;
229 Variants<BlendMultiplyPipeline> blend_multiply;
230 Variants<BlendOverlayPipeline> blend_overlay;
231 Variants<BlendSaturationPipeline> blend_saturation;
232 Variants<BlendScreenPipeline> blend_screen;
233 Variants<BlendSoftLightPipeline> blend_softlight;
234 Variants<BorderMaskBlurPipeline> border_mask_blur;
235 Variants<CirclePipeline> circle;
236 Variants<ClipPipeline> clip;
237 Variants<ColorMatrixColorFilterPipeline> color_matrix_color_filter;
238 Variants<ConicalGradientFillConicalPipeline> conical_gradient_fill;
239 Variants<ConicalGradientFillRadialPipeline> conical_gradient_fill_radial;
240 Variants<ConicalGradientFillStripPipeline> conical_gradient_fill_strip;
241 Variants<ConicalGradientFillStripRadialPipeline> conical_gradient_fill_strip_and_radial;
242 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill;
243 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_radial;
244 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_strip_and_radial;
245 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_strip;
246 Variants<ConicalGradientUniformFillConicalPipeline> conical_gradient_uniform_fill;
247 Variants<ConicalGradientUniformFillRadialPipeline> conical_gradient_uniform_fill_radial;
248 Variants<ConicalGradientUniformFillStripPipeline> conical_gradient_uniform_fill_strip;
249 Variants<ConicalGradientUniformFillStripRadialPipeline> conical_gradient_uniform_fill_strip_and_radial;
250 Variants<FastGradientPipeline> fast_gradient;
251 Variants<FramebufferBlendColorBurnPipeline> framebuffer_blend_colorburn;
252 Variants<FramebufferBlendColorDodgePipeline> framebuffer_blend_colordodge;
253 Variants<FramebufferBlendColorPipeline> framebuffer_blend_color;
254 Variants<FramebufferBlendDarkenPipeline> framebuffer_blend_darken;
255 Variants<FramebufferBlendDifferencePipeline> framebuffer_blend_difference;
256 Variants<FramebufferBlendExclusionPipeline> framebuffer_blend_exclusion;
257 Variants<FramebufferBlendHardLightPipeline> framebuffer_blend_hardlight;
258 Variants<FramebufferBlendHuePipeline> framebuffer_blend_hue;
259 Variants<FramebufferBlendLightenPipeline> framebuffer_blend_lighten;
260 Variants<FramebufferBlendLuminosityPipeline> framebuffer_blend_luminosity;
261 Variants<FramebufferBlendMultiplyPipeline> framebuffer_blend_multiply;
262 Variants<FramebufferBlendOverlayPipeline> framebuffer_blend_overlay;
263 Variants<FramebufferBlendSaturationPipeline> framebuffer_blend_saturation;
264 Variants<FramebufferBlendScreenPipeline> framebuffer_blend_screen;
265 Variants<FramebufferBlendSoftLightPipeline> framebuffer_blend_softlight;
266 Variants<GaussianBlurPipeline> gaussian_blur;
267 Variants<GlyphAtlasPipeline> glyph_atlas;
268 Variants<LinePipeline> line;
269 Variants<LinearGradientFillPipeline> linear_gradient_fill;
270 Variants<LinearGradientSSBOFillPipeline> linear_gradient_ssbo_fill;
271 Variants<LinearGradientUniformFillPipeline> linear_gradient_uniform_fill;
272 Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter;
273 Variants<MorphologyFilterPipeline> morphology_filter;
274 Variants<PorterDuffBlendPipeline> clear_blend;
275 Variants<PorterDuffBlendPipeline> destination_a_top_blend;
276 Variants<PorterDuffBlendPipeline> destination_blend;
277 Variants<PorterDuffBlendPipeline> destination_in_blend;
278 Variants<PorterDuffBlendPipeline> destination_out_blend;
279 Variants<PorterDuffBlendPipeline> destination_over_blend;
280 Variants<PorterDuffBlendPipeline> modulate_blend;
281 Variants<PorterDuffBlendPipeline> plus_blend;
282 Variants<PorterDuffBlendPipeline> screen_blend;
283 Variants<PorterDuffBlendPipeline> source_a_top_blend;
284 Variants<PorterDuffBlendPipeline> source_blend;
285 Variants<PorterDuffBlendPipeline> source_in_blend;
286 Variants<PorterDuffBlendPipeline> source_out_blend;
287 Variants<PorterDuffBlendPipeline> source_over_blend;
288 Variants<PorterDuffBlendPipeline> xor_blend;
289 Variants<RadialGradientFillPipeline> radial_gradient_fill;
290 Variants<RadialGradientSSBOFillPipeline> radial_gradient_ssbo_fill;
291 Variants<RadialGradientUniformFillPipeline> radial_gradient_uniform_fill;
292 Variants<RRectBlurPipeline> rrect_blur;
293 Variants<RSuperellipseBlurPipeline> rsuperellipse_blur;
294 Variants<ShadowVerticesShader> shadow_vertices_;
295 Variants<SolidFillPipeline> solid_fill;
296 Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter;
297 Variants<SweepGradientFillPipeline> sweep_gradient_fill;
298 Variants<SweepGradientSSBOFillPipeline> sweep_gradient_ssbo_fill;
299 Variants<SweepGradientUniformFillPipeline> sweep_gradient_uniform_fill;
300 Variants<TextureDownsamplePipeline> texture_downsample;
301 Variants<TextureDownsampleBoundedPipeline> texture_downsample_bounded;
302 Variants<TexturePipeline> texture;
303 Variants<TextureStrictSrcPipeline> texture_strict_src;
304 Variants<TiledTexturePipeline> tiled_texture;
305 Variants<VerticesUber1Shader> vertices_uber_1_;
306 Variants<VerticesUber2Shader> vertices_uber_2_;
307 Variants<UberSDFPipeline> uber_sdf;
308 Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter;
309
310// Web doesn't support external texture OpenGL extensions
311#if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_EMSCRIPTEN)
312 Variants<TiledTextureExternalPipeline> tiled_texture_external;
313 Variants<TiledTextureUvExternalPipeline> tiled_texture_uv_external;
314#endif
315
316#if defined(IMPELLER_ENABLE_OPENGLES)
317 Variants<TextureDownsampleGlesPipeline> texture_downsample_gles;
318#endif // IMPELLER_ENABLE_OPENGLES
319 // clang-format on
320};
321
323 PipelineDescriptor& desc) const {
324 auto pipeline_blend = blend_mode;
326 VALIDATION_LOG << "Cannot use blend mode " << static_cast<int>(blend_mode)
327 << " as a pipeline blend.";
328 pipeline_blend = BlendMode::kSrcOver;
329 }
330
332
338
339 switch (pipeline_blend) {
348 } else {
353 }
354 break;
355 case BlendMode::kSrc:
356 color0.blending_enabled = false;
361 break;
362 case BlendMode::kDst:
368 break;
374 break;
380 break;
386 break;
392 break;
398 break;
404 break;
410 break;
416 break;
417 case BlendMode::kXor:
422 break;
423 case BlendMode::kPlus:
428 break;
434 break;
435 default:
437 }
438 desc.SetColorAttachmentDescriptor(0u, color0);
439
443 }
444
445 auto maybe_stencil = desc.GetFrontStencilAttachmentDescriptor();
446 auto maybe_depth = desc.GetDepthStencilAttachmentDescriptor();
447 FML_DCHECK(has_depth_stencil_attachments == maybe_depth.has_value())
448 << "Depth attachment doesn't match expected pipeline state. "
449 "has_depth_stencil_attachments="
451 FML_DCHECK(has_depth_stencil_attachments == maybe_stencil.has_value())
452 << "Stencil attachment doesn't match expected pipeline state. "
453 "has_depth_stencil_attachments="
455 if (maybe_stencil.has_value()) {
456 StencilAttachmentDescriptor front_stencil = maybe_stencil.value();
457 StencilAttachmentDescriptor back_stencil = front_stencil;
458
459 switch (stencil_mode) {
463 desc.SetStencilAttachmentDescriptors(front_stencil);
464 break;
466 // The stencil ref should be 0 on commands that use this mode.
471 desc.SetStencilAttachmentDescriptors(front_stencil, back_stencil);
472 break;
474 // The stencil ref should be 0 on commands that use this mode.
478 desc.SetStencilAttachmentDescriptors(front_stencil);
479 break;
481 // The stencil ref should be 0 on commands that use this mode.
484 desc.SetStencilAttachmentDescriptors(front_stencil);
485 break;
487 // The stencil ref should be 0 on commands that use this mode.
489 front_stencil.depth_stencil_pass =
491 desc.SetStencilAttachmentDescriptors(front_stencil);
492 break;
494 // The stencil ref should be 0 on commands that use this mode.
497 desc.SetStencilAttachmentDescriptors(front_stencil);
498 break;
499 }
500 }
501 if (maybe_depth.has_value()) {
502 DepthAttachmentDescriptor depth = maybe_depth.value();
506 }
507
510}
511
512std::array<std::vector<Scalar>, 15> GetPorterDuffSpecConstants(
513 bool supports_decal) {
514 Scalar x = supports_decal ? 1 : 0;
515 return {{
516 {x, 0, 0, 0, 0, 0}, // Clear
517 {x, 1, 0, 0, 0, 0}, // Source
518 {x, 0, 0, 1, 0, 0}, // Destination
519 {x, 1, 0, 1, -1, 0}, // SourceOver
520 {x, 1, -1, 1, 0, 0}, // DestinationOver
521 {x, 0, 1, 0, 0, 0}, // SourceIn
522 {x, 0, 0, 0, 1, 0}, // DestinationIn
523 {x, 1, -1, 0, 0, 0}, // SourceOut
524 {x, 0, 0, 1, -1, 0}, // DestinationOut
525 {x, 0, 1, 1, -1, 0}, // SourceATop
526 {x, 1, -1, 0, 1, 0}, // DestinationATop
527 {x, 1, -1, 1, -1, 0}, // Xor
528 {x, 1, 0, 1, 0, 0}, // Plus
529 {x, 0, 0, 0, 0, 1}, // Modulate
530 {x, 0, 0, 1, 0, -1}, // Screen
531 }};
532}
533
534template <typename PipelineT>
535static std::unique_ptr<PipelineT> CreateDefaultPipeline(
536 const Context& context) {
537 auto desc = PipelineT::Builder::MakeDefaultPipelineDescriptor(context);
538 if (!desc.has_value()) {
539 return nullptr;
540 }
541 // Apply default ContentContextOptions to the descriptor.
542 const auto default_color_format =
543 context.GetCapabilities()->GetDefaultColorFormat();
545 .primitive_type = PrimitiveType::kTriangleStrip,
546 .color_attachment_pixel_format = default_color_format}
547 .ApplyToPipelineDescriptor(*desc);
548 return std::make_unique<PipelineT>(context, desc);
549}
550
552 std::shared_ptr<Context> context,
553 std::shared_ptr<TypographerContext> typographer_context,
554 std::shared_ptr<RenderTargetAllocator> render_target_allocator)
555 : context_(std::move(context)),
556 lazy_glyph_atlas_(
557 std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
558 pipelines_(new Pipelines()),
559 tessellator_(std::make_shared<Tessellator>(
560 context_->GetCapabilities()->Supports32BitPrimitiveIndices())),
561 render_target_cache_(render_target_allocator == nullptr
562 ? std::make_shared<RenderTargetCache>(
563 context_->GetResourceAllocator())
564 : std::move(render_target_allocator)),
565 data_host_buffer_(HostBuffer::Create(
566 context_->GetResourceAllocator(),
567 context_->GetIdleWaiter(),
568 context_->GetCapabilities()->GetMinimumUniformAlignment())),
569 text_shadow_cache_(std::make_unique<TextShadowCache>()) {
570 if (!context_ || !context_->IsValid()) {
571 return;
572 }
573
574 // On most backends, indexes and other data can be allocated into the same
575 // buffers. However, some backends (namely WebGL) require indexes used in
576 // indexed draws to be allocated separately from other data. For those
577 // backends, we allocate a separate host buffer just for indexes.
578 indexes_host_buffer_ =
579 context_->GetCapabilities()->NeedsPartitionedHostBuffer()
581 context_->GetResourceAllocator(), context_->GetIdleWaiter(),
582 context_->GetCapabilities()->GetMinimumUniformAlignment())
583 : data_host_buffer_;
584 {
588 desc.size = ISize{1, 1};
589 empty_texture_ = GetContext()->GetResourceAllocator()->CreateTexture(desc);
590
591 std::array<uint8_t, 4> data = Color::BlackTransparent().ToR8G8B8A8();
592 std::shared_ptr<CommandBuffer> cmd_buffer =
593 GetContext()->CreateCommandBuffer();
594 std::shared_ptr<BlitPass> blit_pass = cmd_buffer->CreateBlitPass();
595 HostBuffer& data_host_buffer = GetTransientsDataBuffer();
596 BufferView buffer_view = data_host_buffer.Emplace(data);
597 blit_pass->AddCopy(buffer_view, empty_texture_);
598
599 if (!blit_pass->EncodeCommands() || !GetContext()
600 ->GetCommandQueue()
601 ->Submit({std::move(cmd_buffer)})
602 .ok()) {
603 VALIDATION_LOG << "Failed to create empty texture.";
604 }
605 }
606
607 auto options = ContentContextOptions{
609 .color_attachment_pixel_format =
610 context_->GetCapabilities()->GetDefaultColorFormat()};
611 auto options_trianglestrip = ContentContextOptions{
613 .primitive_type = PrimitiveType::kTriangleStrip,
614 .color_attachment_pixel_format =
615 context_->GetCapabilities()->GetDefaultColorFormat()};
616 auto options_no_msaa_no_depth_stencil = ContentContextOptions{
618 .primitive_type = PrimitiveType::kTriangleStrip,
619 .color_attachment_pixel_format =
620 context_->GetCapabilities()->GetDefaultColorFormat(),
621 .has_depth_stencil_attachments = false};
622 const auto supports_decal = static_cast<Scalar>(
623 context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
624
625 // Futures for the following pipelines may block in case the first frame is
626 // rendered without the pipelines being ready. Put pipelines that are more
627 // likely to be used first.
628 {
629 pipelines_->glyph_atlas.CreateDefault(
630 *context_, options,
631 {static_cast<Scalar>(
632 GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
634 pipelines_->solid_fill.CreateDefault(*context_, options);
635 pipelines_->texture.CreateDefault(*context_, options);
636 pipelines_->fast_gradient.CreateDefault(*context_, options);
637 pipelines_->line.CreateDefault(*context_, options);
638 pipelines_->circle.CreateDefault(*context_, options);
639 if (context_->GetFlags().use_sdfs) {
640 pipelines_->uber_sdf.CreateDefault(*context_, options);
641 }
642
643 if (context_->GetCapabilities()->SupportsSSBO()) {
644 pipelines_->linear_gradient_ssbo_fill.CreateDefault(*context_, options);
645 pipelines_->radial_gradient_ssbo_fill.CreateDefault(*context_, options);
646 pipelines_->conical_gradient_ssbo_fill.CreateDefault(*context_, options,
647 {3.0});
648 pipelines_->conical_gradient_ssbo_fill_radial.CreateDefault(
649 *context_, options, {1.0});
650 pipelines_->conical_gradient_ssbo_fill_strip.CreateDefault(
651 *context_, options, {2.0});
652 pipelines_->conical_gradient_ssbo_fill_strip_and_radial.CreateDefault(
653 *context_, options, {0.0});
654 pipelines_->sweep_gradient_ssbo_fill.CreateDefault(*context_, options);
655 } else {
656 pipelines_->linear_gradient_uniform_fill.CreateDefault(*context_,
657 options);
658 pipelines_->radial_gradient_uniform_fill.CreateDefault(*context_,
659 options);
660 pipelines_->conical_gradient_uniform_fill.CreateDefault(*context_,
661 options);
662 pipelines_->conical_gradient_uniform_fill_radial.CreateDefault(*context_,
663 options);
664 pipelines_->conical_gradient_uniform_fill_strip.CreateDefault(*context_,
665 options);
666 pipelines_->conical_gradient_uniform_fill_strip_and_radial.CreateDefault(
667 *context_, options);
668 pipelines_->sweep_gradient_uniform_fill.CreateDefault(*context_, options);
669
670 pipelines_->linear_gradient_fill.CreateDefault(*context_, options);
671 pipelines_->radial_gradient_fill.CreateDefault(*context_, options);
672 pipelines_->conical_gradient_fill.CreateDefault(*context_, options);
673 pipelines_->conical_gradient_fill_radial.CreateDefault(*context_,
674 options);
675 pipelines_->conical_gradient_fill_strip.CreateDefault(*context_, options);
676 pipelines_->conical_gradient_fill_strip_and_radial.CreateDefault(
677 *context_, options);
678 pipelines_->sweep_gradient_fill.CreateDefault(*context_, options);
679 }
680
681 /// Setup default clip pipeline.
682 auto clip_pipeline_descriptor =
683 ClipPipeline::Builder::MakeDefaultPipelineDescriptor(*context_);
684 if (!clip_pipeline_descriptor.has_value()) {
685 return;
686 }
689 .color_attachment_pixel_format =
690 context_->GetCapabilities()->GetDefaultColorFormat()}
691 .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
692 // Disable write to all color attachments.
693 auto clip_color_attachments =
694 clip_pipeline_descriptor->GetColorAttachmentDescriptors();
695 for (auto& color_attachment : clip_color_attachments) {
696 color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
697 }
698 clip_pipeline_descriptor->SetColorAttachmentDescriptors(
699 std::move(clip_color_attachments));
700 pipelines_->clip.SetDefault(
701 options,
702 std::make_unique<ClipPipeline>(*context_, clip_pipeline_descriptor));
703 pipelines_->texture_downsample.CreateDefault(
704 *context_, options_no_msaa_no_depth_stencil);
705 pipelines_->texture_downsample_bounded.CreateDefault(
706 *context_, options_no_msaa_no_depth_stencil);
707 pipelines_->rrect_blur.CreateDefault(*context_, options_trianglestrip);
708 pipelines_->rsuperellipse_blur.CreateDefault(*context_,
709 options_trianglestrip);
710 pipelines_->texture_strict_src.CreateDefault(*context_, options);
711 pipelines_->tiled_texture.CreateDefault(*context_, options,
712 {supports_decal});
713 pipelines_->gaussian_blur.CreateDefault(
714 *context_, options_no_msaa_no_depth_stencil, {supports_decal});
715 pipelines_->border_mask_blur.CreateDefault(*context_,
716 options_trianglestrip);
717 pipelines_->color_matrix_color_filter.CreateDefault(*context_,
718 options_trianglestrip);
719 pipelines_->shadow_vertices_.CreateDefault(*context_, options);
720 pipelines_->vertices_uber_1_.CreateDefault(*context_, options,
721 {supports_decal});
722 pipelines_->vertices_uber_2_.CreateDefault(*context_, options,
723 {supports_decal});
724
725 const std::array<std::vector<Scalar>, 15> porter_duff_constants =
726 GetPorterDuffSpecConstants(supports_decal);
727 pipelines_->clear_blend.CreateDefault(*context_, options_trianglestrip,
728 porter_duff_constants[0]);
729 pipelines_->source_blend.CreateDefault(*context_, options_trianglestrip,
730 porter_duff_constants[1]);
731 pipelines_->destination_blend.CreateDefault(
732 *context_, options_trianglestrip, porter_duff_constants[2]);
733 pipelines_->source_over_blend.CreateDefault(
734 *context_, options_trianglestrip, porter_duff_constants[3]);
735 pipelines_->destination_over_blend.CreateDefault(
736 *context_, options_trianglestrip, porter_duff_constants[4]);
737 pipelines_->source_in_blend.CreateDefault(*context_, options_trianglestrip,
738 porter_duff_constants[5]);
739 pipelines_->destination_in_blend.CreateDefault(
740 *context_, options_trianglestrip, porter_duff_constants[6]);
741 pipelines_->source_out_blend.CreateDefault(*context_, options_trianglestrip,
742 porter_duff_constants[7]);
743 pipelines_->destination_out_blend.CreateDefault(
744 *context_, options_trianglestrip, porter_duff_constants[8]);
745 pipelines_->source_a_top_blend.CreateDefault(
746 *context_, options_trianglestrip, porter_duff_constants[9]);
747 pipelines_->destination_a_top_blend.CreateDefault(
748 *context_, options_trianglestrip, porter_duff_constants[10]);
749 pipelines_->xor_blend.CreateDefault(*context_, options_trianglestrip,
750 porter_duff_constants[11]);
751 pipelines_->plus_blend.CreateDefault(*context_, options_trianglestrip,
752 porter_duff_constants[12]);
753 pipelines_->modulate_blend.CreateDefault(*context_, options_trianglestrip,
754 porter_duff_constants[13]);
755 pipelines_->screen_blend.CreateDefault(*context_, options_trianglestrip,
756 porter_duff_constants[14]);
757 }
758
759 if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
760 pipelines_->framebuffer_blend_color.CreateDefault(
761 *context_, options_trianglestrip,
762 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
763 pipelines_->framebuffer_blend_colorburn.CreateDefault(
764 *context_, options_trianglestrip,
765 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
766 pipelines_->framebuffer_blend_colordodge.CreateDefault(
767 *context_, options_trianglestrip,
768 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
769 pipelines_->framebuffer_blend_darken.CreateDefault(
770 *context_, options_trianglestrip,
771 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
772 pipelines_->framebuffer_blend_difference.CreateDefault(
773 *context_, options_trianglestrip,
774 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
775 pipelines_->framebuffer_blend_exclusion.CreateDefault(
776 *context_, options_trianglestrip,
777 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
778 pipelines_->framebuffer_blend_hardlight.CreateDefault(
779 *context_, options_trianglestrip,
780 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
781 pipelines_->framebuffer_blend_hue.CreateDefault(
782 *context_, options_trianglestrip,
783 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
784 pipelines_->framebuffer_blend_lighten.CreateDefault(
785 *context_, options_trianglestrip,
786 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
787 pipelines_->framebuffer_blend_luminosity.CreateDefault(
788 *context_, options_trianglestrip,
789 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
790 pipelines_->framebuffer_blend_multiply.CreateDefault(
791 *context_, options_trianglestrip,
792 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
793 pipelines_->framebuffer_blend_overlay.CreateDefault(
794 *context_, options_trianglestrip,
795 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
796 pipelines_->framebuffer_blend_saturation.CreateDefault(
797 *context_, options_trianglestrip,
798 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
799 pipelines_->framebuffer_blend_screen.CreateDefault(
800 *context_, options_trianglestrip,
801 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
802 pipelines_->framebuffer_blend_softlight.CreateDefault(
803 *context_, options_trianglestrip,
804 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
805 } else {
806 pipelines_->blend_color.CreateDefault(
807 *context_, options_trianglestrip,
808 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
809 pipelines_->blend_colorburn.CreateDefault(
810 *context_, options_trianglestrip,
811 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
812 pipelines_->blend_colordodge.CreateDefault(
813 *context_, options_trianglestrip,
814 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
815 pipelines_->blend_darken.CreateDefault(
816 *context_, options_trianglestrip,
817 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
818 pipelines_->blend_difference.CreateDefault(
819 *context_, options_trianglestrip,
820 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
821 pipelines_->blend_exclusion.CreateDefault(
822 *context_, options_trianglestrip,
823 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
824 pipelines_->blend_hardlight.CreateDefault(
825 *context_, options_trianglestrip,
826 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
827 pipelines_->blend_hue.CreateDefault(
828 *context_, options_trianglestrip,
829 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
830 pipelines_->blend_lighten.CreateDefault(
831 *context_, options_trianglestrip,
832 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
833 pipelines_->blend_luminosity.CreateDefault(
834 *context_, options_trianglestrip,
835 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
836 pipelines_->blend_multiply.CreateDefault(
837 *context_, options_trianglestrip,
838 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
839 pipelines_->blend_overlay.CreateDefault(
840 *context_, options_trianglestrip,
841 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
842 pipelines_->blend_saturation.CreateDefault(
843 *context_, options_trianglestrip,
844 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
845 pipelines_->blend_screen.CreateDefault(
846 *context_, options_trianglestrip,
847 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
848 pipelines_->blend_softlight.CreateDefault(
849 *context_, options_trianglestrip,
850 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
851 }
852
853 pipelines_->morphology_filter.CreateDefault(*context_, options_trianglestrip,
854 {supports_decal});
855 pipelines_->linear_to_srgb_filter.CreateDefault(*context_,
856 options_trianglestrip);
857 pipelines_->srgb_to_linear_filter.CreateDefault(*context_,
858 options_trianglestrip);
859 pipelines_->yuv_to_rgb_filter.CreateDefault(*context_, options_trianglestrip);
860
861 if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
862#if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX) && \
863 !defined(FML_OS_EMSCRIPTEN)
864 // GLES only shader that is unsupported on macOS and web.
865 pipelines_->tiled_texture_external.CreateDefault(*context_, options);
866 pipelines_->tiled_texture_uv_external.CreateDefault(*context_, options);
867#endif // !defined(FML_OS_MACOSX)
868
869#if defined(IMPELLER_ENABLE_OPENGLES)
870 pipelines_->texture_downsample_gles.CreateDefault(*context_,
871 options_trianglestrip);
872#endif // IMPELLER_ENABLE_OPENGLES
873 }
874
875 is_valid_ = true;
876 InitializeCommonlyUsedShadersIfNeeded();
877}
878
880
882 return is_valid_;
883}
884
885std::shared_ptr<Texture> ContentContext::GetEmptyTexture() const {
886 return empty_texture_;
887}
888
890 std::string_view label,
891 ISize texture_size,
892 const std::shared_ptr<CommandBuffer>& command_buffer,
893 const SubpassCallback& subpass_callback,
894 bool msaa_enabled,
895 bool depth_stencil_enabled,
896 int32_t mip_count) const {
897 const std::shared_ptr<Context>& context = GetContext();
898 RenderTarget subpass_target;
899
900 std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
902 : std::optional<RenderTarget::AttachmentConfig>();
903
904 if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
905 subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
906 /*context=*/*context,
907 /*size=*/texture_size,
908 /*mip_count=*/mip_count,
909 /*label=*/label,
910 /*color_attachment_config=*/
912 /*stencil_attachment_config=*/depth_stencil_config,
913 /*existing_color_msaa_texture=*/nullptr,
914 /*existing_color_resolve_texture=*/nullptr,
915 /*existing_depth_stencil_texture=*/nullptr,
916 /*target_pixel_format=*/std::nullopt);
917 } else {
918 subpass_target = GetRenderTargetCache()->CreateOffscreen(
919 *context, texture_size,
920 /*mip_count=*/mip_count, label,
921 RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
922 }
923 return MakeSubpass(label, subpass_target, command_buffer, subpass_callback);
924}
925
927 std::string_view label,
928 const RenderTarget& subpass_target,
929 const std::shared_ptr<CommandBuffer>& command_buffer,
930 const SubpassCallback& subpass_callback) const {
931 const std::shared_ptr<Context>& context = GetContext();
932
933 auto subpass_texture = subpass_target.GetRenderTargetTexture();
934 if (!subpass_texture) {
936 }
937
938 auto sub_renderpass = command_buffer->CreateRenderPass(subpass_target);
939 if (!sub_renderpass) {
941 }
942 sub_renderpass->SetLabel(label);
943
944 if (!subpass_callback(*this, *sub_renderpass)) {
946 }
947
948 if (!sub_renderpass->EncodeCommands()) {
950 }
951
952 const std::shared_ptr<Texture>& target_texture =
953 subpass_target.GetRenderTargetTexture();
954 if (target_texture->GetMipCount() > 1) {
955 fml::Status mipmap_status =
956 AddMipmapGeneration(command_buffer, context, target_texture);
957 if (!mipmap_status.ok()) {
958 return mipmap_status;
959 }
960 }
961
962 return subpass_target;
963}
964
966 return *tessellator_;
967}
968
969std::shared_ptr<Context> ContentContext::GetContext() const {
970 return context_;
971}
972
974 return *context_->GetCapabilities();
975}
976
978 const std::string& unique_entrypoint_name,
979 const ContentContextOptions& options,
980 const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
981 create_callback) const {
982 RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
983 auto it = runtime_effect_pipelines_.find(key);
984 if (it == runtime_effect_pipelines_.end()) {
985 it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
986 }
987 return raw_ptr(it->second);
988}
989
991 const std::string& unique_entrypoint_name) const {
992#ifdef IMPELLER_DEBUG
993 // destroying in-use pipleines is a validation error.
994 const auto& idle_waiter = GetContext()->GetIdleWaiter();
995 if (idle_waiter) {
996 idle_waiter->WaitIdle();
997 }
998#endif // IMPELLER_DEBUG
999 for (auto it = runtime_effect_pipelines_.begin();
1000 it != runtime_effect_pipelines_.end();) {
1001 if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
1002 it = runtime_effect_pipelines_.erase(it);
1003 } else {
1004 it++;
1005 }
1006 }
1007}
1008
1010 data_host_buffer_->Reset();
1011
1012 // We should only reset the indexes host buffer if it is actually different
1013 // from the data host buffer. Otherwise we'll end up resetting the same host
1014 // buffer twice.
1015 if (data_host_buffer_ != indexes_host_buffer_) {
1016 indexes_host_buffer_->Reset();
1017 }
1018}
1019
1020void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
1021 GetContext()->InitializeCommonlyUsedShadersIfNeeded();
1022}
1023
1025 ContentContextOptions opts) const {
1026 return GetPipeline(this, pipelines_->fast_gradient, opts);
1027}
1028
1030 ContentContextOptions opts) const {
1031 return GetPipeline(this, pipelines_->linear_gradient_fill, opts);
1032}
1033
1035 ContentContextOptions opts) const {
1036 return GetPipeline(this, pipelines_->linear_gradient_uniform_fill, opts);
1037}
1038
1040 ContentContextOptions opts) const {
1041 return GetPipeline(this, pipelines_->radial_gradient_uniform_fill, opts);
1042}
1043
1045 ContentContextOptions opts) const {
1046 return GetPipeline(this, pipelines_->sweep_gradient_uniform_fill, opts);
1047}
1048
1050 ContentContextOptions opts) const {
1051 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1052 return GetPipeline(this, pipelines_->linear_gradient_ssbo_fill, opts);
1053}
1054
1056 ContentContextOptions opts) const {
1057 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1058 return GetPipeline(this, pipelines_->radial_gradient_ssbo_fill, opts);
1059}
1060
1063 ConicalKind kind) const {
1064 switch (kind) {
1066 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill, opts);
1068 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_radial,
1069 opts);
1071 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_strip,
1072 opts);
1074 return GetPipeline(
1075 this, pipelines_->conical_gradient_uniform_fill_strip_and_radial,
1076 opts);
1077 }
1078}
1079
1082 ConicalKind kind) const {
1083 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1084 switch (kind) {
1086 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill, opts);
1088 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_radial,
1089 opts);
1091 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_strip,
1092 opts);
1094 return GetPipeline(
1095 this, pipelines_->conical_gradient_ssbo_fill_strip_and_radial, opts);
1096 }
1097}
1098
1100 ContentContextOptions opts) const {
1101 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1102 return GetPipeline(this, pipelines_->sweep_gradient_ssbo_fill, opts);
1103}
1104
1106 ContentContextOptions opts) const {
1107 return GetPipeline(this, pipelines_->radial_gradient_fill, opts);
1108}
1109
1112 ConicalKind kind) const {
1113 switch (kind) {
1115 return GetPipeline(this, pipelines_->conical_gradient_fill, opts);
1117 return GetPipeline(this, pipelines_->conical_gradient_fill_radial, opts);
1119 return GetPipeline(this, pipelines_->conical_gradient_fill_strip, opts);
1121 return GetPipeline(
1122 this, pipelines_->conical_gradient_fill_strip_and_radial, opts);
1123 }
1124}
1125
1127 ContentContextOptions opts) const {
1128 return GetPipeline(this, pipelines_->rrect_blur, opts);
1129}
1130
1132 ContentContextOptions opts) const {
1133 return GetPipeline(this, pipelines_->rsuperellipse_blur, opts);
1134}
1135
1137 ContentContextOptions opts) const {
1138 return GetPipeline(this, pipelines_->sweep_gradient_fill, opts);
1139}
1140
1142 ContentContextOptions opts) const {
1143 return GetPipeline(this, pipelines_->solid_fill, opts);
1144}
1145
1147 ContentContextOptions opts) const {
1148 return GetPipeline(this, pipelines_->texture, opts);
1149}
1150
1152 ContentContextOptions opts) const {
1153 return GetPipeline(this, pipelines_->texture_strict_src, opts);
1154}
1155
1157 ContentContextOptions opts) const {
1158 return GetPipeline(this, pipelines_->tiled_texture, opts);
1159}
1160
1162 ContentContextOptions opts) const {
1163 return GetPipeline(this, pipelines_->gaussian_blur, opts);
1164}
1165
1167 ContentContextOptions opts) const {
1168 return GetPipeline(this, pipelines_->border_mask_blur, opts);
1169}
1170
1172 ContentContextOptions opts) const {
1173 return GetPipeline(this, pipelines_->morphology_filter, opts);
1174}
1175
1177 ContentContextOptions opts) const {
1178 return GetPipeline(this, pipelines_->color_matrix_color_filter, opts);
1179}
1180
1182 ContentContextOptions opts) const {
1183 return GetPipeline(this, pipelines_->linear_to_srgb_filter, opts);
1184}
1185
1187 ContentContextOptions opts) const {
1188 return GetPipeline(this, pipelines_->srgb_to_linear_filter, opts);
1189}
1190
1192 return GetPipeline(this, pipelines_->clip, opts);
1193}
1194
1196 ContentContextOptions opts) const {
1197 return GetPipeline(this, pipelines_->glyph_atlas, opts);
1198}
1199
1201 ContentContextOptions opts) const {
1202 return GetPipeline(this, pipelines_->yuv_to_rgb_filter, opts);
1203}
1204
1206 ContentContextOptions opts) const {
1207 return GetPipeline(this, pipelines_->uber_sdf, opts);
1208}
1209
1211 BlendMode mode,
1212 ContentContextOptions opts) const {
1213 switch (mode) {
1214 case BlendMode::kClear:
1215 return GetClearBlendPipeline(opts);
1216 case BlendMode::kSrc:
1217 return GetSourceBlendPipeline(opts);
1218 case BlendMode::kDst:
1219 return GetDestinationBlendPipeline(opts);
1221 return GetSourceOverBlendPipeline(opts);
1224 case BlendMode::kSrcIn:
1225 return GetSourceInBlendPipeline(opts);
1226 case BlendMode::kDstIn:
1227 return GetDestinationInBlendPipeline(opts);
1228 case BlendMode::kSrcOut:
1229 return GetSourceOutBlendPipeline(opts);
1230 case BlendMode::kDstOut:
1231 return GetDestinationOutBlendPipeline(opts);
1233 return GetSourceATopBlendPipeline(opts);
1236 case BlendMode::kXor:
1237 return GetXorBlendPipeline(opts);
1238 case BlendMode::kPlus:
1239 return GetPlusBlendPipeline(opts);
1241 return GetModulateBlendPipeline(opts);
1242 case BlendMode::kScreen:
1243 return GetScreenBlendPipeline(opts);
1245 case BlendMode::kDarken:
1254 case BlendMode::kHue:
1256 case BlendMode::kColor:
1258 VALIDATION_LOG << "Invalid porter duff blend mode "
1259 << BlendModeToString(mode);
1260 return GetClearBlendPipeline(opts);
1261 break;
1262 }
1263}
1264
1266 ContentContextOptions opts) const {
1267 return GetPipeline(this, pipelines_->clear_blend, opts);
1268}
1269
1271 ContentContextOptions opts) const {
1272 return GetPipeline(this, pipelines_->source_blend, opts);
1273}
1274
1276 ContentContextOptions opts) const {
1277 return GetPipeline(this, pipelines_->destination_blend, opts);
1278}
1279
1281 ContentContextOptions opts) const {
1282 return GetPipeline(this, pipelines_->source_over_blend, opts);
1283}
1284
1286 ContentContextOptions opts) const {
1287 return GetPipeline(this, pipelines_->destination_over_blend, opts);
1288}
1289
1291 ContentContextOptions opts) const {
1292 return GetPipeline(this, pipelines_->source_in_blend, opts);
1293}
1294
1296 ContentContextOptions opts) const {
1297 return GetPipeline(this, pipelines_->destination_in_blend, opts);
1298}
1299
1301 ContentContextOptions opts) const {
1302 return GetPipeline(this, pipelines_->source_out_blend, opts);
1303}
1304
1306 ContentContextOptions opts) const {
1307 return GetPipeline(this, pipelines_->destination_out_blend, opts);
1308}
1309
1311 ContentContextOptions opts) const {
1312 return GetPipeline(this, pipelines_->source_a_top_blend, opts);
1313}
1314
1316 ContentContextOptions opts) const {
1317 return GetPipeline(this, pipelines_->destination_a_top_blend, opts);
1318}
1319
1321 ContentContextOptions opts) const {
1322 return GetPipeline(this, pipelines_->xor_blend, opts);
1323}
1324
1326 ContentContextOptions opts) const {
1327 return GetPipeline(this, pipelines_->plus_blend, opts);
1328}
1329
1331 ContentContextOptions opts) const {
1332 return GetPipeline(this, pipelines_->modulate_blend, opts);
1333}
1334
1336 ContentContextOptions opts) const {
1337 return GetPipeline(this, pipelines_->screen_blend, opts);
1338}
1339
1341 ContentContextOptions opts) const {
1342 return GetPipeline(this, pipelines_->blend_color, opts);
1343}
1344
1346 ContentContextOptions opts) const {
1347 return GetPipeline(this, pipelines_->blend_colorburn, opts);
1348}
1349
1351 ContentContextOptions opts) const {
1352 return GetPipeline(this, pipelines_->blend_colordodge, opts);
1353}
1354
1356 ContentContextOptions opts) const {
1357 return GetPipeline(this, pipelines_->blend_darken, opts);
1358}
1359
1361 ContentContextOptions opts) const {
1362 return GetPipeline(this, pipelines_->blend_difference, opts);
1363}
1364
1366 ContentContextOptions opts) const {
1367 return GetPipeline(this, pipelines_->blend_exclusion, opts);
1368}
1369
1371 ContentContextOptions opts) const {
1372 return GetPipeline(this, pipelines_->blend_hardlight, opts);
1373}
1374
1376 ContentContextOptions opts) const {
1377 return GetPipeline(this, pipelines_->blend_hue, opts);
1378}
1379
1381 ContentContextOptions opts) const {
1382 return GetPipeline(this, pipelines_->blend_lighten, opts);
1383}
1384
1386 ContentContextOptions opts) const {
1387 return GetPipeline(this, pipelines_->blend_luminosity, opts);
1388}
1389
1391 ContentContextOptions opts) const {
1392 return GetPipeline(this, pipelines_->blend_multiply, opts);
1393}
1394
1396 ContentContextOptions opts) const {
1397 return GetPipeline(this, pipelines_->blend_overlay, opts);
1398}
1399
1401 ContentContextOptions opts) const {
1402 return GetPipeline(this, pipelines_->blend_saturation, opts);
1403}
1404
1406 ContentContextOptions opts) const {
1407 return GetPipeline(this, pipelines_->blend_screen, opts);
1408}
1409
1411 ContentContextOptions opts) const {
1412 return GetPipeline(this, pipelines_->blend_softlight, opts);
1413}
1414
1416 ContentContextOptions opts) const {
1417 return GetPipeline(this, pipelines_->texture_downsample, opts);
1418}
1419
1421 ContentContextOptions opts) const {
1422 return GetPipeline(this, pipelines_->texture_downsample_bounded, opts);
1423}
1424
1426 ContentContextOptions opts) const {
1427 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1428 return GetPipeline(this, pipelines_->framebuffer_blend_color, opts);
1429}
1430
1432 ContentContextOptions opts) const {
1433 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1434 return GetPipeline(this, pipelines_->framebuffer_blend_colorburn, opts);
1435}
1436
1438 ContentContextOptions opts) const {
1439 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1440 return GetPipeline(this, pipelines_->framebuffer_blend_colordodge, opts);
1441}
1442
1444 ContentContextOptions opts) const {
1445 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1446 return GetPipeline(this, pipelines_->framebuffer_blend_darken, opts);
1447}
1448
1450 ContentContextOptions opts) const {
1451 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1452 return GetPipeline(this, pipelines_->framebuffer_blend_difference, opts);
1453}
1454
1456 ContentContextOptions opts) const {
1457 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1458 return GetPipeline(this, pipelines_->framebuffer_blend_exclusion, opts);
1459}
1460
1462 ContentContextOptions opts) const {
1463 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1464 return GetPipeline(this, pipelines_->framebuffer_blend_hardlight, opts);
1465}
1466
1468 ContentContextOptions opts) const {
1469 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1470 return GetPipeline(this, pipelines_->framebuffer_blend_hue, opts);
1471}
1472
1474 ContentContextOptions opts) const {
1475 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1476 return GetPipeline(this, pipelines_->framebuffer_blend_lighten, opts);
1477}
1478
1480 ContentContextOptions opts) const {
1481 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1482 return GetPipeline(this, pipelines_->framebuffer_blend_luminosity, opts);
1483}
1484
1486 ContentContextOptions opts) const {
1487 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1488 return GetPipeline(this, pipelines_->framebuffer_blend_multiply, opts);
1489}
1490
1492 ContentContextOptions opts) const {
1493 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1494 return GetPipeline(this, pipelines_->framebuffer_blend_overlay, opts);
1495}
1496
1498 ContentContextOptions opts) const {
1499 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1500 return GetPipeline(this, pipelines_->framebuffer_blend_saturation, opts);
1501}
1502
1504 ContentContextOptions opts) const {
1505 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1506 return GetPipeline(this, pipelines_->framebuffer_blend_screen, opts);
1507}
1508
1510 ContentContextOptions opts) const {
1511 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1512 return GetPipeline(this, pipelines_->framebuffer_blend_softlight, opts);
1513}
1514
1516 ContentContextOptions opts) const {
1517 return GetPipeline(this, pipelines_->shadow_vertices_, opts);
1518}
1519
1521 BlendMode blend_mode,
1522 ContentContextOptions opts) const {
1523 if (blend_mode <= BlendMode::kHardLight) {
1524 return GetPipeline(this, pipelines_->vertices_uber_1_, opts);
1525 } else {
1526 return GetPipeline(this, pipelines_->vertices_uber_2_, opts);
1527 }
1528}
1529
1531 ContentContextOptions opts) const {
1532 return GetPipeline(this, pipelines_->circle, opts);
1533}
1534
1536 return GetPipeline(this, pipelines_->line, opts);
1537}
1538
1539#ifdef IMPELLER_ENABLE_OPENGLES
1540
1541#if !defined(FML_OS_EMSCRIPTEN)
1542PipelineRef ContentContext::GetTiledTextureUvExternalPipeline(
1543 ContentContextOptions opts) const {
1545 return GetPipeline(this, pipelines_->tiled_texture_uv_external, opts);
1546}
1547
1548PipelineRef ContentContext::GetTiledTextureExternalPipeline(
1549 ContentContextOptions opts) const {
1551 return GetPipeline(this, pipelines_->tiled_texture_external, opts);
1552}
1553#endif
1554
1555PipelineRef ContentContext::GetDownsampleTextureGlesPipeline(
1556 ContentContextOptions opts) const {
1557 return GetPipeline(this, pipelines_->texture_downsample_gles, opts);
1558}
1559
1560#endif // IMPELLER_ENABLE_OPENGLES
1561
1563 is_texture_caching_enabled_ = enabled;
1564 if (!enabled) {
1565 texture_cache_.clear();
1566 }
1567}
1568
1569std::shared_ptr<Texture> ContentContext::GetCachedTexture(
1570 const flutter::DlImage* image) const {
1571 if (!image) {
1572 return nullptr;
1573 }
1574 if (is_texture_caching_enabled_) {
1575 auto it = texture_cache_.find(image);
1576 if (it != texture_cache_.end()) {
1577 return it->second;
1578 }
1579 }
1580 return nullptr;
1581}
1582
1584 const flutter::DlImage* image,
1585 const std::shared_ptr<Texture>& texture) const {
1586 if (!image || !texture) {
1587 return;
1588 }
1589 if (is_texture_caching_enabled_) {
1590 texture_cache_[image] = texture;
1591 }
1592}
1593
1595 texture_cache_.erase(image);
1596}
1597
1599 texture_cache_.clear();
1600}
1601
1602} // namespace impeller
Represents an image whose allocation is (usually) resident on device memory.
Definition dl_image.h:34
bool ok() const
Definition status.h:71
PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const
PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
std::shared_ptr< Texture > GetCachedTexture(const flutter::DlImage *image) const
Get a cached texture for the given image.
std::shared_ptr< Texture > GetEmptyTexture() const
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const
PipelineRef GetLinePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
PipelineRef GetDownsampleBoundedPipeline(ContentContextOptions opts) const
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
PipelineRef GetUberSDFPipeline(ContentContextOptions opts) const
PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
ContentContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
void ResetTransientsBuffers()
Resets the transients buffers held onto by the content context.
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) 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...
const Capabilities & GetDeviceCapabilities() const
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const
PipelineRef GetDrawShadowVerticesPipeline(ContentContextOptions opts) const
PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
PipelineRef GetCirclePipeline(ContentContextOptions opts) const
PipelineRef GetCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor > >()> &create_callback) const
PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const
PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const
PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const
PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
PipelineRef GetClipPipeline(ContentContextOptions opts) const
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
void SetTextureCachingEnabled(bool enabled)
Enable or disable texture caching.
PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Tessellator & GetTessellator() const
void SetCachedTexture(const flutter::DlImage *image, const std::shared_ptr< Texture > &texture) const
Set a cached texture for the given image.
PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const
PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
void RemoveCachedTexture(const flutter::DlImage *image) const
Remove a cached texture for the given image.
PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const
std::shared_ptr< Context > GetContext() const
void ClearCachedTextures() const
Clear all cached textures.
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
To do anything rendering related with Impeller, you need a context.
Definition context.h:69
virtual const std::shared_ptr< const Capabilities > & GetCapabilities() const =0
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
static constexpr BlendMode kLastPipelineBlendMode
Definition entity.h:28
BufferView Emplace(const BufferType &buffer, size_t alignment=0)
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
Definition host_buffer.h:92
static std::shared_ptr< HostBuffer > Create(const std::shared_ptr< Allocator > &allocator, const std::shared_ptr< const IdleWaiter > &idle_waiter, size_t minimum_uniform_alignment)
PipelineDescriptor & SetDepthStencilAttachmentDescriptor(std::optional< DepthAttachmentDescriptor > desc)
void SetPolygonMode(PolygonMode mode)
std::optional< DepthAttachmentDescriptor > GetDepthStencilAttachmentDescriptor() const
PipelineDescriptor & SetStencilAttachmentDescriptors(std::optional< StencilAttachmentDescriptor > front_and_back)
const ColorAttachmentDescriptor * GetColorAttachmentDescriptor(size_t index) const
PipelineDescriptor & SetColorAttachmentDescriptor(size_t index, ColorAttachmentDescriptor desc)
PipelineDescriptor & SetSampleCount(SampleCount samples)
void SetPrimitiveType(PrimitiveType type)
std::optional< StencilAttachmentDescriptor > GetFrontStencilAttachmentDescriptor() const
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition pipeline.h:53
An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame...
std::shared_ptr< Texture > GetRenderTargetTexture() const
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
Definition tessellator.h:37
A cache for blurred text that re-uses these across frames.
std::optional< PipelineDescriptor > desc_
std::vector< std::pair< uint64_t, std::unique_ptr< GenericRenderPipelineHandle > > > pipelines_
std::optional< ContentContextOptions > default_options_
int32_t x
FlutterVulkanImage * image
#define FML_CHECK(condition)
Definition logging.h:104
#define FML_UNREACHABLE()
Definition logging.h:128
#define FML_DCHECK(condition)
Definition logging.h:122
FlTexture * texture
std::array< std::vector< Scalar >, 15 > GetPorterDuffSpecConstants(bool supports_decal)
float Scalar
Definition scalar.h:19
raw_ptr< Pipeline< PipelineDescriptor > > PipelineRef
A raw ptr to a pipeline object.
Definition pipeline.h:89
const char * BlendModeToString(BlendMode blend_mode)
Definition color.cc:45
@ kEqual
Comparison test passes if new_value == current_value.
@ kAlways
Comparison test passes always passes.
@ kNotEqual
Comparison test passes if new_value != current_value.
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.
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
@ kSetToReferenceValue
Reset the stencil value to the reference value.
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
@ kKeep
Don't modify the current stencil value.
BlendMode
Definition color.h:58
static std::unique_ptr< PipelineT > CreateDefaultPipeline(const Context &context)
Definition ref_ptr.h:261
Describe the color attachment that will be used with this pipeline.
Definition formats.h:522
static constexpr Color BlackTransparent()
Definition color.h:275
std::array< uint8_t, 4 > ToR8G8B8A8() const
Convert to R8G8B8A8 representation.
Definition color.h:246
Variants< SolidFillPipeline > solid_fill
Variants< PorterDuffBlendPipeline > destination_blend
Variants< SweepGradientSSBOFillPipeline > sweep_gradient_ssbo_fill
Variants< BlendScreenPipeline > blend_screen
Variants< PorterDuffBlendPipeline > modulate_blend
Variants< FramebufferBlendOverlayPipeline > framebuffer_blend_overlay
Variants< BlendSaturationPipeline > blend_saturation
Variants< TiledTexturePipeline > tiled_texture
Variants< PorterDuffBlendPipeline > destination_in_blend
Variants< BlendSoftLightPipeline > blend_softlight
Variants< BlendColorDodgePipeline > blend_colordodge
Variants< BlendMultiplyPipeline > blend_multiply
Variants< BlendColorPipeline > blend_color
Variants< BlendDifferencePipeline > blend_difference
Variants< BlendOverlayPipeline > blend_overlay
Variants< ConicalGradientFillStripPipeline > conical_gradient_fill_strip
Variants< FramebufferBlendExclusionPipeline > framebuffer_blend_exclusion
Variants< MorphologyFilterPipeline > morphology_filter
Variants< PorterDuffBlendPipeline > screen_blend
Variants< FramebufferBlendSaturationPipeline > framebuffer_blend_saturation
Variants< PorterDuffBlendPipeline > source_over_blend
Variants< LinearGradientFillPipeline > linear_gradient_fill
Variants< PorterDuffBlendPipeline > plus_blend
Variants< VerticesUber2Shader > vertices_uber_2_
Variants< FramebufferBlendHardLightPipeline > framebuffer_blend_hardlight
Variants< RadialGradientSSBOFillPipeline > radial_gradient_ssbo_fill
Variants< PorterDuffBlendPipeline > clear_blend
Variants< ConicalGradientUniformFillConicalPipeline > conical_gradient_uniform_fill
Variants< FramebufferBlendMultiplyPipeline > framebuffer_blend_multiply
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill
Variants< TextureDownsamplePipeline > texture_downsample
Variants< TextureDownsampleBoundedPipeline > texture_downsample_bounded
Variants< FramebufferBlendLuminosityPipeline > framebuffer_blend_luminosity
Variants< FramebufferBlendSoftLightPipeline > framebuffer_blend_softlight
Variants< SweepGradientUniformFillPipeline > sweep_gradient_uniform_fill
Variants< BlendColorBurnPipeline > blend_colorburn
Variants< ConicalGradientUniformFillStripRadialPipeline > conical_gradient_uniform_fill_strip_and_radial
Variants< PorterDuffBlendPipeline > source_in_blend
Variants< ConicalGradientFillConicalPipeline > conical_gradient_fill
Variants< ShadowVerticesShader > shadow_vertices_
Variants< CirclePipeline > circle
Variants< SweepGradientFillPipeline > sweep_gradient_fill
Variants< FramebufferBlendLightenPipeline > framebuffer_blend_lighten
Variants< PorterDuffBlendPipeline > source_a_top_blend
Variants< PorterDuffBlendPipeline > destination_a_top_blend
Variants< RadialGradientUniformFillPipeline > radial_gradient_uniform_fill
Variants< BlendLightenPipeline > blend_lighten
Variants< LinearGradientUniformFillPipeline > linear_gradient_uniform_fill
Variants< FramebufferBlendColorBurnPipeline > framebuffer_blend_colorburn
Variants< ConicalGradientFillRadialPipeline > conical_gradient_fill_radial
Variants< PorterDuffBlendPipeline > destination_over_blend
Variants< BlendExclusionPipeline > blend_exclusion
Variants< RSuperellipseBlurPipeline > rsuperellipse_blur
Variants< SrgbToLinearFilterPipeline > srgb_to_linear_filter
Variants< UberSDFPipeline > uber_sdf
Variants< ColorMatrixColorFilterPipeline > color_matrix_color_filter
Variants< LinearToSrgbFilterPipeline > linear_to_srgb_filter
Variants< ConicalGradientUniformFillRadialPipeline > conical_gradient_uniform_fill_radial
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_strip
Variants< RRectBlurPipeline > rrect_blur
Variants< BlendDarkenPipeline > blend_darken
Variants< TexturePipeline > texture
Variants< PorterDuffBlendPipeline > source_out_blend
Variants< FramebufferBlendHuePipeline > framebuffer_blend_hue
Variants< TextureStrictSrcPipeline > texture_strict_src
Variants< FramebufferBlendColorPipeline > framebuffer_blend_color
Variants< BlendHuePipeline > blend_hue
Variants< FramebufferBlendDarkenPipeline > framebuffer_blend_darken
Variants< FastGradientPipeline > fast_gradient
Variants< ConicalGradientUniformFillStripPipeline > conical_gradient_uniform_fill_strip
Variants< PorterDuffBlendPipeline > xor_blend
Variants< GaussianBlurPipeline > gaussian_blur
Variants< LinearGradientSSBOFillPipeline > linear_gradient_ssbo_fill
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_strip_and_radial
Variants< GlyphAtlasPipeline > glyph_atlas
Variants< PorterDuffBlendPipeline > source_blend
Variants< BlendLuminosityPipeline > blend_luminosity
Variants< BorderMaskBlurPipeline > border_mask_blur
Variants< FramebufferBlendScreenPipeline > framebuffer_blend_screen
Variants< FramebufferBlendDifferencePipeline > framebuffer_blend_difference
Variants< YUVToRGBFilterPipeline > yuv_to_rgb_filter
Variants< RadialGradientFillPipeline > radial_gradient_fill
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_radial
Variants< ConicalGradientFillStripRadialPipeline > conical_gradient_fill_strip_and_radial
Variants< BlendHardLightPipeline > blend_hardlight
Variants< FramebufferBlendColorDodgePipeline > framebuffer_blend_colordodge
Variants< PorterDuffBlendPipeline > destination_out_blend
Variants< VerticesUber1Shader > vertices_uber_1_
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
@ kIgnore
Turn the stencil test off. Used when drawing without stencil-then-cover.
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
#define VALIDATION_LOG
Definition validation.h:91