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<ComplexRSEPipeline> complex_rse;
309 Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter;
310
311// Web doesn't support external texture OpenGL extensions
312#if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_EMSCRIPTEN)
313 Variants<TiledTextureExternalPipeline> tiled_texture_external;
314 Variants<TiledTextureUvExternalPipeline> tiled_texture_uv_external;
315#endif
316
317#if defined(IMPELLER_ENABLE_OPENGLES)
318 Variants<TextureDownsampleGlesPipeline> texture_downsample_gles;
319#endif // IMPELLER_ENABLE_OPENGLES
320 // clang-format on
321};
322
324 PipelineDescriptor& desc) const {
325 auto pipeline_blend = blend_mode;
327 VALIDATION_LOG << "Cannot use blend mode " << static_cast<int>(blend_mode)
328 << " as a pipeline blend.";
329 pipeline_blend = BlendMode::kSrcOver;
330 }
331
333
339
340 switch (pipeline_blend) {
349 } else {
354 }
355 break;
356 case BlendMode::kSrc:
357 color0.blending_enabled = false;
362 break;
363 case BlendMode::kDst:
369 break;
375 break;
381 break;
387 break;
393 break;
399 break;
405 break;
411 break;
417 break;
418 case BlendMode::kXor:
423 break;
424 case BlendMode::kPlus:
429 break;
435 break;
436 default:
438 }
439 desc.SetColorAttachmentDescriptor(0u, color0);
440
444 }
445
446 auto maybe_stencil = desc.GetFrontStencilAttachmentDescriptor();
447 auto maybe_depth = desc.GetDepthStencilAttachmentDescriptor();
448 FML_DCHECK(has_depth_stencil_attachments == maybe_depth.has_value())
449 << "Depth attachment doesn't match expected pipeline state. "
450 "has_depth_stencil_attachments="
452 FML_DCHECK(has_depth_stencil_attachments == maybe_stencil.has_value())
453 << "Stencil attachment doesn't match expected pipeline state. "
454 "has_depth_stencil_attachments="
456 if (maybe_stencil.has_value()) {
457 StencilAttachmentDescriptor front_stencil = maybe_stencil.value();
458 StencilAttachmentDescriptor back_stencil = front_stencil;
459
460 switch (stencil_mode) {
464 desc.SetStencilAttachmentDescriptors(front_stencil);
465 break;
467 // The stencil ref should be 0 on commands that use this mode.
472 desc.SetStencilAttachmentDescriptors(front_stencil, back_stencil);
473 break;
475 // The stencil ref should be 0 on commands that use this mode.
479 desc.SetStencilAttachmentDescriptors(front_stencil);
480 break;
482 // The stencil ref should be 0 on commands that use this mode.
485 desc.SetStencilAttachmentDescriptors(front_stencil);
486 break;
488 // The stencil ref should be 0 on commands that use this mode.
490 front_stencil.depth_stencil_pass =
492 desc.SetStencilAttachmentDescriptors(front_stencil);
493 break;
495 // The stencil ref should be 0 on commands that use this mode.
498 desc.SetStencilAttachmentDescriptors(front_stencil);
499 break;
500 }
501 }
502 if (maybe_depth.has_value()) {
503 DepthAttachmentDescriptor depth = maybe_depth.value();
507 }
508
511}
512
513std::array<std::vector<Scalar>, 15> GetPorterDuffSpecConstants(
514 bool supports_decal) {
515 Scalar x = supports_decal ? 1 : 0;
516 return {{
517 {x, 0, 0, 0, 0, 0}, // Clear
518 {x, 1, 0, 0, 0, 0}, // Source
519 {x, 0, 0, 1, 0, 0}, // Destination
520 {x, 1, 0, 1, -1, 0}, // SourceOver
521 {x, 1, -1, 1, 0, 0}, // DestinationOver
522 {x, 0, 1, 0, 0, 0}, // SourceIn
523 {x, 0, 0, 0, 1, 0}, // DestinationIn
524 {x, 1, -1, 0, 0, 0}, // SourceOut
525 {x, 0, 0, 1, -1, 0}, // DestinationOut
526 {x, 0, 1, 1, -1, 0}, // SourceATop
527 {x, 1, -1, 0, 1, 0}, // DestinationATop
528 {x, 1, -1, 1, -1, 0}, // Xor
529 {x, 1, 0, 1, 0, 0}, // Plus
530 {x, 0, 0, 0, 0, 1}, // Modulate
531 {x, 0, 0, 1, 0, -1}, // Screen
532 }};
533}
534
535template <typename PipelineT>
536static std::unique_ptr<PipelineT> CreateDefaultPipeline(
537 const Context& context) {
538 auto desc = PipelineT::Builder::MakeDefaultPipelineDescriptor(context);
539 if (!desc.has_value()) {
540 return nullptr;
541 }
542 // Apply default ContentContextOptions to the descriptor.
543 const auto default_color_format =
544 context.GetCapabilities()->GetDefaultColorFormat();
546 .primitive_type = PrimitiveType::kTriangleStrip,
547 .color_attachment_pixel_format = default_color_format}
548 .ApplyToPipelineDescriptor(*desc);
549 return std::make_unique<PipelineT>(context, desc);
550}
551
553 std::shared_ptr<Context> context,
554 std::shared_ptr<TypographerContext> typographer_context,
555 std::shared_ptr<RenderTargetAllocator> render_target_allocator)
556 : context_(std::move(context)),
557 lazy_glyph_atlas_(
558 std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
559 pipelines_(new Pipelines()),
560 tessellator_(std::make_shared<Tessellator>(
561 context_->GetCapabilities()->Supports32BitPrimitiveIndices())),
562 render_target_cache_(render_target_allocator == nullptr
563 ? std::make_shared<RenderTargetCache>(
564 context_->GetResourceAllocator())
565 : std::move(render_target_allocator)),
566 data_host_buffer_(HostBuffer::Create(
567 context_->GetResourceAllocator(),
568 context_->GetIdleWaiter(),
569 context_->GetCapabilities()->GetMinimumUniformAlignment())),
570 text_shadow_cache_(std::make_unique<TextShadowCache>()) {
571 if (!context_ || !context_->IsValid()) {
572 return;
573 }
574
575 // On most backends, indexes and other data can be allocated into the same
576 // buffers. However, some backends (namely WebGL) require indexes used in
577 // indexed draws to be allocated separately from other data. For those
578 // backends, we allocate a separate host buffer just for indexes.
579 indexes_host_buffer_ =
580 context_->GetCapabilities()->NeedsPartitionedHostBuffer()
582 context_->GetResourceAllocator(), context_->GetIdleWaiter(),
583 context_->GetCapabilities()->GetMinimumUniformAlignment())
584 : data_host_buffer_;
585 {
589 desc.size = ISize{1, 1};
590 empty_texture_ = GetContext()->GetResourceAllocator()->CreateTexture(desc);
591
592 std::array<uint8_t, 4> data = Color::BlackTransparent().ToR8G8B8A8();
593 std::shared_ptr<CommandBuffer> cmd_buffer =
594 GetContext()->CreateCommandBuffer();
595 std::shared_ptr<BlitPass> blit_pass = cmd_buffer->CreateBlitPass();
596 HostBuffer& data_host_buffer = GetTransientsDataBuffer();
597 BufferView buffer_view = data_host_buffer.Emplace(data);
598 blit_pass->AddCopy(buffer_view, empty_texture_);
599
600 if (!blit_pass->EncodeCommands() || !GetContext()
601 ->GetCommandQueue()
602 ->Submit({std::move(cmd_buffer)})
603 .ok()) {
604 VALIDATION_LOG << "Failed to create empty texture.";
605 }
606 }
607
608 auto options = ContentContextOptions{
610 .color_attachment_pixel_format =
611 context_->GetCapabilities()->GetDefaultColorFormat()};
612 auto options_trianglestrip = ContentContextOptions{
614 .primitive_type = PrimitiveType::kTriangleStrip,
615 .color_attachment_pixel_format =
616 context_->GetCapabilities()->GetDefaultColorFormat()};
617 auto options_no_msaa_no_depth_stencil = ContentContextOptions{
619 .primitive_type = PrimitiveType::kTriangleStrip,
620 .color_attachment_pixel_format =
621 context_->GetCapabilities()->GetDefaultColorFormat(),
622 .has_depth_stencil_attachments = false};
623 const auto supports_decal = static_cast<Scalar>(
624 context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
625
626 // Futures for the following pipelines may block in case the first frame is
627 // rendered without the pipelines being ready. Put pipelines that are more
628 // likely to be used first.
629 {
630 pipelines_->glyph_atlas.CreateDefault(
631 *context_, options,
632 {static_cast<Scalar>(
633 GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
635 pipelines_->solid_fill.CreateDefault(*context_, options);
636 pipelines_->texture.CreateDefault(*context_, options);
637 pipelines_->fast_gradient.CreateDefault(*context_, options);
638 pipelines_->line.CreateDefault(*context_, options);
639 pipelines_->circle.CreateDefault(*context_, options);
640 if (context_->GetFlags().use_sdfs) {
641 pipelines_->uber_sdf.CreateDefault(*context_, options);
642 pipelines_->complex_rse.CreateDefault(*context_, options);
643 }
644
645 if (context_->GetCapabilities()->SupportsSSBO()) {
646 pipelines_->linear_gradient_ssbo_fill.CreateDefault(*context_, options);
647 pipelines_->radial_gradient_ssbo_fill.CreateDefault(*context_, options);
648 pipelines_->conical_gradient_ssbo_fill.CreateDefault(*context_, options,
649 {3.0});
650 pipelines_->conical_gradient_ssbo_fill_radial.CreateDefault(
651 *context_, options, {1.0});
652 pipelines_->conical_gradient_ssbo_fill_strip.CreateDefault(
653 *context_, options, {2.0});
654 pipelines_->conical_gradient_ssbo_fill_strip_and_radial.CreateDefault(
655 *context_, options, {0.0});
656 pipelines_->sweep_gradient_ssbo_fill.CreateDefault(*context_, options);
657 } else {
658 pipelines_->linear_gradient_uniform_fill.CreateDefault(*context_,
659 options);
660 pipelines_->radial_gradient_uniform_fill.CreateDefault(*context_,
661 options);
662 pipelines_->conical_gradient_uniform_fill.CreateDefault(*context_,
663 options);
664 pipelines_->conical_gradient_uniform_fill_radial.CreateDefault(*context_,
665 options);
666 pipelines_->conical_gradient_uniform_fill_strip.CreateDefault(*context_,
667 options);
668 pipelines_->conical_gradient_uniform_fill_strip_and_radial.CreateDefault(
669 *context_, options);
670 pipelines_->sweep_gradient_uniform_fill.CreateDefault(*context_, options);
671
672 pipelines_->linear_gradient_fill.CreateDefault(*context_, options);
673 pipelines_->radial_gradient_fill.CreateDefault(*context_, options);
674 pipelines_->conical_gradient_fill.CreateDefault(*context_, options);
675 pipelines_->conical_gradient_fill_radial.CreateDefault(*context_,
676 options);
677 pipelines_->conical_gradient_fill_strip.CreateDefault(*context_, options);
678 pipelines_->conical_gradient_fill_strip_and_radial.CreateDefault(
679 *context_, options);
680 pipelines_->sweep_gradient_fill.CreateDefault(*context_, options);
681 }
682
683 /// Setup default clip pipeline.
684 auto clip_pipeline_descriptor =
685 ClipPipeline::Builder::MakeDefaultPipelineDescriptor(*context_);
686 if (!clip_pipeline_descriptor.has_value()) {
687 return;
688 }
691 .color_attachment_pixel_format =
692 context_->GetCapabilities()->GetDefaultColorFormat()}
693 .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
694 // Disable write to all color attachments.
695 auto clip_color_attachments =
696 clip_pipeline_descriptor->GetColorAttachmentDescriptors();
697 for (auto& color_attachment : clip_color_attachments) {
698 color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
699 }
700 clip_pipeline_descriptor->SetColorAttachmentDescriptors(
701 std::move(clip_color_attachments));
702 pipelines_->clip.SetDefault(
703 options,
704 std::make_unique<ClipPipeline>(*context_, clip_pipeline_descriptor));
705 pipelines_->texture_downsample.CreateDefault(
706 *context_, options_no_msaa_no_depth_stencil);
707 pipelines_->texture_downsample_bounded.CreateDefault(
708 *context_, options_no_msaa_no_depth_stencil);
709 pipelines_->rrect_blur.CreateDefault(*context_, options_trianglestrip);
710 pipelines_->rsuperellipse_blur.CreateDefault(*context_,
711 options_trianglestrip);
712 pipelines_->texture_strict_src.CreateDefault(*context_, options);
713 pipelines_->tiled_texture.CreateDefault(*context_, options,
714 {supports_decal});
715 pipelines_->gaussian_blur.CreateDefault(
716 *context_, options_no_msaa_no_depth_stencil, {supports_decal});
717 pipelines_->border_mask_blur.CreateDefault(*context_,
718 options_trianglestrip);
719 pipelines_->color_matrix_color_filter.CreateDefault(*context_,
720 options_trianglestrip);
721 pipelines_->shadow_vertices_.CreateDefault(*context_, options);
722 pipelines_->vertices_uber_1_.CreateDefault(*context_, options,
723 {supports_decal});
724 pipelines_->vertices_uber_2_.CreateDefault(*context_, options,
725 {supports_decal});
726
727 const std::array<std::vector<Scalar>, 15> porter_duff_constants =
728 GetPorterDuffSpecConstants(supports_decal);
729 pipelines_->clear_blend.CreateDefault(*context_, options_trianglestrip,
730 porter_duff_constants[0]);
731 pipelines_->source_blend.CreateDefault(*context_, options_trianglestrip,
732 porter_duff_constants[1]);
733 pipelines_->destination_blend.CreateDefault(
734 *context_, options_trianglestrip, porter_duff_constants[2]);
735 pipelines_->source_over_blend.CreateDefault(
736 *context_, options_trianglestrip, porter_duff_constants[3]);
737 pipelines_->destination_over_blend.CreateDefault(
738 *context_, options_trianglestrip, porter_duff_constants[4]);
739 pipelines_->source_in_blend.CreateDefault(*context_, options_trianglestrip,
740 porter_duff_constants[5]);
741 pipelines_->destination_in_blend.CreateDefault(
742 *context_, options_trianglestrip, porter_duff_constants[6]);
743 pipelines_->source_out_blend.CreateDefault(*context_, options_trianglestrip,
744 porter_duff_constants[7]);
745 pipelines_->destination_out_blend.CreateDefault(
746 *context_, options_trianglestrip, porter_duff_constants[8]);
747 pipelines_->source_a_top_blend.CreateDefault(
748 *context_, options_trianglestrip, porter_duff_constants[9]);
749 pipelines_->destination_a_top_blend.CreateDefault(
750 *context_, options_trianglestrip, porter_duff_constants[10]);
751 pipelines_->xor_blend.CreateDefault(*context_, options_trianglestrip,
752 porter_duff_constants[11]);
753 pipelines_->plus_blend.CreateDefault(*context_, options_trianglestrip,
754 porter_duff_constants[12]);
755 pipelines_->modulate_blend.CreateDefault(*context_, options_trianglestrip,
756 porter_duff_constants[13]);
757 pipelines_->screen_blend.CreateDefault(*context_, options_trianglestrip,
758 porter_duff_constants[14]);
759 }
760
761 if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
762 pipelines_->framebuffer_blend_color.CreateDefault(
763 *context_, options_trianglestrip,
764 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
765 pipelines_->framebuffer_blend_colorburn.CreateDefault(
766 *context_, options_trianglestrip,
767 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
768 pipelines_->framebuffer_blend_colordodge.CreateDefault(
769 *context_, options_trianglestrip,
770 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
771 pipelines_->framebuffer_blend_darken.CreateDefault(
772 *context_, options_trianglestrip,
773 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
774 pipelines_->framebuffer_blend_difference.CreateDefault(
775 *context_, options_trianglestrip,
776 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
777 pipelines_->framebuffer_blend_exclusion.CreateDefault(
778 *context_, options_trianglestrip,
779 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
780 pipelines_->framebuffer_blend_hardlight.CreateDefault(
781 *context_, options_trianglestrip,
782 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
783 pipelines_->framebuffer_blend_hue.CreateDefault(
784 *context_, options_trianglestrip,
785 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
786 pipelines_->framebuffer_blend_lighten.CreateDefault(
787 *context_, options_trianglestrip,
788 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
789 pipelines_->framebuffer_blend_luminosity.CreateDefault(
790 *context_, options_trianglestrip,
791 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
792 pipelines_->framebuffer_blend_multiply.CreateDefault(
793 *context_, options_trianglestrip,
794 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
795 pipelines_->framebuffer_blend_overlay.CreateDefault(
796 *context_, options_trianglestrip,
797 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
798 pipelines_->framebuffer_blend_saturation.CreateDefault(
799 *context_, options_trianglestrip,
800 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
801 pipelines_->framebuffer_blend_screen.CreateDefault(
802 *context_, options_trianglestrip,
803 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
804 pipelines_->framebuffer_blend_softlight.CreateDefault(
805 *context_, options_trianglestrip,
806 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
807 } else {
808 pipelines_->blend_color.CreateDefault(
809 *context_, options_trianglestrip,
810 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
811 pipelines_->blend_colorburn.CreateDefault(
812 *context_, options_trianglestrip,
813 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
814 pipelines_->blend_colordodge.CreateDefault(
815 *context_, options_trianglestrip,
816 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
817 pipelines_->blend_darken.CreateDefault(
818 *context_, options_trianglestrip,
819 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
820 pipelines_->blend_difference.CreateDefault(
821 *context_, options_trianglestrip,
822 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
823 pipelines_->blend_exclusion.CreateDefault(
824 *context_, options_trianglestrip,
825 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
826 pipelines_->blend_hardlight.CreateDefault(
827 *context_, options_trianglestrip,
828 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
829 pipelines_->blend_hue.CreateDefault(
830 *context_, options_trianglestrip,
831 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
832 pipelines_->blend_lighten.CreateDefault(
833 *context_, options_trianglestrip,
834 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
835 pipelines_->blend_luminosity.CreateDefault(
836 *context_, options_trianglestrip,
837 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
838 pipelines_->blend_multiply.CreateDefault(
839 *context_, options_trianglestrip,
840 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
841 pipelines_->blend_overlay.CreateDefault(
842 *context_, options_trianglestrip,
843 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
844 pipelines_->blend_saturation.CreateDefault(
845 *context_, options_trianglestrip,
846 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
847 pipelines_->blend_screen.CreateDefault(
848 *context_, options_trianglestrip,
849 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
850 pipelines_->blend_softlight.CreateDefault(
851 *context_, options_trianglestrip,
852 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
853 }
854
855 pipelines_->morphology_filter.CreateDefault(*context_, options_trianglestrip,
856 {supports_decal});
857 pipelines_->linear_to_srgb_filter.CreateDefault(*context_,
858 options_trianglestrip);
859 pipelines_->srgb_to_linear_filter.CreateDefault(*context_,
860 options_trianglestrip);
861 pipelines_->yuv_to_rgb_filter.CreateDefault(*context_, options_trianglestrip);
862
863 if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
864#if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX) && \
865 !defined(FML_OS_EMSCRIPTEN)
866 // GLES only shader that is unsupported on macOS and web.
867 pipelines_->tiled_texture_external.CreateDefault(*context_, options);
868 pipelines_->tiled_texture_uv_external.CreateDefault(*context_, options);
869#endif // !defined(FML_OS_MACOSX)
870
871#if defined(IMPELLER_ENABLE_OPENGLES)
872 pipelines_->texture_downsample_gles.CreateDefault(*context_,
873 options_trianglestrip);
874#endif // IMPELLER_ENABLE_OPENGLES
875 }
876
877 is_valid_ = true;
878 InitializeCommonlyUsedShadersIfNeeded();
879}
880
882
884 return is_valid_;
885}
886
887std::shared_ptr<Texture> ContentContext::GetEmptyTexture() const {
888 return empty_texture_;
889}
890
892 std::string_view label,
893 ISize texture_size,
894 const std::shared_ptr<CommandBuffer>& command_buffer,
895 const SubpassCallback& subpass_callback,
896 bool msaa_enabled,
897 bool depth_stencil_enabled,
898 int32_t mip_count) const {
899 const std::shared_ptr<Context>& context = GetContext();
900 RenderTarget subpass_target;
901
902 std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
904 : std::optional<RenderTarget::AttachmentConfig>();
905
906 if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
907 subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
908 /*context=*/*context,
909 /*size=*/texture_size,
910 /*mip_count=*/mip_count,
911 /*label=*/label,
912 /*color_attachment_config=*/
914 /*stencil_attachment_config=*/depth_stencil_config,
915 /*existing_color_msaa_texture=*/nullptr,
916 /*existing_color_resolve_texture=*/nullptr,
917 /*existing_depth_stencil_texture=*/nullptr,
918 /*target_pixel_format=*/std::nullopt);
919 } else {
920 subpass_target = GetRenderTargetCache()->CreateOffscreen(
921 *context, texture_size,
922 /*mip_count=*/mip_count, label,
923 RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
924 }
925 return MakeSubpass(label, subpass_target, command_buffer, subpass_callback);
926}
927
929 std::string_view label,
930 const RenderTarget& subpass_target,
931 const std::shared_ptr<CommandBuffer>& command_buffer,
932 const SubpassCallback& subpass_callback) const {
933 const std::shared_ptr<Context>& context = GetContext();
934
935 auto subpass_texture = subpass_target.GetRenderTargetTexture();
936 if (!subpass_texture) {
938 }
939
940 auto sub_renderpass = command_buffer->CreateRenderPass(subpass_target);
941 if (!sub_renderpass) {
943 }
944 sub_renderpass->SetLabel(label);
945
946 if (!subpass_callback(*this, *sub_renderpass)) {
948 }
949
950 if (!sub_renderpass->EncodeCommands()) {
952 }
953
954 const std::shared_ptr<Texture>& target_texture =
955 subpass_target.GetRenderTargetTexture();
956 if (target_texture->GetMipCount() > 1) {
957 fml::Status mipmap_status =
959 if (!mipmap_status.ok()) {
960 return mipmap_status;
961 }
962 }
963
964 return subpass_target;
965}
966
968 return *tessellator_;
969}
970
971std::shared_ptr<Context> ContentContext::GetContext() const {
972 return context_;
973}
974
976 return *context_->GetCapabilities();
977}
978
980 const std::string& unique_entrypoint_name,
981 const ContentContextOptions& options,
982 const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
983 create_callback) const {
984 RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
985 auto it = runtime_effect_pipelines_.find(key);
986 if (it == runtime_effect_pipelines_.end()) {
987 it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
988 }
989 return raw_ptr(it->second);
990}
991
993 const std::string& unique_entrypoint_name) const {
994#ifdef IMPELLER_DEBUG
995 // destroying in-use pipleines is a validation error.
996 const auto& idle_waiter = GetContext()->GetIdleWaiter();
997 if (idle_waiter) {
998 idle_waiter->WaitIdle();
999 }
1000#endif // IMPELLER_DEBUG
1001 for (auto it = runtime_effect_pipelines_.begin();
1002 it != runtime_effect_pipelines_.end();) {
1003 if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
1004 it = runtime_effect_pipelines_.erase(it);
1005 } else {
1006 it++;
1007 }
1008 }
1009}
1010
1012 data_host_buffer_->Reset();
1013
1014 // We should only reset the indexes host buffer if it is actually different
1015 // from the data host buffer. Otherwise we'll end up resetting the same host
1016 // buffer twice.
1017 if (data_host_buffer_ != indexes_host_buffer_) {
1018 indexes_host_buffer_->Reset();
1019 }
1020}
1021
1022void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
1023 GetContext()->InitializeCommonlyUsedShadersIfNeeded();
1024}
1025
1027 ContentContextOptions opts) const {
1028 return GetPipeline(this, pipelines_->fast_gradient, opts);
1029}
1030
1032 ContentContextOptions opts) const {
1033 return GetPipeline(this, pipelines_->linear_gradient_fill, opts);
1034}
1035
1037 ContentContextOptions opts) const {
1038 return GetPipeline(this, pipelines_->linear_gradient_uniform_fill, opts);
1039}
1040
1042 ContentContextOptions opts) const {
1043 return GetPipeline(this, pipelines_->radial_gradient_uniform_fill, opts);
1044}
1045
1047 ContentContextOptions opts) const {
1048 return GetPipeline(this, pipelines_->sweep_gradient_uniform_fill, opts);
1049}
1050
1052 ContentContextOptions opts) const {
1053 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1054 return GetPipeline(this, pipelines_->linear_gradient_ssbo_fill, opts);
1055}
1056
1058 ContentContextOptions opts) const {
1059 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1060 return GetPipeline(this, pipelines_->radial_gradient_ssbo_fill, opts);
1061}
1062
1065 ConicalKind kind) const {
1066 switch (kind) {
1068 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill, opts);
1070 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_radial,
1071 opts);
1073 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_strip,
1074 opts);
1076 return GetPipeline(
1077 this, pipelines_->conical_gradient_uniform_fill_strip_and_radial,
1078 opts);
1079 }
1080}
1081
1084 ConicalKind kind) const {
1085 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1086 switch (kind) {
1088 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill, opts);
1090 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_radial,
1091 opts);
1093 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_strip,
1094 opts);
1096 return GetPipeline(
1097 this, pipelines_->conical_gradient_ssbo_fill_strip_and_radial, opts);
1098 }
1099}
1100
1102 ContentContextOptions opts) const {
1103 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1104 return GetPipeline(this, pipelines_->sweep_gradient_ssbo_fill, opts);
1105}
1106
1108 ContentContextOptions opts) const {
1109 return GetPipeline(this, pipelines_->radial_gradient_fill, opts);
1110}
1111
1114 ConicalKind kind) const {
1115 switch (kind) {
1117 return GetPipeline(this, pipelines_->conical_gradient_fill, opts);
1119 return GetPipeline(this, pipelines_->conical_gradient_fill_radial, opts);
1121 return GetPipeline(this, pipelines_->conical_gradient_fill_strip, opts);
1123 return GetPipeline(
1124 this, pipelines_->conical_gradient_fill_strip_and_radial, opts);
1125 }
1126}
1127
1129 ContentContextOptions opts) const {
1130 return GetPipeline(this, pipelines_->rrect_blur, opts);
1131}
1132
1134 ContentContextOptions opts) const {
1135 return GetPipeline(this, pipelines_->rsuperellipse_blur, opts);
1136}
1137
1139 ContentContextOptions opts) const {
1140 return GetPipeline(this, pipelines_->sweep_gradient_fill, opts);
1141}
1142
1144 ContentContextOptions opts) const {
1145 return GetPipeline(this, pipelines_->solid_fill, opts);
1146}
1147
1149 ContentContextOptions opts) const {
1150 return GetPipeline(this, pipelines_->texture, opts);
1151}
1152
1154 ContentContextOptions opts) const {
1155 return GetPipeline(this, pipelines_->texture_strict_src, opts);
1156}
1157
1159 ContentContextOptions opts) const {
1160 return GetPipeline(this, pipelines_->tiled_texture, opts);
1161}
1162
1164 ContentContextOptions opts) const {
1165 return GetPipeline(this, pipelines_->gaussian_blur, opts);
1166}
1167
1169 ContentContextOptions opts) const {
1170 return GetPipeline(this, pipelines_->border_mask_blur, opts);
1171}
1172
1174 ContentContextOptions opts) const {
1175 return GetPipeline(this, pipelines_->morphology_filter, opts);
1176}
1177
1179 ContentContextOptions opts) const {
1180 return GetPipeline(this, pipelines_->color_matrix_color_filter, opts);
1181}
1182
1184 ContentContextOptions opts) const {
1185 return GetPipeline(this, pipelines_->linear_to_srgb_filter, opts);
1186}
1187
1189 ContentContextOptions opts) const {
1190 return GetPipeline(this, pipelines_->srgb_to_linear_filter, opts);
1191}
1192
1194 return GetPipeline(this, pipelines_->clip, opts);
1195}
1196
1198 ContentContextOptions opts) const {
1199 return GetPipeline(this, pipelines_->glyph_atlas, opts);
1200}
1201
1203 ContentContextOptions opts) const {
1204 return GetPipeline(this, pipelines_->yuv_to_rgb_filter, opts);
1205}
1206
1208 ContentContextOptions opts) const {
1209 return GetPipeline(this, pipelines_->uber_sdf, opts);
1210}
1211
1213 ContentContextOptions opts) const {
1214 return GetPipeline(this, pipelines_->complex_rse, opts);
1215}
1216
1218 BlendMode mode,
1219 ContentContextOptions opts) const {
1220 switch (mode) {
1221 case BlendMode::kClear:
1222 return GetClearBlendPipeline(opts);
1223 case BlendMode::kSrc:
1224 return GetSourceBlendPipeline(opts);
1225 case BlendMode::kDst:
1226 return GetDestinationBlendPipeline(opts);
1228 return GetSourceOverBlendPipeline(opts);
1231 case BlendMode::kSrcIn:
1232 return GetSourceInBlendPipeline(opts);
1233 case BlendMode::kDstIn:
1234 return GetDestinationInBlendPipeline(opts);
1235 case BlendMode::kSrcOut:
1236 return GetSourceOutBlendPipeline(opts);
1237 case BlendMode::kDstOut:
1238 return GetDestinationOutBlendPipeline(opts);
1240 return GetSourceATopBlendPipeline(opts);
1243 case BlendMode::kXor:
1244 return GetXorBlendPipeline(opts);
1245 case BlendMode::kPlus:
1246 return GetPlusBlendPipeline(opts);
1248 return GetModulateBlendPipeline(opts);
1249 case BlendMode::kScreen:
1250 return GetScreenBlendPipeline(opts);
1252 case BlendMode::kDarken:
1261 case BlendMode::kHue:
1263 case BlendMode::kColor:
1265 VALIDATION_LOG << "Invalid porter duff blend mode "
1266 << BlendModeToString(mode);
1267 return GetClearBlendPipeline(opts);
1268 break;
1269 }
1270}
1271
1273 ContentContextOptions opts) const {
1274 return GetPipeline(this, pipelines_->clear_blend, opts);
1275}
1276
1278 ContentContextOptions opts) const {
1279 return GetPipeline(this, pipelines_->source_blend, opts);
1280}
1281
1283 ContentContextOptions opts) const {
1284 return GetPipeline(this, pipelines_->destination_blend, opts);
1285}
1286
1288 ContentContextOptions opts) const {
1289 return GetPipeline(this, pipelines_->source_over_blend, opts);
1290}
1291
1293 ContentContextOptions opts) const {
1294 return GetPipeline(this, pipelines_->destination_over_blend, opts);
1295}
1296
1298 ContentContextOptions opts) const {
1299 return GetPipeline(this, pipelines_->source_in_blend, opts);
1300}
1301
1303 ContentContextOptions opts) const {
1304 return GetPipeline(this, pipelines_->destination_in_blend, opts);
1305}
1306
1308 ContentContextOptions opts) const {
1309 return GetPipeline(this, pipelines_->source_out_blend, opts);
1310}
1311
1313 ContentContextOptions opts) const {
1314 return GetPipeline(this, pipelines_->destination_out_blend, opts);
1315}
1316
1318 ContentContextOptions opts) const {
1319 return GetPipeline(this, pipelines_->source_a_top_blend, opts);
1320}
1321
1323 ContentContextOptions opts) const {
1324 return GetPipeline(this, pipelines_->destination_a_top_blend, opts);
1325}
1326
1328 ContentContextOptions opts) const {
1329 return GetPipeline(this, pipelines_->xor_blend, opts);
1330}
1331
1333 ContentContextOptions opts) const {
1334 return GetPipeline(this, pipelines_->plus_blend, opts);
1335}
1336
1338 ContentContextOptions opts) const {
1339 return GetPipeline(this, pipelines_->modulate_blend, opts);
1340}
1341
1343 ContentContextOptions opts) const {
1344 return GetPipeline(this, pipelines_->screen_blend, opts);
1345}
1346
1348 ContentContextOptions opts) const {
1349 return GetPipeline(this, pipelines_->blend_color, opts);
1350}
1351
1353 ContentContextOptions opts) const {
1354 return GetPipeline(this, pipelines_->blend_colorburn, opts);
1355}
1356
1358 ContentContextOptions opts) const {
1359 return GetPipeline(this, pipelines_->blend_colordodge, opts);
1360}
1361
1363 ContentContextOptions opts) const {
1364 return GetPipeline(this, pipelines_->blend_darken, opts);
1365}
1366
1368 ContentContextOptions opts) const {
1369 return GetPipeline(this, pipelines_->blend_difference, opts);
1370}
1371
1373 ContentContextOptions opts) const {
1374 return GetPipeline(this, pipelines_->blend_exclusion, opts);
1375}
1376
1378 ContentContextOptions opts) const {
1379 return GetPipeline(this, pipelines_->blend_hardlight, opts);
1380}
1381
1383 ContentContextOptions opts) const {
1384 return GetPipeline(this, pipelines_->blend_hue, opts);
1385}
1386
1388 ContentContextOptions opts) const {
1389 return GetPipeline(this, pipelines_->blend_lighten, opts);
1390}
1391
1393 ContentContextOptions opts) const {
1394 return GetPipeline(this, pipelines_->blend_luminosity, opts);
1395}
1396
1398 ContentContextOptions opts) const {
1399 return GetPipeline(this, pipelines_->blend_multiply, opts);
1400}
1401
1403 ContentContextOptions opts) const {
1404 return GetPipeline(this, pipelines_->blend_overlay, opts);
1405}
1406
1408 ContentContextOptions opts) const {
1409 return GetPipeline(this, pipelines_->blend_saturation, opts);
1410}
1411
1413 ContentContextOptions opts) const {
1414 return GetPipeline(this, pipelines_->blend_screen, opts);
1415}
1416
1418 ContentContextOptions opts) const {
1419 return GetPipeline(this, pipelines_->blend_softlight, opts);
1420}
1421
1423 ContentContextOptions opts) const {
1424 return GetPipeline(this, pipelines_->texture_downsample, opts);
1425}
1426
1428 ContentContextOptions opts) const {
1429 return GetPipeline(this, pipelines_->texture_downsample_bounded, opts);
1430}
1431
1433 ContentContextOptions opts) const {
1434 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1435 return GetPipeline(this, pipelines_->framebuffer_blend_color, opts);
1436}
1437
1439 ContentContextOptions opts) const {
1440 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1441 return GetPipeline(this, pipelines_->framebuffer_blend_colorburn, opts);
1442}
1443
1445 ContentContextOptions opts) const {
1446 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1447 return GetPipeline(this, pipelines_->framebuffer_blend_colordodge, opts);
1448}
1449
1451 ContentContextOptions opts) const {
1452 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1453 return GetPipeline(this, pipelines_->framebuffer_blend_darken, opts);
1454}
1455
1457 ContentContextOptions opts) const {
1458 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1459 return GetPipeline(this, pipelines_->framebuffer_blend_difference, opts);
1460}
1461
1463 ContentContextOptions opts) const {
1464 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1465 return GetPipeline(this, pipelines_->framebuffer_blend_exclusion, opts);
1466}
1467
1469 ContentContextOptions opts) const {
1470 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1471 return GetPipeline(this, pipelines_->framebuffer_blend_hardlight, opts);
1472}
1473
1475 ContentContextOptions opts) const {
1476 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1477 return GetPipeline(this, pipelines_->framebuffer_blend_hue, opts);
1478}
1479
1481 ContentContextOptions opts) const {
1482 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1483 return GetPipeline(this, pipelines_->framebuffer_blend_lighten, opts);
1484}
1485
1487 ContentContextOptions opts) const {
1488 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1489 return GetPipeline(this, pipelines_->framebuffer_blend_luminosity, opts);
1490}
1491
1493 ContentContextOptions opts) const {
1494 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1495 return GetPipeline(this, pipelines_->framebuffer_blend_multiply, opts);
1496}
1497
1499 ContentContextOptions opts) const {
1500 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1501 return GetPipeline(this, pipelines_->framebuffer_blend_overlay, opts);
1502}
1503
1505 ContentContextOptions opts) const {
1506 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1507 return GetPipeline(this, pipelines_->framebuffer_blend_saturation, opts);
1508}
1509
1511 ContentContextOptions opts) const {
1512 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1513 return GetPipeline(this, pipelines_->framebuffer_blend_screen, opts);
1514}
1515
1517 ContentContextOptions opts) const {
1518 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1519 return GetPipeline(this, pipelines_->framebuffer_blend_softlight, opts);
1520}
1521
1523 ContentContextOptions opts) const {
1524 return GetPipeline(this, pipelines_->shadow_vertices_, opts);
1525}
1526
1528 BlendMode blend_mode,
1529 ContentContextOptions opts) const {
1530 if (blend_mode <= BlendMode::kHardLight) {
1531 return GetPipeline(this, pipelines_->vertices_uber_1_, opts);
1532 } else {
1533 return GetPipeline(this, pipelines_->vertices_uber_2_, opts);
1534 }
1535}
1536
1538 ContentContextOptions opts) const {
1539 return GetPipeline(this, pipelines_->circle, opts);
1540}
1541
1543 return GetPipeline(this, pipelines_->line, opts);
1544}
1545
1546#ifdef IMPELLER_ENABLE_OPENGLES
1547
1548#if !defined(FML_OS_EMSCRIPTEN)
1549PipelineRef ContentContext::GetTiledTextureUvExternalPipeline(
1550 ContentContextOptions opts) const {
1552 return GetPipeline(this, pipelines_->tiled_texture_uv_external, opts);
1553}
1554
1555PipelineRef ContentContext::GetTiledTextureExternalPipeline(
1556 ContentContextOptions opts) const {
1558 return GetPipeline(this, pipelines_->tiled_texture_external, opts);
1559}
1560#endif
1561
1562PipelineRef ContentContext::GetDownsampleTextureGlesPipeline(
1563 ContentContextOptions opts) const {
1564 return GetPipeline(this, pipelines_->texture_downsample_gles, opts);
1565}
1566
1567#endif // IMPELLER_ENABLE_OPENGLES
1568
1570 is_texture_caching_enabled_ = enabled;
1571 if (!enabled) {
1572 texture_cache_.clear();
1573 }
1574}
1575
1576std::shared_ptr<Texture> ContentContext::GetCachedTexture(
1577 const flutter::DlImage* image) const {
1578 if (!image) {
1579 return nullptr;
1580 }
1581 if (is_texture_caching_enabled_) {
1582 auto it = texture_cache_.find(image);
1583 if (it != texture_cache_.end()) {
1584 return it->second;
1585 }
1586 }
1587 return nullptr;
1588}
1589
1591 const flutter::DlImage* image,
1592 const std::shared_ptr<Texture>& texture) const {
1593 if (!image || !texture) {
1594 return;
1595 }
1596 if (is_texture_caching_enabled_) {
1597 texture_cache_[image] = texture;
1598 }
1599}
1600
1602 texture_cache_.erase(image);
1603}
1604
1606 texture_cache_.clear();
1607}
1608
1609} // 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 GetComplexRSEPipeline(ContentContextOptions opts) 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
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 at least ...
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
std::shared_ptr< ContextGLES > context
std::shared_ptr< PipelineGLES > pipeline
std::shared_ptr< CommandBuffer > command_buffer
Describe the color attachment that will be used with this pipeline.
Definition formats.h:770
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< ComplexRSEPipeline > complex_rse
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