| Flutter Impeller |

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
5 #include "impeller/entity/contents/content_context.h"
6
7 #include <memory>
8 #include <utility>
9
10 #include "fml/trace_event.h"
11 #include "impeller/base/validation.h"
12 #include "impeller/core/formats.h"
13 #include "impeller/core/texture_descriptor.h"
14 #include "impeller/entity/contents/framebuffer_blend_contents.h"
15 #include "impeller/entity/contents/pipelines.h"
16 #include "impeller/entity/contents/text_shadow_cache.h"
17 #include "impeller/entity/entity.h"
18 #include "impeller/entity/render_target_cache.h"
19 #include "impeller/renderer/command_buffer.h"
20 #include "impeller/renderer/pipeline_descriptor.h"
21 #include "impeller/renderer/pipeline_library.h"
22 #include "impeller/renderer/render_target.h"
23 #include "impeller/renderer/texture_util.h"
24 #include "impeller/tessellator/tessellator.h"
25 #include "impeller/typographer/typographer_context.h"
26
27 namespace impeller {
28
29 namespace {
30
31 /// A generic version of `Variants` which mostly exists to reduce code size.
32 class GenericVariants {
33 public:
34 void Set(const ContentContextOptions& options,
35 std::unique_ptr<GenericRenderPipelineHandle> pipeline) {
36 uint64_t p_key = options.ToKey();
37 for (const auto& [key, pipeline] : pipelines_) {
38 if (key == p_key) {
39 return;
40 }
41 }
42 pipelines_.push_back(std::make_pair(p_key, std::move(pipeline)));
43 }
44
45 void SetDefault(const ContentContextOptions& options,
46 std::unique_ptr<GenericRenderPipelineHandle> pipeline) {
47 default_options_ = options;
48 if (pipeline) {
49 Set(options, std::move(pipeline));
50 }
51 }
52
53 GenericRenderPipelineHandle* Get(const ContentContextOptions& options) const {
54 uint64_t p_key = options.ToKey();
55 for (const auto& [key, pipeline] : pipelines_) {
56 if (key == p_key) {
57 return pipeline.get();
58 }
59 }
60 return nullptr;
61 }
62
63 void SetDefaultDescriptor(std::optional<PipelineDescriptor> desc) {
64 desc_ = std::move(desc);
65 }
66
67 size_t GetPipelineCount() const { return pipelines_.size(); }
68
69 bool IsDefault(const ContentContextOptions& opts) {
70 return default_options_.has_value() &&
71 opts.ToKey() == default_options_.value().ToKey();
72 }
73
74 protected:
75 std::optional<PipelineDescriptor> desc_;
76 std::optional<ContentContextOptions> default_options_;
77 std::vector<std::pair<uint64_t, std::unique_ptr<GenericRenderPipelineHandle>>>
78 pipelines_;
79 };
80
81 /// Holds multiple Pipelines associated with the same PipelineHandle types.
82 ///
83 /// For example, it may have multiple
84 /// RenderPipelineHandle<SolidFillVertexShader, SolidFillFragmentShader>
85 /// instances for different blend modes. From them you can access the
86 /// Pipeline.
87 ///
88 /// See also:
89 /// - impeller::ContentContextOptions - options from which variants are
90 /// created.
91 /// - impeller::Pipeline::CreateVariant
92 /// - impeller::RenderPipelineHandle<> - The type of objects this typically
93 /// contains.
94 template <class PipelineHandleT>
95 class Variants : public GenericVariants {
96 static_assert(
97 ShaderStageCompatibilityChecker<
98 typename PipelineHandleT::VertexShader,
99 typename PipelineHandleT::FragmentShader>::Check(),
100 "The output slots for the fragment shader don't have matches in the "
101 "vertex shader's output slots. This will result in a linker error.");
102
103 public:
104 Variants() = default;
105
106 void Set(const ContentContextOptions& options,
107 std::unique_ptr<PipelineHandleT> pipeline) {
108 GenericVariants::Set(options, std::move(pipeline));
109 }
110
111 void SetDefault(const ContentContextOptions& options,
112 std::unique_ptr<PipelineHandleT> pipeline) {
113 GenericVariants::SetDefault(options, std::move(pipeline));
114 }
115
116 void CreateDefault(const Context& context,
117 const ContentContextOptions& options,
118 const std::vector<Scalar>& constants = {}) {
119 std::optional<PipelineDescriptor> desc =
120 PipelineHandleT::Builder::MakeDefaultPipelineDescriptor(context,
121 constants);
122 if (!desc.has_value()) {
123 VALIDATION_LOG << "Failed to create default pipeline.";
124 return;
125 }
126 options.ApplyToPipelineDescriptor(*desc);
127 desc_ = desc;
128 if (context.GetFlags().lazy_shader_mode) {
129 SetDefault(options, nullptr);
130 } else {
131 SetDefault(options, std::make_unique<PipelineHandleT>(context, desc_,
132 /*async=*/true));
133 }
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 return Get(default_options_.value());
151 }
152
153 private:
154 Variants(const Variants&) = delete;
155
156 Variants& operator=(const Variants&) = delete;
157 };
158
159 template <class RenderPipelineHandleT>
160 RenderPipelineHandleT* CreateIfNeeded(
161 const ContentContext* context,
162 Variants<RenderPipelineHandleT>& container,
163 ContentContextOptions opts) {
164 if (!context->IsValid()) {
165 return nullptr;
166 }
167
168 if (RenderPipelineHandleT* found = container.Get(opts)) {
169 return found;
170 }
171
172 RenderPipelineHandleT* default_handle =
173 container.GetDefault(*context->GetContext());
174 if (container.IsDefault(opts)) {
175 return default_handle;
176 }
177
178 // The default must always be initialized in the constructor.
179 FML_CHECK(default_handle != nullptr);
180
181 const std::shared_ptr<Pipeline<PipelineDescriptor>>& pipeline =
182 default_handle->WaitAndGet();
183 if (!pipeline) {
184 return nullptr;
185 }
186
187 auto variant_future = pipeline->CreateVariant(
188 /*async=*/false, [&opts, variants_count = container.GetPipelineCount()](
189 PipelineDescriptor& desc) {
190 opts.ApplyToPipelineDescriptor(desc);
191 desc.SetLabel(
192 SPrintF("%s V#%zu", desc.GetLabel().data(), variants_count));
193 });
194 std::unique_ptr<RenderPipelineHandleT> variant =
195 std::make_unique<RenderPipelineHandleT>(std::move(variant_future));
196 container.Set(opts, std::move(variant));
197 return container.Get(opts);
198 }
199
200 template <class TypedPipeline>
201 PipelineRef GetPipeline(const ContentContext* context,
202 Variants<TypedPipeline>& container,
203 ContentContextOptions opts) {
204 TypedPipeline* pipeline = CreateIfNeeded(context, container, opts);
205 if (!pipeline) {
206 return raw_ptr<Pipeline<PipelineDescriptor>>();
207 }
208 return raw_ptr(pipeline->WaitAndGet());
209 }
210
211 } // namespace
212
213 struct ContentContext::Pipelines {
214 // clang-format off
215 Variants<BlendColorBurnPipeline> blend_colorburn;
216 Variants<BlendColorDodgePipeline> blend_colordodge;
217 Variants<BlendColorPipeline> blend_color;
218 Variants<BlendDarkenPipeline> blend_darken;
219 Variants<BlendDifferencePipeline> blend_difference;
220 Variants<BlendExclusionPipeline> blend_exclusion;
221 Variants<BlendHardLightPipeline> blend_hardlight;
222 Variants<BlendHuePipeline> blend_hue;
223 Variants<BlendLightenPipeline> blend_lighten;
224 Variants<BlendLuminosityPipeline> blend_luminosity;
225 Variants<BlendMultiplyPipeline> blend_multiply;
226 Variants<BlendOverlayPipeline> blend_overlay;
227 Variants<BlendSaturationPipeline> blend_saturation;
228 Variants<BlendScreenPipeline> blend_screen;
229 Variants<BlendSoftLightPipeline> blend_softlight;
230 Variants<BorderMaskBlurPipeline> border_mask_blur;
231 Variants<ClipPipeline> clip;
232 Variants<ColorMatrixColorFilterPipeline> color_matrix_color_filter;
233 Variants<ConicalGradientFillConicalPipeline> conical_gradient_fill;
234 Variants<ConicalGradientFillRadialPipeline> conical_gradient_fill_radial;
235 Variants<ConicalGradientFillStripPipeline> conical_gradient_fill_strip;
236 Variants<ConicalGradientFillStripRadialPipeline> conical_gradient_fill_strip_and_radial;
237 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill;
238 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_radial;
239 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_strip_and_radial;
240 Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_strip;
241 Variants<ConicalGradientUniformFillConicalPipeline> conical_gradient_uniform_fill;
242 Variants<ConicalGradientUniformFillRadialPipeline> conical_gradient_uniform_fill_radial;
243 Variants<ConicalGradientUniformFillStripPipeline> conical_gradient_uniform_fill_strip;
244 Variants<ConicalGradientUniformFillStripRadialPipeline> conical_gradient_uniform_fill_strip_and_radial;
245 Variants<FastGradientPipeline> fast_gradient;
246 Variants<FramebufferBlendColorBurnPipeline> framebuffer_blend_colorburn;
247 Variants<FramebufferBlendColorDodgePipeline> framebuffer_blend_colordodge;
248 Variants<FramebufferBlendColorPipeline> framebuffer_blend_color;
249 Variants<FramebufferBlendDarkenPipeline> framebuffer_blend_darken;
250 Variants<FramebufferBlendDifferencePipeline> framebuffer_blend_difference;
251 Variants<FramebufferBlendExclusionPipeline> framebuffer_blend_exclusion;
252 Variants<FramebufferBlendHardLightPipeline> framebuffer_blend_hardlight;
253 Variants<FramebufferBlendHuePipeline> framebuffer_blend_hue;
254 Variants<FramebufferBlendLightenPipeline> framebuffer_blend_lighten;
255 Variants<FramebufferBlendLuminosityPipeline> framebuffer_blend_luminosity;
256 Variants<FramebufferBlendMultiplyPipeline> framebuffer_blend_multiply;
257 Variants<FramebufferBlendOverlayPipeline> framebuffer_blend_overlay;
258 Variants<FramebufferBlendSaturationPipeline> framebuffer_blend_saturation;
259 Variants<FramebufferBlendScreenPipeline> framebuffer_blend_screen;
260 Variants<FramebufferBlendSoftLightPipeline> framebuffer_blend_softlight;
261 Variants<GaussianBlurPipeline> gaussian_blur;
262 Variants<GlyphAtlasPipeline> glyph_atlas;
263 Variants<LinePipeline> line;
264 Variants<LinearGradientFillPipeline> linear_gradient_fill;
265 Variants<LinearGradientSSBOFillPipeline> linear_gradient_ssbo_fill;
266 Variants<LinearGradientUniformFillPipeline> linear_gradient_uniform_fill;
267 Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter;
268 Variants<MorphologyFilterPipeline> morphology_filter;
269 Variants<PorterDuffBlendPipeline> clear_blend;
270 Variants<PorterDuffBlendPipeline> destination_a_top_blend;
271 Variants<PorterDuffBlendPipeline> destination_blend;
272 Variants<PorterDuffBlendPipeline> destination_in_blend;
273 Variants<PorterDuffBlendPipeline> destination_out_blend;
274 Variants<PorterDuffBlendPipeline> destination_over_blend;
275 Variants<PorterDuffBlendPipeline> modulate_blend;
276 Variants<PorterDuffBlendPipeline> plus_blend;
277 Variants<PorterDuffBlendPipeline> screen_blend;
278 Variants<PorterDuffBlendPipeline> source_a_top_blend;
279 Variants<PorterDuffBlendPipeline> source_blend;
280 Variants<PorterDuffBlendPipeline> source_in_blend;
281 Variants<PorterDuffBlendPipeline> source_out_blend;
282 Variants<PorterDuffBlendPipeline> source_over_blend;
283 Variants<PorterDuffBlendPipeline> xor_blend;
284 Variants<RadialGradientFillPipeline> radial_gradient_fill;
285 Variants<RadialGradientSSBOFillPipeline> radial_gradient_ssbo_fill;
286 Variants<RadialGradientUniformFillPipeline> radial_gradient_uniform_fill;
287 Variants<RRectBlurPipeline> rrect_blur;
288 Variants<RSuperellipseBlurPipeline> rsuperellipse_blur;
289 Variants<SolidFillPipeline> solid_fill;
290 Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter;
291 Variants<SweepGradientFillPipeline> sweep_gradient_fill;
292 Variants<SweepGradientSSBOFillPipeline> sweep_gradient_ssbo_fill;
293 Variants<SweepGradientUniformFillPipeline> sweep_gradient_uniform_fill;
294 Variants<TextureDownsamplePipeline> texture_downsample;
295 Variants<TexturePipeline> texture;
296 Variants<TextureStrictSrcPipeline> texture_strict_src;
297 Variants<TiledTexturePipeline> tiled_texture;
298 Variants<VerticesUber1Shader> vertices_uber_1_;
299 Variants<VerticesUber2Shader> vertices_uber_2_;
300 Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter;
301
302 #ifdef IMPELLER_ENABLE_OPENGLES
303 Variants<TiledTextureExternalPipeline> tiled_texture_external;
304 Variants<TextureDownsampleGlesPipeline> texture_downsample_gles;
305 Variants<TiledTextureUvExternalPipeline> tiled_texture_uv_external;
306 #endif // IMPELLER_ENABLE_OPENGLES
307 // clang-format on
308 };
309
310 void ContentContextOptions::ApplyToPipelineDescriptor(
311 PipelineDescriptor& desc) const {
312 auto pipeline_blend = blend_mode;
313 if (blend_mode > Entity::kLastPipelineBlendMode) {
314 VALIDATION_LOG << "Cannot use blend mode " << static_cast<int>(blend_mode)
315 << " as a pipeline blend.";
316 pipeline_blend = BlendMode::kSrcOver;
317 }
318
319 desc.SetSampleCount(sample_count);
320
321 ColorAttachmentDescriptor color0 = *desc.GetColorAttachmentDescriptor(0u);
322 color0.format = color_attachment_pixel_format;
323 color0.alpha_blend_op = BlendOperation::kAdd;
324 color0.color_blend_op = BlendOperation::kAdd;
325 color0.write_mask = ColorWriteMaskBits::kAll;
326
327 switch (pipeline_blend) {
328 case BlendMode::kClear:
329 if (is_for_rrect_blur_clear) {
330 color0.alpha_blend_op = BlendOperation::kReverseSubtract;
331 color0.color_blend_op = BlendOperation::kReverseSubtract;
332 color0.dst_alpha_blend_factor = BlendFactor::kOne;
333 color0.dst_color_blend_factor = BlendFactor::kOne;
334 color0.src_alpha_blend_factor = BlendFactor::kDestinationColor;
335 color0.src_color_blend_factor = BlendFactor::kDestinationColor;
336 } else {
337 color0.dst_alpha_blend_factor = BlendFactor::kZero;
338 color0.dst_color_blend_factor = BlendFactor::kZero;
339 color0.src_alpha_blend_factor = BlendFactor::kZero;
340 color0.src_color_blend_factor = BlendFactor::kZero;
341 }
342 break;
343 case BlendMode::kSrc:
344 color0.blending_enabled = false;
345 color0.dst_alpha_blend_factor = BlendFactor::kZero;
346 color0.dst_color_blend_factor = BlendFactor::kZero;
347 color0.src_alpha_blend_factor = BlendFactor::kOne;
348 color0.src_color_blend_factor = BlendFactor::kOne;
349 break;
350 case BlendMode::kDst:
351 color0.dst_alpha_blend_factor = BlendFactor::kOne;
352 color0.dst_color_blend_factor = BlendFactor::kOne;
353 color0.src_alpha_blend_factor = BlendFactor::kZero;
354 color0.src_color_blend_factor = BlendFactor::kZero;
355 color0.write_mask = ColorWriteMaskBits::kNone;
356 break;
357 case BlendMode::kSrcOver:
358 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
359 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
360 color0.src_alpha_blend_factor = BlendFactor::kOne;
361 color0.src_color_blend_factor = BlendFactor::kOne;
362 break;
363 case BlendMode::kDstOver:
364 color0.dst_alpha_blend_factor = BlendFactor::kOne;
365 color0.dst_color_blend_factor = BlendFactor::kOne;
366 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
367 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
368 break;
369 case BlendMode::kSrcIn:
370 color0.dst_alpha_blend_factor = BlendFactor::kZero;
371 color0.dst_color_blend_factor = BlendFactor::kZero;
372 color0.src_alpha_blend_factor = BlendFactor::kDestinationAlpha;
373 color0.src_color_blend_factor = BlendFactor::kDestinationAlpha;
374 break;
375 case BlendMode::kDstIn:
376 color0.dst_alpha_blend_factor = BlendFactor::kSourceAlpha;
377 color0.dst_color_blend_factor = BlendFactor::kSourceAlpha;
378 color0.src_alpha_blend_factor = BlendFactor::kZero;
379 color0.src_color_blend_factor = BlendFactor::kZero;
380 break;
381 case BlendMode::kSrcOut:
382 color0.dst_alpha_blend_factor = BlendFactor::kZero;
383 color0.dst_color_blend_factor = BlendFactor::kZero;
384 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
385 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
386 break;
387 case BlendMode::kDstOut:
388 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
389 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
390 color0.src_alpha_blend_factor = BlendFactor::kZero;
391 color0.src_color_blend_factor = BlendFactor::kZero;
392 break;
393 case BlendMode::kSrcATop:
394 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
395 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
396 color0.src_alpha_blend_factor = BlendFactor::kDestinationAlpha;
397 color0.src_color_blend_factor = BlendFactor::kDestinationAlpha;
398 break;
399 case BlendMode::kDstATop:
400 color0.dst_alpha_blend_factor = BlendFactor::kSourceAlpha;
401 color0.dst_color_blend_factor = BlendFactor::kSourceAlpha;
402 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
403 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
404 break;
405 case BlendMode::kXor:
406 color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
407 color0.dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;
408 color0.src_alpha_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
409 color0.src_color_blend_factor = BlendFactor::kOneMinusDestinationAlpha;
410 break;
411 case BlendMode::kPlus:
412 color0.dst_alpha_blend_factor = BlendFactor::kOne;
413 color0.dst_color_blend_factor = BlendFactor::kOne;
414 color0.src_alpha_blend_factor = BlendFactor::kOne;
415 color0.src_color_blend_factor = BlendFactor::kOne;
416 break;
417 case BlendMode::kModulate:
418 color0.dst_alpha_blend_factor = BlendFactor::kSourceAlpha;
419 color0.dst_color_blend_factor = BlendFactor::kSourceColor;
420 color0.src_alpha_blend_factor = BlendFactor::kZero;
421 color0.src_color_blend_factor = BlendFactor::kZero;
422 break;
423 default:
424 FML_UNREACHABLE();
425 }
426 desc.SetColorAttachmentDescriptor(0u, color0);
427
428 if (!has_depth_stencil_attachments) {
429 desc.ClearDepthAttachment();
430 desc.ClearStencilAttachments();
431 }
432
433 auto maybe_stencil = desc.GetFrontStencilAttachmentDescriptor();
434 auto maybe_depth = desc.GetDepthStencilAttachmentDescriptor();
435 FML_DCHECK(has_depth_stencil_attachments == maybe_depth.has_value())
436 << "Depth attachment doesn't match expected pipeline state. "
437 "has_depth_stencil_attachments="
438 << has_depth_stencil_attachments;
439 FML_DCHECK(has_depth_stencil_attachments == maybe_stencil.has_value())
440 << "Stencil attachment doesn't match expected pipeline state. "
441 "has_depth_stencil_attachments="
442 << has_depth_stencil_attachments;
443 if (maybe_stencil.has_value()) {
444 StencilAttachmentDescriptor front_stencil = maybe_stencil.value();
445 StencilAttachmentDescriptor back_stencil = front_stencil;
446
447 switch (stencil_mode) {
448 case StencilMode::kIgnore:
449 front_stencil.stencil_compare = CompareFunction::kAlways;
450 front_stencil.depth_stencil_pass = StencilOperation::kKeep;
451 desc.SetStencilAttachmentDescriptors(front_stencil);
452 break;
453 case StencilMode::kStencilNonZeroFill:
454 // The stencil ref should be 0 on commands that use this mode.
455 front_stencil.stencil_compare = CompareFunction::kAlways;
456 front_stencil.depth_stencil_pass = StencilOperation::kIncrementWrap;
457 back_stencil.stencil_compare = CompareFunction::kAlways;
458 back_stencil.depth_stencil_pass = StencilOperation::kDecrementWrap;
459 desc.SetStencilAttachmentDescriptors(front_stencil, back_stencil);
460 break;
461 case StencilMode::kStencilEvenOddFill:
462 // The stencil ref should be 0 on commands that use this mode.
463 front_stencil.stencil_compare = CompareFunction::kEqual;
464 front_stencil.depth_stencil_pass = StencilOperation::kIncrementWrap;
465 front_stencil.stencil_failure = StencilOperation::kDecrementWrap;
466 desc.SetStencilAttachmentDescriptors(front_stencil);
467 break;
468 case StencilMode::kCoverCompare:
469 // The stencil ref should be 0 on commands that use this mode.
470 front_stencil.stencil_compare = CompareFunction::kNotEqual;
471 front_stencil.depth_stencil_pass =
472 StencilOperation::kSetToReferenceValue;
473 desc.SetStencilAttachmentDescriptors(front_stencil);
474 break;
475 case StencilMode::kCoverCompareInverted:
476 // The stencil ref should be 0 on commands that use this mode.
477 front_stencil.stencil_compare = CompareFunction::kEqual;
478 front_stencil.stencil_failure = StencilOperation::kSetToReferenceValue;
479 desc.SetStencilAttachmentDescriptors(front_stencil);
480 break;
481 case StencilMode::kOverdrawPreventionIncrement:
482 front_stencil.stencil_compare = CompareFunction::kEqual;
483 front_stencil.depth_stencil_pass = StencilOperation::kIncrementClamp;
484 desc.SetStencilAttachmentDescriptors(front_stencil);
485 break;
486 case StencilMode::kOverdrawPreventionRestore:
487 front_stencil.stencil_compare = CompareFunction::kLess;
488 front_stencil.depth_stencil_pass =
489 StencilOperation::kSetToReferenceValue;
490 desc.SetStencilAttachmentDescriptors(front_stencil);
491 break;
492 }
493 }
494 if (maybe_depth.has_value()) {
495 DepthAttachmentDescriptor depth = maybe_depth.value();
496 depth.depth_write_enabled = depth_write_enabled;
497 depth.depth_compare = depth_compare;
498 desc.SetDepthStencilAttachmentDescriptor(depth);
499 }
500
501 desc.SetPrimitiveType(primitive_type);
502 desc.SetPolygonMode(PolygonMode::kFill);
503 }
504
505 std::array<std::vector<Scalar>, 15> GetPorterDuffSpecConstants(
506 bool supports_decal) {
507 Scalar x = supports_decal ? 1 : 0;
508 return {{
509 {x, 0, 0, 0, 0, 0}, // Clear
510 {x, 1, 0, 0, 0, 0}, // Source
511 {x, 0, 0, 1, 0, 0}, // Destination
512 {x, 1, 0, 1, -1, 0}, // SourceOver
513 {x, 1, -1, 1, 0, 0}, // DestinationOver
514 {x, 0, 1, 0, 0, 0}, // SourceIn
515 {x, 0, 0, 0, 1, 0}, // DestinationIn
516 {x, 1, -1, 0, 0, 0}, // SourceOut
517 {x, 0, 0, 1, -1, 0}, // DestinationOut
518 {x, 0, 1, 1, -1, 0}, // SourceATop
519 {x, 1, -1, 0, 1, 0}, // DestinationATop
520 {x, 1, -1, 1, -1, 0}, // Xor
521 {x, 1, 0, 1, 0, 0}, // Plus
522 {x, 0, 0, 0, 0, 1}, // Modulate
523 {x, 0, 0, 1, 0, -1}, // Screen
524 }};
525 }
526
527 template <typename PipelineT>
528 static std::unique_ptr<PipelineT> CreateDefaultPipeline(
529 const Context& context) {
530 auto desc = PipelineT::Builder::MakeDefaultPipelineDescriptor(context);
531 if (!desc.has_value()) {
532 return nullptr;
533 }
534 // Apply default ContentContextOptions to the descriptor.
535 const auto default_color_format =
536 context.GetCapabilities()->GetDefaultColorFormat();
537 ContentContextOptions{.sample_count = SampleCount::kCount4,
538 .primitive_type = PrimitiveType::kTriangleStrip,
539 .color_attachment_pixel_format = default_color_format}
540 .ApplyToPipelineDescriptor(*desc);
541 return std::make_unique<PipelineT>(context, desc);
542 }
543
544 ContentContext::ContentContext(
545 std::shared_ptr<Context> context,
546 std::shared_ptr<TypographerContext> typographer_context,
547 std::shared_ptr<RenderTargetAllocator> render_target_allocator)
548 : context_(std::move(context)),
549 lazy_glyph_atlas_(
550 std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
551 pipelines_(new Pipelines()),
552 tessellator_(std::make_shared<Tessellator>()),
553 render_target_cache_(render_target_allocator == nullptr
554 ? std::make_shared<RenderTargetCache>(
555 context_->GetResourceAllocator())
556 : std::move(render_target_allocator)),
557 host_buffer_(HostBuffer::Create(
558 context_->GetResourceAllocator(),
559 context_->GetIdleWaiter(),
560 context_->GetCapabilities()->GetMinimumUniformAlignment())),
561 text_shadow_cache_(std::make_unique<TextShadowCache>()) {
562 if (!context_ || !context_->IsValid()) {
563 return;
564 }
565
566 {
567 TextureDescriptor desc;
568 desc.storage_mode = StorageMode::kDevicePrivate;
569 desc.format = PixelFormat::kR8G8B8A8UNormInt;
570 desc.size = ISize{1, 1};
571 empty_texture_ = GetContext()->GetResourceAllocator()->CreateTexture(desc);
572
573 std::array<uint8_t, 4> data = Color::BlackTransparent().ToR8G8B8A8();
574 std::shared_ptr<CommandBuffer> cmd_buffer =
575 GetContext()->CreateCommandBuffer();
576 std::shared_ptr<BlitPass> blit_pass = cmd_buffer->CreateBlitPass();
577 HostBuffer& host_buffer = GetTransientsBuffer();
578 BufferView buffer_view = host_buffer.Emplace(data);
579 blit_pass->AddCopy(buffer_view, empty_texture_);
580
581 if (!blit_pass->EncodeCommands() || !GetContext()
582 ->GetCommandQueue()
583 ->Submit({std::move(cmd_buffer)})
584 .ok()) {
585 VALIDATION_LOG << "Failed to create empty texture.";
586 }
587 }
588
589 auto options = ContentContextOptions{
590 .sample_count = SampleCount::kCount4,
591 .color_attachment_pixel_format =
592 context_->GetCapabilities()->GetDefaultColorFormat()};
593 auto options_trianglestrip = ContentContextOptions{
594 .sample_count = SampleCount::kCount4,
595 .primitive_type = PrimitiveType::kTriangleStrip,
596 .color_attachment_pixel_format =
597 context_->GetCapabilities()->GetDefaultColorFormat()};
598 auto options_no_msaa_no_depth_stencil = ContentContextOptions{
599 .sample_count = SampleCount::kCount1,
600 .primitive_type = PrimitiveType::kTriangleStrip,
601 .color_attachment_pixel_format =
602 context_->GetCapabilities()->GetDefaultColorFormat(),
603 .has_depth_stencil_attachments = false};
604 const auto supports_decal = static_cast<Scalar>(
605 context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
606
607 // Futures for the following pipelines may block in case the first frame is
608 // rendered without the pipelines being ready. Put pipelines that are more
609 // likely to be used first.
610 {
611 pipelines_->glyph_atlas.CreateDefault(
612 *context_, options,
613 {static_cast<Scalar>(
614 GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
615 PixelFormat::kA8UNormInt)});
616 pipelines_->solid_fill.CreateDefault(*context_, options);
617 pipelines_->texture.CreateDefault(*context_, options);
618 pipelines_->fast_gradient.CreateDefault(*context_, options);
619 pipelines_->line.CreateDefault(*context_, options);
620
621 if (context_->GetCapabilities()->SupportsSSBO()) {
622 pipelines_->linear_gradient_ssbo_fill.CreateDefault(*context_, options);
623 pipelines_->radial_gradient_ssbo_fill.CreateDefault(*context_, options);
624 pipelines_->conical_gradient_ssbo_fill.CreateDefault(*context_, options,
625 {3.0});
626 pipelines_->conical_gradient_ssbo_fill_radial.CreateDefault(
627 *context_, options, {1.0});
628 pipelines_->conical_gradient_ssbo_fill_strip.CreateDefault(
629 *context_, options, {2.0});
630 pipelines_->conical_gradient_ssbo_fill_strip_and_radial.CreateDefault(
631 *context_, options, {0.0});
632 pipelines_->sweep_gradient_ssbo_fill.CreateDefault(*context_, options);
633 } else {
634 pipelines_->linear_gradient_uniform_fill.CreateDefault(*context_,
635 options);
636 pipelines_->radial_gradient_uniform_fill.CreateDefault(*context_,
637 options);
638 pipelines_->conical_gradient_uniform_fill.CreateDefault(*context_,
639 options);
640 pipelines_->conical_gradient_uniform_fill_radial.CreateDefault(*context_,
641 options);
642 pipelines_->conical_gradient_uniform_fill_strip.CreateDefault(*context_,
643 options);
644 pipelines_->conical_gradient_uniform_fill_strip_and_radial.CreateDefault(
645 *context_, options);
646 pipelines_->sweep_gradient_uniform_fill.CreateDefault(*context_, options);
647
648 pipelines_->linear_gradient_fill.CreateDefault(*context_, options);
649 pipelines_->radial_gradient_fill.CreateDefault(*context_, options);
650 pipelines_->conical_gradient_fill.CreateDefault(*context_, options);
651 pipelines_->conical_gradient_fill_radial.CreateDefault(*context_,
652 options);
653 pipelines_->conical_gradient_fill_strip.CreateDefault(*context_, options);
654 pipelines_->conical_gradient_fill_strip_and_radial.CreateDefault(
655 *context_, options);
656 pipelines_->sweep_gradient_fill.CreateDefault(*context_, options);
657 }
658
659 /// Setup default clip pipeline.
660 auto clip_pipeline_descriptor =
661 ClipPipeline::Builder::MakeDefaultPipelineDescriptor(*context_);
662 if (!clip_pipeline_descriptor.has_value()) {
663 return;
664 }
665 ContentContextOptions{
666 .sample_count = SampleCount::kCount4,
667 .color_attachment_pixel_format =
668 context_->GetCapabilities()->GetDefaultColorFormat()}
669 .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
670 // Disable write to all color attachments.
671 auto clip_color_attachments =
672 clip_pipeline_descriptor->GetColorAttachmentDescriptors();
673 for (auto& color_attachment : clip_color_attachments) {
674 color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
675 }
676 clip_pipeline_descriptor->SetColorAttachmentDescriptors(
677 std::move(clip_color_attachments));
678 if (GetContext()->GetFlags().lazy_shader_mode) {
679 pipelines_->clip.SetDefaultDescriptor(clip_pipeline_descriptor);
680 pipelines_->clip.SetDefault(options, nullptr);
681 } else {
682 pipelines_->clip.SetDefault(
683 options,
684 std::make_unique<ClipPipeline>(*context_, clip_pipeline_descriptor));
685 }
686 pipelines_->texture_downsample.CreateDefault(
687 *context_, options_no_msaa_no_depth_stencil);
688 pipelines_->rrect_blur.CreateDefault(*context_, options_trianglestrip);
689 pipelines_->rsuperellipse_blur.CreateDefault(*context_,
690 options_trianglestrip);
691 pipelines_->texture_strict_src.CreateDefault(*context_, options);
692 pipelines_->tiled_texture.CreateDefault(*context_, options,
693 {supports_decal});
694 pipelines_->gaussian_blur.CreateDefault(
695 *context_, options_no_msaa_no_depth_stencil, {supports_decal});
696 pipelines_->border_mask_blur.CreateDefault(*context_,
697 options_trianglestrip);
698 pipelines_->color_matrix_color_filter.CreateDefault(*context_,
699 options_trianglestrip);
700 pipelines_->vertices_uber_1_.CreateDefault(*context_, options,
701 {supports_decal});
702 pipelines_->vertices_uber_2_.CreateDefault(*context_, options,
703 {supports_decal});
704
705 const std::array<std::vector<Scalar>, 15> porter_duff_constants =
706 GetPorterDuffSpecConstants(supports_decal);
707 pipelines_->clear_blend.CreateDefault(*context_, options_trianglestrip,
708 porter_duff_constants[0]);
709 pipelines_->source_blend.CreateDefault(*context_, options_trianglestrip,
710 porter_duff_constants[1]);
711 pipelines_->destination_blend.CreateDefault(
712 *context_, options_trianglestrip, porter_duff_constants[2]);
713 pipelines_->source_over_blend.CreateDefault(
714 *context_, options_trianglestrip, porter_duff_constants[3]);
715 pipelines_->destination_over_blend.CreateDefault(
716 *context_, options_trianglestrip, porter_duff_constants[4]);
717 pipelines_->source_in_blend.CreateDefault(*context_, options_trianglestrip,
718 porter_duff_constants[5]);
719 pipelines_->destination_in_blend.CreateDefault(
720 *context_, options_trianglestrip, porter_duff_constants[6]);
721 pipelines_->source_out_blend.CreateDefault(*context_, options_trianglestrip,
722 porter_duff_constants[7]);
723 pipelines_->destination_out_blend.CreateDefault(
724 *context_, options_trianglestrip, porter_duff_constants[8]);
725 pipelines_->source_a_top_blend.CreateDefault(
726 *context_, options_trianglestrip, porter_duff_constants[9]);
727 pipelines_->destination_a_top_blend.CreateDefault(
728 *context_, options_trianglestrip, porter_duff_constants[10]);
729 pipelines_->xor_blend.CreateDefault(*context_, options_trianglestrip,
730 porter_duff_constants[11]);
731 pipelines_->plus_blend.CreateDefault(*context_, options_trianglestrip,
732 porter_duff_constants[12]);
733 pipelines_->modulate_blend.CreateDefault(*context_, options_trianglestrip,
734 porter_duff_constants[13]);
735 pipelines_->screen_blend.CreateDefault(*context_, options_trianglestrip,
736 porter_duff_constants[14]);
737 }
738
739 if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
740 pipelines_->framebuffer_blend_color.CreateDefault(
741 *context_, options_trianglestrip,
742 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
743 pipelines_->framebuffer_blend_colorburn.CreateDefault(
744 *context_, options_trianglestrip,
745 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
746 pipelines_->framebuffer_blend_colordodge.CreateDefault(
747 *context_, options_trianglestrip,
748 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
749 pipelines_->framebuffer_blend_darken.CreateDefault(
750 *context_, options_trianglestrip,
751 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
752 pipelines_->framebuffer_blend_difference.CreateDefault(
753 *context_, options_trianglestrip,
754 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
755 pipelines_->framebuffer_blend_exclusion.CreateDefault(
756 *context_, options_trianglestrip,
757 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
758 pipelines_->framebuffer_blend_hardlight.CreateDefault(
759 *context_, options_trianglestrip,
760 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
761 pipelines_->framebuffer_blend_hue.CreateDefault(
762 *context_, options_trianglestrip,
763 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
764 pipelines_->framebuffer_blend_lighten.CreateDefault(
765 *context_, options_trianglestrip,
766 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
767 pipelines_->framebuffer_blend_luminosity.CreateDefault(
768 *context_, options_trianglestrip,
769 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
770 pipelines_->framebuffer_blend_multiply.CreateDefault(
771 *context_, options_trianglestrip,
772 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
773 pipelines_->framebuffer_blend_overlay.CreateDefault(
774 *context_, options_trianglestrip,
775 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
776 pipelines_->framebuffer_blend_saturation.CreateDefault(
777 *context_, options_trianglestrip,
778 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
779 pipelines_->framebuffer_blend_screen.CreateDefault(
780 *context_, options_trianglestrip,
781 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
782 pipelines_->framebuffer_blend_softlight.CreateDefault(
783 *context_, options_trianglestrip,
784 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
785 } else {
786 pipelines_->blend_color.CreateDefault(
787 *context_, options_trianglestrip,
788 {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
789 pipelines_->blend_colorburn.CreateDefault(
790 *context_, options_trianglestrip,
791 {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
792 pipelines_->blend_colordodge.CreateDefault(
793 *context_, options_trianglestrip,
794 {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
795 pipelines_->blend_darken.CreateDefault(
796 *context_, options_trianglestrip,
797 {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
798 pipelines_->blend_difference.CreateDefault(
799 *context_, options_trianglestrip,
800 {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
801 pipelines_->blend_exclusion.CreateDefault(
802 *context_, options_trianglestrip,
803 {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
804 pipelines_->blend_hardlight.CreateDefault(
805 *context_, options_trianglestrip,
806 {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
807 pipelines_->blend_hue.CreateDefault(
808 *context_, options_trianglestrip,
809 {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
810 pipelines_->blend_lighten.CreateDefault(
811 *context_, options_trianglestrip,
812 {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
813 pipelines_->blend_luminosity.CreateDefault(
814 *context_, options_trianglestrip,
815 {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
816 pipelines_->blend_multiply.CreateDefault(
817 *context_, options_trianglestrip,
818 {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
819 pipelines_->blend_overlay.CreateDefault(
820 *context_, options_trianglestrip,
821 {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
822 pipelines_->blend_saturation.CreateDefault(
823 *context_, options_trianglestrip,
824 {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
825 pipelines_->blend_screen.CreateDefault(
826 *context_, options_trianglestrip,
827 {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
828 pipelines_->blend_softlight.CreateDefault(
829 *context_, options_trianglestrip,
830 {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
831 }
832
833 pipelines_->morphology_filter.CreateDefault(*context_, options_trianglestrip,
834 {supports_decal});
835 pipelines_->linear_to_srgb_filter.CreateDefault(*context_,
836 options_trianglestrip);
837 pipelines_->srgb_to_linear_filter.CreateDefault(*context_,
838 options_trianglestrip);
839 pipelines_->yuv_to_rgb_filter.CreateDefault(*context_, options_trianglestrip);
840
841 #if defined(IMPELLER_ENABLE_OPENGLES)
842 if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
843 #if !defined(FML_OS_MACOSX)
844 // GLES only shader that is unsupported on macOS.
845 pipelines_->tiled_texture_external.CreateDefault(*context_, options);
846 pipelines_->tiled_texture_uv_external.CreateDefault(*context_, options);
847 #endif // !defined(FML_OS_MACOSX)
848 pipelines_->texture_downsample_gles.CreateDefault(*context_,
849 options_trianglestrip);
850 }
851 #endif // IMPELLER_ENABLE_OPENGLES
852
853 is_valid_ = true;
854 InitializeCommonlyUsedShadersIfNeeded();
855 }
856
857 ContentContext::~ContentContext() = default;
858
859 bool ContentContext::IsValid() const {
860 return is_valid_;
861 }
862
863 std::shared_ptr<Texture> ContentContext::GetEmptyTexture() const {
864 return empty_texture_;
865 }
866
867 fml::StatusOr<RenderTarget> ContentContext::MakeSubpass(
868 std::string_view label,
869 ISize texture_size,
870 const std::shared_ptr<CommandBuffer>& command_buffer,
871 const SubpassCallback& subpass_callback,
872 bool msaa_enabled,
873 bool depth_stencil_enabled,
874 int32_t mip_count) const {
875 const std::shared_ptr<Context>& context = GetContext();
876 RenderTarget subpass_target;
877
878 std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
879 depth_stencil_enabled ? RenderTarget::kDefaultStencilAttachmentConfig
880 : std::optional<RenderTarget::AttachmentConfig>();
881
882 if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
883 subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
884 *context, texture_size,
885 /*mip_count=*/mip_count, label,
886 RenderTarget::kDefaultColorAttachmentConfigMSAA, depth_stencil_config);
887 } else {
888 subpass_target = GetRenderTargetCache()->CreateOffscreen(
889 *context, texture_size,
890 /*mip_count=*/mip_count, label,
891 RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
892 }
893 return MakeSubpass(label, subpass_target, command_buffer, subpass_callback);
894 }
895
896 fml::StatusOr<RenderTarget> ContentContext::MakeSubpass(
897 std::string_view label,
898 const RenderTarget& subpass_target,
899 const std::shared_ptr<CommandBuffer>& command_buffer,
900 const SubpassCallback& subpass_callback) const {
901 const std::shared_ptr<Context>& context = GetContext();
902
903 auto subpass_texture = subpass_target.GetRenderTargetTexture();
904 if (!subpass_texture) {
905 return fml::Status(fml::StatusCode::kUnknown, "");
906 }
907
908 auto sub_renderpass = command_buffer->CreateRenderPass(subpass_target);
909 if (!sub_renderpass) {
910 return fml::Status(fml::StatusCode::kUnknown, "");
911 }
912 sub_renderpass->SetLabel(label);
913
914 if (!subpass_callback(*this, *sub_renderpass)) {
915 return fml::Status(fml::StatusCode::kUnknown, "");
916 }
917
918 if (!sub_renderpass->EncodeCommands()) {
919 return fml::Status(fml::StatusCode::kUnknown, "");
920 }
921
922 const std::shared_ptr<Texture>& target_texture =
923 subpass_target.GetRenderTargetTexture();
924 if (target_texture->GetMipCount() > 1) {
925 fml::Status mipmap_status =
926 AddMipmapGeneration(command_buffer, context, target_texture);
927 if (!mipmap_status.ok()) {
928 return mipmap_status;
929 }
930 }
931
932 return subpass_target;
933 }
934
935 Tessellator& ContentContext::GetTessellator() const {
936 return *tessellator_;
937 }
938
939 std::shared_ptr<Context> ContentContext::GetContext() const {
940 return context_;
941 }
942
943 const Capabilities& ContentContext::GetDeviceCapabilities() const {
944 return *context_->GetCapabilities();
945 }
946
947 PipelineRef ContentContext::GetCachedRuntimeEffectPipeline(
948 const std::string& unique_entrypoint_name,
949 const ContentContextOptions& options,
950 const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
951 create_callback) const {
952 RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
953 auto it = runtime_effect_pipelines_.find(key);
954 if (it == runtime_effect_pipelines_.end()) {
955 it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
956 }
957 return raw_ptr(it->second);
958 }
959
960 void ContentContext::ClearCachedRuntimeEffectPipeline(
961 const std::string& unique_entrypoint_name) const {
962 #ifdef IMPELLER_DEBUG
963 // destroying in-use pipleines is a validation error.
964 const auto& idle_waiter = GetContext()->GetIdleWaiter();
965 if (idle_waiter) {
966 idle_waiter->WaitIdle();
967 }
968 #endif // IMPELLER_DEBUG
969 for (auto it = runtime_effect_pipelines_.begin();
970 it != runtime_effect_pipelines_.end();) {
971 if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
972 it = runtime_effect_pipelines_.erase(it);
973 } else {
974 it++;
975 }
976 }
977 }
978
979 void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
980 if (GetContext()->GetFlags().lazy_shader_mode) {
981 return;
982 }
983 GetContext()->InitializeCommonlyUsedShadersIfNeeded();
984 }
985
986 PipelineRef ContentContext::GetFastGradientPipeline(
987 ContentContextOptions opts) const {
988 return GetPipeline(this, pipelines_->fast_gradient, opts);
989 }
990
991 PipelineRef ContentContext::GetLinearGradientFillPipeline(
992 ContentContextOptions opts) const {
993 return GetPipeline(this, pipelines_->linear_gradient_fill, opts);
994 }
995
996 PipelineRef ContentContext::GetLinearGradientUniformFillPipeline(
997 ContentContextOptions opts) const {
998 return GetPipeline(this, pipelines_->linear_gradient_uniform_fill, opts);
999 }
1000
1001 PipelineRef ContentContext::GetRadialGradientUniformFillPipeline(
1002 ContentContextOptions opts) const {
1003 return GetPipeline(this, pipelines_->radial_gradient_uniform_fill, opts);
1004 }
1005
1006 PipelineRef ContentContext::GetSweepGradientUniformFillPipeline(
1007 ContentContextOptions opts) const {
1008 return GetPipeline(this, pipelines_->sweep_gradient_uniform_fill, opts);
1009 }
1010
1011 PipelineRef ContentContext::GetLinearGradientSSBOFillPipeline(
1012 ContentContextOptions opts) const {
1013 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1014 return GetPipeline(this, pipelines_->linear_gradient_ssbo_fill, opts);
1015 }
1016
1017 PipelineRef ContentContext::GetRadialGradientSSBOFillPipeline(
1018 ContentContextOptions opts) const {
1019 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1020 return GetPipeline(this, pipelines_->radial_gradient_ssbo_fill, opts);
1021 }
1022
1023 PipelineRef ContentContext::GetConicalGradientUniformFillPipeline(
1024 ContentContextOptions opts,
1025 ConicalKind kind) const {
1026 switch (kind) {
1027 case ConicalKind::kConical:
1028 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill, opts);
1029 case ConicalKind::kRadial:
1030 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_radial,
1031 opts);
1032 case ConicalKind::kStrip:
1033 return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_strip,
1034 opts);
1035 case ConicalKind::kStripAndRadial:
1036 return GetPipeline(
1037 this, pipelines_->conical_gradient_uniform_fill_strip_and_radial,
1038 opts);
1039 }
1040 }
1041
1042 PipelineRef ContentContext::GetConicalGradientSSBOFillPipeline(
1043 ContentContextOptions opts,
1044 ConicalKind kind) const {
1045 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1046 switch (kind) {
1047 case ConicalKind::kConical:
1048 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill, opts);
1049 case ConicalKind::kRadial:
1050 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_radial,
1051 opts);
1052 case ConicalKind::kStrip:
1053 return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_strip,
1054 opts);
1055 case ConicalKind::kStripAndRadial:
1056 return GetPipeline(
1057 this, pipelines_->conical_gradient_ssbo_fill_strip_and_radial, opts);
1058 }
1059 }
1060
1061 PipelineRef ContentContext::GetSweepGradientSSBOFillPipeline(
1062 ContentContextOptions opts) const {
1063 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1064 return GetPipeline(this, pipelines_->sweep_gradient_ssbo_fill, opts);
1065 }
1066
1067 PipelineRef ContentContext::GetRadialGradientFillPipeline(
1068 ContentContextOptions opts) const {
1069 return GetPipeline(this, pipelines_->radial_gradient_fill, opts);
1070 }
1071
1072 PipelineRef ContentContext::GetConicalGradientFillPipeline(
1073 ContentContextOptions opts,
1074 ConicalKind kind) const {
1075 switch (kind) {
1076 case ConicalKind::kConical:
1077 return GetPipeline(this, pipelines_->conical_gradient_fill, opts);
1078 case ConicalKind::kRadial:
1079 return GetPipeline(this, pipelines_->conical_gradient_fill_radial, opts);
1080 case ConicalKind::kStrip:
1081 return GetPipeline(this, pipelines_->conical_gradient_fill_strip, opts);
1082 case ConicalKind::kStripAndRadial:
1083 return GetPipeline(
1084 this, pipelines_->conical_gradient_fill_strip_and_radial, opts);
1085 }
1086 }
1087
1088 PipelineRef ContentContext::GetRRectBlurPipeline(
1089 ContentContextOptions opts) const {
1090 return GetPipeline(this, pipelines_->rrect_blur, opts);
1091 }
1092
1093 PipelineRef ContentContext::GetRSuperellipseBlurPipeline(
1094 ContentContextOptions opts) const {
1095 return GetPipeline(this, pipelines_->rsuperellipse_blur, opts);
1096 }
1097
1098 PipelineRef ContentContext::GetSweepGradientFillPipeline(
1099 ContentContextOptions opts) const {
1100 return GetPipeline(this, pipelines_->sweep_gradient_fill, opts);
1101 }
1102
1103 PipelineRef ContentContext::GetSolidFillPipeline(
1104 ContentContextOptions opts) const {
1105 return GetPipeline(this, pipelines_->solid_fill, opts);
1106 }
1107
1108 PipelineRef ContentContext::GetTexturePipeline(
1109 ContentContextOptions opts) const {
1110 return GetPipeline(this, pipelines_->texture, opts);
1111 }
1112
1113 PipelineRef ContentContext::GetTextureStrictSrcPipeline(
1114 ContentContextOptions opts) const {
1115 return GetPipeline(this, pipelines_->texture_strict_src, opts);
1116 }
1117
1118 PipelineRef ContentContext::GetTiledTexturePipeline(
1119 ContentContextOptions opts) const {
1120 return GetPipeline(this, pipelines_->tiled_texture, opts);
1121 }
1122
1123 PipelineRef ContentContext::GetGaussianBlurPipeline(
1124 ContentContextOptions opts) const {
1125 return GetPipeline(this, pipelines_->gaussian_blur, opts);
1126 }
1127
1128 PipelineRef ContentContext::GetBorderMaskBlurPipeline(
1129 ContentContextOptions opts) const {
1130 return GetPipeline(this, pipelines_->border_mask_blur, opts);
1131 }
1132
1133 PipelineRef ContentContext::GetMorphologyFilterPipeline(
1134 ContentContextOptions opts) const {
1135 return GetPipeline(this, pipelines_->morphology_filter, opts);
1136 }
1137
1138 PipelineRef ContentContext::GetColorMatrixColorFilterPipeline(
1139 ContentContextOptions opts) const {
1140 return GetPipeline(this, pipelines_->color_matrix_color_filter, opts);
1141 }
1142
1143 PipelineRef ContentContext::GetLinearToSrgbFilterPipeline(
1144 ContentContextOptions opts) const {
1145 return GetPipeline(this, pipelines_->linear_to_srgb_filter, opts);
1146 }
1147
1148 PipelineRef ContentContext::GetSrgbToLinearFilterPipeline(
1149 ContentContextOptions opts) const {
1150 return GetPipeline(this, pipelines_->srgb_to_linear_filter, opts);
1151 }
1152
1153 PipelineRef ContentContext::GetClipPipeline(ContentContextOptions opts) const {
1154 return GetPipeline(this, pipelines_->clip, opts);
1155 }
1156
1157 PipelineRef ContentContext::GetGlyphAtlasPipeline(
1158 ContentContextOptions opts) const {
1159 return GetPipeline(this, pipelines_->glyph_atlas, opts);
1160 }
1161
1162 PipelineRef ContentContext::GetYUVToRGBFilterPipeline(
1163 ContentContextOptions opts) const {
1164 return GetPipeline(this, pipelines_->yuv_to_rgb_filter, opts);
1165 }
1166
1167 PipelineRef ContentContext::GetPorterDuffPipeline(
1168 BlendMode mode,
1169 ContentContextOptions opts) const {
1170 switch (mode) {
1171 case BlendMode::kClear:
1172 return GetClearBlendPipeline(opts);
1173 case BlendMode::kSrc:
1174 return GetSourceBlendPipeline(opts);
1175 case BlendMode::kDst:
1176 return GetDestinationBlendPipeline(opts);
1177 case BlendMode::kSrcOver:
1178 return GetSourceOverBlendPipeline(opts);
1179 case BlendMode::kDstOver:
1180 return GetDestinationOverBlendPipeline(opts);
1181 case BlendMode::kSrcIn:
1182 return GetSourceInBlendPipeline(opts);
1183 case BlendMode::kDstIn:
1184 return GetDestinationInBlendPipeline(opts);
1185 case BlendMode::kSrcOut:
1186 return GetSourceOutBlendPipeline(opts);
1187 case BlendMode::kDstOut:
1188 return GetDestinationOutBlendPipeline(opts);
1189 case BlendMode::kSrcATop:
1190 return GetSourceATopBlendPipeline(opts);
1191 case BlendMode::kDstATop:
1192 return GetDestinationATopBlendPipeline(opts);
1193 case BlendMode::kXor:
1194 return GetXorBlendPipeline(opts);
1195 case BlendMode::kPlus:
1196 return GetPlusBlendPipeline(opts);
1197 case BlendMode::kModulate:
1198 return GetModulateBlendPipeline(opts);
1199 case BlendMode::kScreen:
1200 return GetScreenBlendPipeline(opts);
1201 case BlendMode::kOverlay:
1202 case BlendMode::kDarken:
1203 case BlendMode::kLighten:
1204 case BlendMode::kColorDodge:
1205 case BlendMode::kColorBurn:
1206 case BlendMode::kHardLight:
1207 case BlendMode::kSoftLight:
1208 case BlendMode::kDifference:
1209 case BlendMode::kExclusion:
1210 case BlendMode::kMultiply:
1211 case BlendMode::kHue:
1212 case BlendMode::kSaturation:
1213 case BlendMode::kColor:
1214 case BlendMode::kLuminosity:
1215 VALIDATION_LOG << "Invalid porter duff blend mode "
1216 << BlendModeToString(mode);
1217 return GetClearBlendPipeline(opts);
1218 break;
1219 }
1220 }
1221
1222 PipelineRef ContentContext::GetClearBlendPipeline(
1223 ContentContextOptions opts) const {
1224 return GetPipeline(this, pipelines_->clear_blend, opts);
1225 }
1226
1227 PipelineRef ContentContext::GetSourceBlendPipeline(
1228 ContentContextOptions opts) const {
1229 return GetPipeline(this, pipelines_->source_blend, opts);
1230 }
1231
1232 PipelineRef ContentContext::GetDestinationBlendPipeline(
1233 ContentContextOptions opts) const {
1234 return GetPipeline(this, pipelines_->destination_blend, opts);
1235 }
1236
1237 PipelineRef ContentContext::GetSourceOverBlendPipeline(
1238 ContentContextOptions opts) const {
1239 return GetPipeline(this, pipelines_->source_over_blend, opts);
1240 }
1241
1242 PipelineRef ContentContext::GetDestinationOverBlendPipeline(
1243 ContentContextOptions opts) const {
1244 return GetPipeline(this, pipelines_->destination_over_blend, opts);
1245 }
1246
1247 PipelineRef ContentContext::GetSourceInBlendPipeline(
1248 ContentContextOptions opts) const {
1249 return GetPipeline(this, pipelines_->source_in_blend, opts);
1250 }
1251
1252 PipelineRef ContentContext::GetDestinationInBlendPipeline(
1253 ContentContextOptions opts) const {
1254 return GetPipeline(this, pipelines_->destination_in_blend, opts);
1255 }
1256
1257 PipelineRef ContentContext::GetSourceOutBlendPipeline(
1258 ContentContextOptions opts) const {
1259 return GetPipeline(this, pipelines_->source_out_blend, opts);
1260 }
1261
1262 PipelineRef ContentContext::GetDestinationOutBlendPipeline(
1263 ContentContextOptions opts) const {
1264 return GetPipeline(this, pipelines_->destination_out_blend, opts);
1265 }
1266
1267 PipelineRef ContentContext::GetSourceATopBlendPipeline(
1268 ContentContextOptions opts) const {
1269 return GetPipeline(this, pipelines_->source_a_top_blend, opts);
1270 }
1271
1272 PipelineRef ContentContext::GetDestinationATopBlendPipeline(
1273 ContentContextOptions opts) const {
1274 return GetPipeline(this, pipelines_->destination_a_top_blend, opts);
1275 }
1276
1277 PipelineRef ContentContext::GetXorBlendPipeline(
1278 ContentContextOptions opts) const {
1279 return GetPipeline(this, pipelines_->xor_blend, opts);
1280 }
1281
1282 PipelineRef ContentContext::GetPlusBlendPipeline(
1283 ContentContextOptions opts) const {
1284 return GetPipeline(this, pipelines_->plus_blend, opts);
1285 }
1286
1287 PipelineRef ContentContext::GetModulateBlendPipeline(
1288 ContentContextOptions opts) const {
1289 return GetPipeline(this, pipelines_->modulate_blend, opts);
1290 }
1291
1292 PipelineRef ContentContext::GetScreenBlendPipeline(
1293 ContentContextOptions opts) const {
1294 return GetPipeline(this, pipelines_->screen_blend, opts);
1295 }
1296
1297 PipelineRef ContentContext::GetBlendColorPipeline(
1298 ContentContextOptions opts) const {
1299 return GetPipeline(this, pipelines_->blend_color, opts);
1300 }
1301
1302 PipelineRef ContentContext::GetBlendColorBurnPipeline(
1303 ContentContextOptions opts) const {
1304 return GetPipeline(this, pipelines_->blend_colorburn, opts);
1305 }
1306
1307 PipelineRef ContentContext::GetBlendColorDodgePipeline(
1308 ContentContextOptions opts) const {
1309 return GetPipeline(this, pipelines_->blend_colordodge, opts);
1310 }
1311
1312 PipelineRef ContentContext::GetBlendDarkenPipeline(
1313 ContentContextOptions opts) const {
1314 return GetPipeline(this, pipelines_->blend_darken, opts);
1315 }
1316
1317 PipelineRef ContentContext::GetBlendDifferencePipeline(
1318 ContentContextOptions opts) const {
1319 return GetPipeline(this, pipelines_->blend_difference, opts);
1320 }
1321
1322 PipelineRef ContentContext::GetBlendExclusionPipeline(
1323 ContentContextOptions opts) const {
1324 return GetPipeline(this, pipelines_->blend_exclusion, opts);
1325 }
1326
1327 PipelineRef ContentContext::GetBlendHardLightPipeline(
1328 ContentContextOptions opts) const {
1329 return GetPipeline(this, pipelines_->blend_hardlight, opts);
1330 }
1331
1332 PipelineRef ContentContext::GetBlendHuePipeline(
1333 ContentContextOptions opts) const {
1334 return GetPipeline(this, pipelines_->blend_hue, opts);
1335 }
1336
1337 PipelineRef ContentContext::GetBlendLightenPipeline(
1338 ContentContextOptions opts) const {
1339 return GetPipeline(this, pipelines_->blend_lighten, opts);
1340 }
1341
1342 PipelineRef ContentContext::GetBlendLuminosityPipeline(
1343 ContentContextOptions opts) const {
1344 return GetPipeline(this, pipelines_->blend_luminosity, opts);
1345 }
1346
1347 PipelineRef ContentContext::GetBlendMultiplyPipeline(
1348 ContentContextOptions opts) const {
1349 return GetPipeline(this, pipelines_->blend_multiply, opts);
1350 }
1351
1352 PipelineRef ContentContext::GetBlendOverlayPipeline(
1353 ContentContextOptions opts) const {
1354 return GetPipeline(this, pipelines_->blend_overlay, opts);
1355 }
1356
1357 PipelineRef ContentContext::GetBlendSaturationPipeline(
1358 ContentContextOptions opts) const {
1359 return GetPipeline(this, pipelines_->blend_saturation, opts);
1360 }
1361
1362 PipelineRef ContentContext::GetBlendScreenPipeline(
1363 ContentContextOptions opts) const {
1364 return GetPipeline(this, pipelines_->blend_screen, opts);
1365 }
1366
1367 PipelineRef ContentContext::GetBlendSoftLightPipeline(
1368 ContentContextOptions opts) const {
1369 return GetPipeline(this, pipelines_->blend_softlight, opts);
1370 }
1371
1372 PipelineRef ContentContext::GetDownsamplePipeline(
1373 ContentContextOptions opts) const {
1374 return GetPipeline(this, pipelines_->texture_downsample, opts);
1375 }
1376
1377 PipelineRef ContentContext::GetFramebufferBlendColorPipeline(
1378 ContentContextOptions opts) const {
1379 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1380 return GetPipeline(this, pipelines_->framebuffer_blend_color, opts);
1381 }
1382
1383 PipelineRef ContentContext::GetFramebufferBlendColorBurnPipeline(
1384 ContentContextOptions opts) const {
1385 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1386 return GetPipeline(this, pipelines_->framebuffer_blend_colorburn, opts);
1387 }
1388
1389 PipelineRef ContentContext::GetFramebufferBlendColorDodgePipeline(
1390 ContentContextOptions opts) const {
1391 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1392 return GetPipeline(this, pipelines_->framebuffer_blend_colordodge, opts);
1393 }
1394
1395 PipelineRef ContentContext::GetFramebufferBlendDarkenPipeline(
1396 ContentContextOptions opts) const {
1397 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1398 return GetPipeline(this, pipelines_->framebuffer_blend_darken, opts);
1399 }
1400
1401 PipelineRef ContentContext::GetFramebufferBlendDifferencePipeline(
1402 ContentContextOptions opts) const {
1403 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1404 return GetPipeline(this, pipelines_->framebuffer_blend_difference, opts);
1405 }
1406
1407 PipelineRef ContentContext::GetFramebufferBlendExclusionPipeline(
1408 ContentContextOptions opts) const {
1409 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1410 return GetPipeline(this, pipelines_->framebuffer_blend_exclusion, opts);
1411 }
1412
1413 PipelineRef ContentContext::GetFramebufferBlendHardLightPipeline(
1414 ContentContextOptions opts) const {
1415 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1416 return GetPipeline(this, pipelines_->framebuffer_blend_hardlight, opts);
1417 }
1418
1419 PipelineRef ContentContext::GetFramebufferBlendHuePipeline(
1420 ContentContextOptions opts) const {
1421 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1422 return GetPipeline(this, pipelines_->framebuffer_blend_hue, opts);
1423 }
1424
1425 PipelineRef ContentContext::GetFramebufferBlendLightenPipeline(
1426 ContentContextOptions opts) const {
1427 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1428 return GetPipeline(this, pipelines_->framebuffer_blend_lighten, opts);
1429 }
1430
1431 PipelineRef ContentContext::GetFramebufferBlendLuminosityPipeline(
1432 ContentContextOptions opts) const {
1433 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1434 return GetPipeline(this, pipelines_->framebuffer_blend_luminosity, opts);
1435 }
1436
1437 PipelineRef ContentContext::GetFramebufferBlendMultiplyPipeline(
1438 ContentContextOptions opts) const {
1439 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1440 return GetPipeline(this, pipelines_->framebuffer_blend_multiply, opts);
1441 }
1442
1443 PipelineRef ContentContext::GetFramebufferBlendOverlayPipeline(
1444 ContentContextOptions opts) const {
1445 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1446 return GetPipeline(this, pipelines_->framebuffer_blend_overlay, opts);
1447 }
1448
1449 PipelineRef ContentContext::GetFramebufferBlendSaturationPipeline(
1450 ContentContextOptions opts) const {
1451 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1452 return GetPipeline(this, pipelines_->framebuffer_blend_saturation, opts);
1453 }
1454
1455 PipelineRef ContentContext::GetFramebufferBlendScreenPipeline(
1456 ContentContextOptions opts) const {
1457 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1458 return GetPipeline(this, pipelines_->framebuffer_blend_screen, opts);
1459 }
1460
1461 PipelineRef ContentContext::GetFramebufferBlendSoftLightPipeline(
1462 ContentContextOptions opts) const {
1463 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1464 return GetPipeline(this, pipelines_->framebuffer_blend_softlight, opts);
1465 }
1466
1467 PipelineRef ContentContext::GetDrawVerticesUberPipeline(
1468 BlendMode blend_mode,
1469 ContentContextOptions opts) const {
1470 if (blend_mode <= BlendMode::kHardLight) {
1471 return GetPipeline(this, pipelines_->vertices_uber_1_, opts);
1472 } else {
1473 return GetPipeline(this, pipelines_->vertices_uber_2_, opts);
1474 }
1475 }
1476
1477 PipelineRef ContentContext::GetLinePipeline(ContentContextOptions opts) const {
1478 return GetPipeline(this, pipelines_->line, opts);
1479 }
1480
1481 #ifdef IMPELLER_ENABLE_OPENGLES
1482 PipelineRef ContentContext::GetDownsampleTextureGlesPipeline(
1483 ContentContextOptions opts) const {
1484 return GetPipeline(this, pipelines_->texture_downsample_gles, opts);
1485 }
1486
1487 PipelineRef ContentContext::GetTiledTextureExternalPipeline(
1488 ContentContextOptions opts) const {
1489 FML_DCHECK(GetContext()->GetBackendType() == Context::BackendType::kOpenGLES);
1490 return GetPipeline(this, pipelines_->tiled_texture_external, opts);
1491 }
1492
1493 PipelineRef ContentContext::GetTiledTextureUvExternalPipeline(
1494 ContentContextOptions opts) const {
1495 FML_DCHECK(GetContext()->GetBackendType() == Context::BackendType::kOpenGLES);
1496 return GetPipeline(this, pipelines_->tiled_texture_uv_external, opts);
1497 }
1498 #endif // IMPELLER_ENABLE_OPENGLES
1499
1500 } // namespace impeller
buffer_view
BufferView buffer_view
Definition: blit_command_gles.cc:154
impeller::Capabilities
Definition: capabilities.h:14
impeller::ContentContext::GetBlendLuminosityPipeline
PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1342
impeller::ContentContext::GetTransientsBuffer
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
Definition: content_context.h:297
impeller::ContentContext::~ContentContext
~ContentContext()
impeller::ContentContext::GetTiledTexturePipeline
PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1118
impeller::ContentContext::GetFramebufferBlendColorPipeline
PipelineRef GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1377
impeller::ContentContext::GetDownsamplePipeline
PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1372
impeller::ContentContext::GetSourceInBlendPipeline
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1247
impeller::ContentContext::ClearCachedRuntimeEffectPipeline
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
Definition: content_context.cc:960
impeller::ContentContext::GetLinearGradientFillPipeline
PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:991
impeller::ContentContext::GetFramebufferBlendOverlayPipeline
PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1443
impeller::ContentContext::GetBlendColorDodgePipeline
PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1307
impeller::ContentContext::GetFramebufferBlendColorBurnPipeline
PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1383
impeller::ContentContext::GetPorterDuffPipeline
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
Definition: content_context.cc:1167
impeller::ContentContext::GetEmptyTexture
std::shared_ptr< Texture > GetEmptyTexture() const
Definition: content_context.cc:863
impeller::ContentContext::GetSourceOutBlendPipeline
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1257
impeller::ContentContext::GetScreenBlendPipeline
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1292
impeller::ContentContext::GetBlendColorPipeline
PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1297
impeller::ContentContext::GetLinePipeline
PipelineRef GetLinePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1477
impeller::ContentContext::GetFramebufferBlendLuminosityPipeline
PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1431
impeller::ContentContext::GetPlusBlendPipeline
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1282
impeller::ContentContext::GetFastGradientPipeline
PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const
Definition: content_context.cc:986
impeller::ContentContext::ContentContext
ContentContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
Definition: content_context.cc:544
impeller::ContentContext::GetSolidFillPipeline
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1103
impeller::ContentContext::MakeSubpass
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...
Definition: content_context.cc:867
impeller::ContentContext::GetDeviceCapabilities
const Capabilities & GetDeviceCapabilities() const
Definition: content_context.cc:943
impeller::ContentContext::GetModulateBlendPipeline
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1287
impeller::ContentContext::GetFramebufferBlendHardLightPipeline
PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1413
impeller::ContentContext::GetFramebufferBlendColorDodgePipeline
PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1389
impeller::ContentContext::GetSweepGradientUniformFillPipeline
PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1006
impeller::ContentContext::GetBlendSoftLightPipeline
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1367
impeller::ContentContext::GetDestinationATopBlendPipeline
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1272
impeller::ContentContext::GetTextureStrictSrcPipeline
PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1113
impeller::ContentContext::GetCachedRuntimeEffectPipeline
PipelineRef GetCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor >>()> &create_callback) const
Definition: content_context.cc:947
impeller::ContentContext::GetRadialGradientSSBOFillPipeline
PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1017
impeller::ContentContext::GetBlendColorBurnPipeline
PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1302
impeller::ContentContext::GetSweepGradientSSBOFillPipeline
PipelineRef GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1061
impeller::ContentContext::GetLinearGradientUniformFillPipeline
PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:996
impeller::ContentContext::GetFramebufferBlendScreenPipeline
PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1455
impeller::ContentContext::GetLinearGradientSSBOFillPipeline
PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1011
impeller::ContentContext::GetRadialGradientFillPipeline
PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1067
impeller::ContentContext::GetTexturePipeline
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1108
impeller::ContentContext::GetBlendHardLightPipeline
PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1327
impeller::ContentContext::GetClearBlendPipeline
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1222
impeller::ContentContext::GetConicalGradientUniformFillPipeline
PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1023
impeller::ContentContext::GetRadialGradientUniformFillPipeline
PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1001
impeller::ContentContext::GetSweepGradientFillPipeline
PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1098
impeller::ContentContext::GetFramebufferBlendExclusionPipeline
PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1407
impeller::ContentContext::GetFramebufferBlendDarkenPipeline
PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1395
impeller::ContentContext::GetBlendSaturationPipeline
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1357
impeller::ContentContext::GetFramebufferBlendSoftLightPipeline
PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1461
impeller::ContentContext::GetFramebufferBlendLightenPipeline
PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1425
impeller::ContentContext::GetMorphologyFilterPipeline
PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1133
impeller::ContentContext::GetFramebufferBlendSaturationPipeline
PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1449
impeller::ContentContext::GetBlendDifferencePipeline
PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1317
impeller::ContentContext::GetGaussianBlurPipeline
PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1123
impeller::ContentContext::GetBlendHuePipeline
PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1332
impeller::ContentContext::GetSrgbToLinearFilterPipeline
PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1148
impeller::ContentContext::GetDestinationOutBlendPipeline
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1262
impeller::ContentContext::GetYUVToRGBFilterPipeline
PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1162
impeller::ContentContext::GetFramebufferBlendDifferencePipeline
PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1401
impeller::ContentContext::GetFramebufferBlendHuePipeline
PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1419
impeller::ContentContext::GetSourceATopBlendPipeline
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1267
impeller::ContentContext::GetXorBlendPipeline
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1277
impeller::ContentContext::GetGlyphAtlasPipeline
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1157
impeller::ContentContext::GetClipPipeline
PipelineRef GetClipPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1153
impeller::ContentContext::GetRenderTargetCache
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
Definition: content_context.h:269
impeller::ContentContext::IsValid
bool IsValid() const
Definition: content_context.cc:859
impeller::ContentContext::GetRRectBlurPipeline
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1088
impeller::ContentContext::GetBlendScreenPipeline
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1362
impeller::ContentContext::SubpassCallback
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
Definition: content_context.h:245
impeller::ContentContext::GetBlendDarkenPipeline
PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1312
impeller::ContentContext::GetSourceBlendPipeline
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1227
impeller::ContentContext::GetLinearToSrgbFilterPipeline
PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1143
impeller::ContentContext::GetBlendOverlayPipeline
PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1352
impeller::ContentContext::GetDestinationBlendPipeline
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1232
impeller::ContentContext::GetDestinationOverBlendPipeline
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1242
impeller::ContentContext::GetFramebufferBlendMultiplyPipeline
PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1437
impeller::ContentContext::GetConicalGradientSSBOFillPipeline
PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1042
impeller::ContentContext::GetTessellator
Tessellator & GetTessellator() const
Definition: content_context.cc:935
impeller::ContentContext::GetBlendLightenPipeline
PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1337
impeller::ContentContext::GetBlendMultiplyPipeline
PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1347
impeller::ContentContext::GetSourceOverBlendPipeline
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1237
impeller::ContentContext::GetBlendExclusionPipeline
PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1322
impeller::ContentContext::GetColorMatrixColorFilterPipeline
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1138
impeller::ContentContext::GetConicalGradientFillPipeline
PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1072
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:939
impeller::ContentContext::GetDestinationInBlendPipeline
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1252
impeller::ContentContext::GetRSuperellipseBlurPipeline
PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1093
impeller::ContentContext::GetBorderMaskBlurPipeline
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1128
impeller::ContentContext::GetDrawVerticesUberPipeline
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
Definition: content_context.cc:1467
impeller::Context
To do anything rendering related with Impeller, you need a context.
Definition: context.h:65
impeller::Context::GetCapabilities
virtual const std::shared_ptr< const Capabilities > & GetCapabilities() const =0
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
impeller::Context::BackendType::kOpenGLES
@ kOpenGLES
impeller::Entity::kLastPipelineBlendMode
static constexpr BlendMode kLastPipelineBlendMode
Definition: entity.h:28
impeller::HostBuffer
Definition: host_buffer.h:26
impeller::HostBuffer::Emplace
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
impeller::LazyGlyphAtlas
Definition: lazy_glyph_atlas.h:16
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:24
impeller::PipelineDescriptor::SetDepthStencilAttachmentDescriptor
PipelineDescriptor & SetDepthStencilAttachmentDescriptor(std::optional< DepthAttachmentDescriptor > desc)
Definition: pipeline_descriptor.cc:151
impeller::PipelineDescriptor::ClearStencilAttachments
void ClearStencilAttachments()
Definition: pipeline_descriptor.cc:170
impeller::PipelineDescriptor::SetPolygonMode
void SetPolygonMode(PolygonMode mode)
Definition: pipeline_descriptor.cc:276
impeller::PipelineDescriptor::GetDepthStencilAttachmentDescriptor
std::optional< DepthAttachmentDescriptor > GetDepthStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:207
impeller::PipelineDescriptor::SetStencilAttachmentDescriptors
PipelineDescriptor & SetStencilAttachmentDescriptors(std::optional< StencilAttachmentDescriptor > front_and_back)
Definition: pipeline_descriptor.cc:157
impeller::PipelineDescriptor::GetColorAttachmentDescriptor
const ColorAttachmentDescriptor * GetColorAttachmentDescriptor(size_t index) const
Definition: pipeline_descriptor.cc:124
impeller::PipelineDescriptor::SetColorAttachmentDescriptor
PipelineDescriptor & SetColorAttachmentDescriptor(size_t index, ColorAttachmentDescriptor desc)
Definition: pipeline_descriptor.cc:110
impeller::PipelineDescriptor::SetSampleCount
PipelineDescriptor & SetSampleCount(SampleCount samples)
Definition: pipeline_descriptor.cc:76
impeller::PipelineDescriptor::SetPrimitiveType
void SetPrimitiveType(PrimitiveType type)
Definition: pipeline_descriptor.cc:268
impeller::PipelineDescriptor::ClearDepthAttachment
void ClearDepthAttachment()
Definition: pipeline_descriptor.cc:176
impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor
std::optional< StencilAttachmentDescriptor > GetFrontStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:202
impeller::Pipeline< PipelineDescriptor >
impeller::RenderTargetCache
An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame...
Definition: render_target_cache.h:18
impeller::RenderTarget
Definition: render_target.h:38
impeller::RenderTarget::GetRenderTargetTexture
std::shared_ptr< Texture > GetRenderTargetTexture() const
Definition: render_target.cc:176
impeller::RenderTarget::kDefaultColorAttachmentConfig
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
Definition: render_target.h:55
impeller::RenderTarget::kDefaultColorAttachmentConfigMSAA
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
Definition: render_target.h:61
impeller::RenderTarget::kDefaultStencilAttachmentConfig
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
Definition: render_target.h:68
impeller::Tessellator
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
Definition: tessellator.h:37
impeller::TextShadowCache
A cache for blurred text that re-uses these across frames.
Definition: text_shadow_cache.h:31
impeller::raw_ptr< Pipeline< PipelineDescriptor > >
command_buffer.h
desc_
std::optional< PipelineDescriptor > desc_
Definition: content_context.cc:75
pipelines_
std::vector< std::pair< uint64_t, std::unique_ptr< GenericRenderPipelineHandle > > > pipelines_
Definition: content_context.cc:78
default_options_
std::optional< ContentContextOptions > default_options_
Definition: content_context.cc:76
content_context.h
formats.h
x
int32_t x
Definition: dl_golden_unittests.cc:458
entity.h
framebuffer_blend_contents.h
impeller::interop::Create
ScopedObject< Object > Create(CtorArgs &&... args)
Definition: object.h:161
impeller
Definition: allocation.cc:12
impeller::BlendFactor::kDestinationColor
@ kDestinationColor
impeller::BlendFactor::kOne
@ kOne
impeller::BlendFactor::kSourceColor
@ kSourceColor
impeller::BlendFactor::kZero
@ kZero
impeller::BlendFactor::kDestinationAlpha
@ kDestinationAlpha
impeller::BlendFactor::kSourceAlpha
@ kSourceAlpha
impeller::BlendFactor::kOneMinusDestinationAlpha
@ kOneMinusDestinationAlpha
impeller::BlendFactor::kOneMinusSourceAlpha
@ kOneMinusSourceAlpha
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::ConicalKind
ConicalKind
Definition: content_context.h:128
impeller::kStripAndRadial
@ kStripAndRadial
Definition: content_context.h:132
impeller::kStrip
@ kStrip
Definition: content_context.h:131
impeller::kConical
@ kConical
Definition: content_context.h:129
impeller::kRadial
@ kRadial
Definition: content_context.h:130
impeller::CreateDefaultPipeline
static std::unique_ptr< PipelineT > CreateDefaultPipeline(const Context &context)
Definition: content_context.cc:528
impeller::StorageMode::kDevicePrivate
@ kDevicePrivate
impeller::PipelineRef
raw_ptr< Pipeline< PipelineDescriptor > > PipelineRef
A raw ptr to a pipeline object.
Definition: pipeline.h:88
impeller::BlendModeToString
const char * BlendModeToString(BlendMode blend_mode)
Definition: color.cc:47
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.
impeller::CompareFunction::kNotEqual
@ kNotEqual
Comparison test passes if new_value != current_value.
impeller::AddMipmapGeneration
fml::Status AddMipmapGeneration(const std::shared_ptr< CommandBuffer > &command_buffer, const std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
Adds a blit command to the render pass.
Definition: texture_util.cc:37
impeller::StencilOperation::kDecrementWrap
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
impeller::StencilOperation::kSetToReferenceValue
@ kSetToReferenceValue
Reset the stencil value to the reference value.
impeller::StencilOperation::kIncrementClamp
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
impeller::StencilOperation::kIncrementWrap
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::BlendMode
BlendMode
Definition: color.h:58
impeller::BlendMode::kSrcOut
@ kSrcOut
impeller::BlendMode::kExclusion
@ kExclusion
impeller::BlendMode::kSaturation
@ kSaturation
impeller::BlendMode::kColorBurn
@ kColorBurn
impeller::BlendMode::kPlus
@ kPlus
impeller::BlendMode::kLighten
@ kLighten
impeller::BlendMode::kHue
@ kHue
impeller::BlendMode::kDst
@ kDst
impeller::BlendMode::kDstIn
@ kDstIn
impeller::BlendMode::kModulate
@ kModulate
impeller::BlendMode::kMultiply
@ kMultiply
impeller::BlendMode::kColorDodge
@ kColorDodge
impeller::BlendMode::kScreen
@ kScreen
impeller::BlendMode::kSrcOver
@ kSrcOver
impeller::BlendMode::kXor
@ kXor
impeller::BlendMode::kSrc
@ kSrc
impeller::BlendMode::kLuminosity
@ kLuminosity
impeller::BlendMode::kSoftLight
@ kSoftLight
impeller::BlendMode::kDifference
@ kDifference
impeller::BlendMode::kOverlay
@ kOverlay
impeller::BlendMode::kSrcATop
@ kSrcATop
impeller::BlendMode::kDstATop
@ kDstATop
impeller::BlendMode::kDstOver
@ kDstOver
impeller::BlendMode::kColor
@ kColor
impeller::BlendMode::kHardLight
@ kHardLight
impeller::BlendMode::kDstOut
@ kDstOut
impeller::BlendMode::kDarken
@ kDarken
impeller::BlendMode::kSrcIn
@ kSrcIn
impeller::BlendMode::kClear
@ kClear
impeller::GetPorterDuffSpecConstants
std::array< std::vector< Scalar >, 15 > GetPorterDuffSpecConstants(bool supports_decal)
Definition: content_context.cc:505
impeller::PolygonMode::kFill
@ kFill
impeller::ColorWriteMaskBits::kAll
@ kAll
impeller::ColorWriteMaskBits::kNone
@ kNone
impeller::BlendOperation::kAdd
@ kAdd
impeller::BlendOperation::kReverseSubtract
@ kReverseSubtract
impeller::SampleCount::kCount4
@ kCount4
impeller::SampleCount::kCount1
@ kCount1
impeller::BlendSelectValues::kExclusion
@ kExclusion
impeller::BlendSelectValues::kSaturation
@ kSaturation
impeller::BlendSelectValues::kColorBurn
@ kColorBurn
impeller::BlendSelectValues::kLighten
@ kLighten
impeller::BlendSelectValues::kHue
@ kHue
impeller::BlendSelectValues::kMultiply
@ kMultiply
impeller::BlendSelectValues::kColorDodge
@ kColorDodge
impeller::BlendSelectValues::kScreen
@ kScreen
impeller::BlendSelectValues::kLuminosity
@ kLuminosity
impeller::BlendSelectValues::kSoftLight
@ kSoftLight
impeller::BlendSelectValues::kDifference
@ kDifference
impeller::BlendSelectValues::kOverlay
@ kOverlay
impeller::BlendSelectValues::kColor
@ kColor
impeller::BlendSelectValues::kHardLight
@ kHardLight
impeller::BlendSelectValues::kDarken
@ kDarken
std
Definition: comparable.h:95
pipeline_descriptor.h
pipeline_library.h
pipelines.h
render_target.h
render_target_cache.h
impeller::BufferView
Definition: buffer_view.h:19
impeller::ColorAttachmentDescriptor
Describe the color attachment that will be used with this pipeline.
Definition: formats.h:518
impeller::ColorAttachmentDescriptor::blending_enabled
bool blending_enabled
Definition: formats.h:520
impeller::ColorAttachmentDescriptor::color_blend_op
BlendOperation color_blend_op
Definition: formats.h:523
impeller::ColorAttachmentDescriptor::format
PixelFormat format
Definition: formats.h:519
impeller::ColorAttachmentDescriptor::dst_color_blend_factor
BlendFactor dst_color_blend_factor
Definition: formats.h:524
impeller::ColorAttachmentDescriptor::write_mask
ColorWriteMask write_mask
Definition: formats.h:530
impeller::ColorAttachmentDescriptor::src_alpha_blend_factor
BlendFactor src_alpha_blend_factor
Definition: formats.h:526
impeller::ColorAttachmentDescriptor::alpha_blend_op
BlendOperation alpha_blend_op
Definition: formats.h:527
impeller::ColorAttachmentDescriptor::src_color_blend_factor
BlendFactor src_color_blend_factor
Definition: formats.h:522
impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor
BlendFactor dst_alpha_blend_factor
Definition: formats.h:528
impeller::Color::ToR8G8B8A8
std::array< uint8_t, 4 > ToR8G8B8A8() const
Convert to R8G8B8A8 representation.
Definition: color.h:246
impeller::Color::BlackTransparent
static constexpr Color BlackTransparent()
Definition: color.h:270
impeller::ContentContext::Pipelines
Definition: content_context.cc:213
impeller::ContentContext::Pipelines::solid_fill
Variants< SolidFillPipeline > solid_fill
Definition: content_context.cc:289
impeller::ContentContext::Pipelines::destination_blend
Variants< PorterDuffBlendPipeline > destination_blend
Definition: content_context.cc:271
impeller::ContentContext::Pipelines::sweep_gradient_ssbo_fill
Variants< SweepGradientSSBOFillPipeline > sweep_gradient_ssbo_fill
Definition: content_context.cc:292
impeller::ContentContext::Pipelines::blend_screen
Variants< BlendScreenPipeline > blend_screen
Definition: content_context.cc:228
impeller::ContentContext::Pipelines::modulate_blend
Variants< PorterDuffBlendPipeline > modulate_blend
Definition: content_context.cc:275
impeller::ContentContext::Pipelines::framebuffer_blend_overlay
Variants< FramebufferBlendOverlayPipeline > framebuffer_blend_overlay
Definition: content_context.cc:257
impeller::ContentContext::Pipelines::blend_saturation
Variants< BlendSaturationPipeline > blend_saturation
Definition: content_context.cc:227
impeller::ContentContext::Pipelines::tiled_texture
Variants< TiledTexturePipeline > tiled_texture
Definition: content_context.cc:297
impeller::ContentContext::Pipelines::destination_in_blend
Variants< PorterDuffBlendPipeline > destination_in_blend
Definition: content_context.cc:272
impeller::ContentContext::Pipelines::blend_softlight
Variants< BlendSoftLightPipeline > blend_softlight
Definition: content_context.cc:229
impeller::ContentContext::Pipelines::blend_colordodge
Variants< BlendColorDodgePipeline > blend_colordodge
Definition: content_context.cc:216
impeller::ContentContext::Pipelines::blend_multiply
Variants< BlendMultiplyPipeline > blend_multiply
Definition: content_context.cc:225
impeller::ContentContext::Pipelines::blend_color
Variants< BlendColorPipeline > blend_color
Definition: content_context.cc:217
impeller::ContentContext::Pipelines::blend_difference
Variants< BlendDifferencePipeline > blend_difference
Definition: content_context.cc:219
impeller::ContentContext::Pipelines::blend_overlay
Variants< BlendOverlayPipeline > blend_overlay
Definition: content_context.cc:226
impeller::ContentContext::Pipelines::conical_gradient_fill_strip
Variants< ConicalGradientFillStripPipeline > conical_gradient_fill_strip
Definition: content_context.cc:235
impeller::ContentContext::Pipelines::framebuffer_blend_exclusion
Variants< FramebufferBlendExclusionPipeline > framebuffer_blend_exclusion
Definition: content_context.cc:251
impeller::ContentContext::Pipelines::morphology_filter
Variants< MorphologyFilterPipeline > morphology_filter
Definition: content_context.cc:268
impeller::ContentContext::Pipelines::screen_blend
Variants< PorterDuffBlendPipeline > screen_blend
Definition: content_context.cc:277
impeller::ContentContext::Pipelines::framebuffer_blend_saturation
Variants< FramebufferBlendSaturationPipeline > framebuffer_blend_saturation
Definition: content_context.cc:258
impeller::ContentContext::Pipelines::source_over_blend
Variants< PorterDuffBlendPipeline > source_over_blend
Definition: content_context.cc:282
impeller::ContentContext::Pipelines::linear_gradient_fill
Variants< LinearGradientFillPipeline > linear_gradient_fill
Definition: content_context.cc:264
impeller::ContentContext::Pipelines::plus_blend
Variants< PorterDuffBlendPipeline > plus_blend
Definition: content_context.cc:276
impeller::ContentContext::Pipelines::vertices_uber_2_
Variants< VerticesUber2Shader > vertices_uber_2_
Definition: content_context.cc:299
impeller::ContentContext::Pipelines::framebuffer_blend_hardlight
Variants< FramebufferBlendHardLightPipeline > framebuffer_blend_hardlight
Definition: content_context.cc:252
impeller::ContentContext::Pipelines::radial_gradient_ssbo_fill
Variants< RadialGradientSSBOFillPipeline > radial_gradient_ssbo_fill
Definition: content_context.cc:285
impeller::ContentContext::Pipelines::line
Variants< LinePipeline > line
Definition: content_context.cc:263
impeller::ContentContext::Pipelines::clear_blend
Variants< PorterDuffBlendPipeline > clear_blend
Definition: content_context.cc:269
impeller::ContentContext::Pipelines::conical_gradient_uniform_fill
Variants< ConicalGradientUniformFillConicalPipeline > conical_gradient_uniform_fill
Definition: content_context.cc:241
impeller::ContentContext::Pipelines::framebuffer_blend_multiply
Variants< FramebufferBlendMultiplyPipeline > framebuffer_blend_multiply
Definition: content_context.cc:256
impeller::ContentContext::Pipelines::conical_gradient_ssbo_fill
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill
Definition: content_context.cc:237
impeller::ContentContext::Pipelines::texture_downsample
Variants< TextureDownsamplePipeline > texture_downsample
Definition: content_context.cc:294
impeller::ContentContext::Pipelines::framebuffer_blend_luminosity
Variants< FramebufferBlendLuminosityPipeline > framebuffer_blend_luminosity
Definition: content_context.cc:255
impeller::ContentContext::Pipelines::framebuffer_blend_softlight
Variants< FramebufferBlendSoftLightPipeline > framebuffer_blend_softlight
Definition: content_context.cc:260
impeller::ContentContext::Pipelines::sweep_gradient_uniform_fill
Variants< SweepGradientUniformFillPipeline > sweep_gradient_uniform_fill
Definition: content_context.cc:293
impeller::ContentContext::Pipelines::blend_colorburn
Variants< BlendColorBurnPipeline > blend_colorburn
Definition: content_context.cc:215
impeller::ContentContext::Pipelines::conical_gradient_uniform_fill_strip_and_radial
Variants< ConicalGradientUniformFillStripRadialPipeline > conical_gradient_uniform_fill_strip_and_radial
Definition: content_context.cc:244
impeller::ContentContext::Pipelines::source_in_blend
Variants< PorterDuffBlendPipeline > source_in_blend
Definition: content_context.cc:280
impeller::ContentContext::Pipelines::conical_gradient_fill
Variants< ConicalGradientFillConicalPipeline > conical_gradient_fill
Definition: content_context.cc:233
impeller::ContentContext::Pipelines::sweep_gradient_fill
Variants< SweepGradientFillPipeline > sweep_gradient_fill
Definition: content_context.cc:291
impeller::ContentContext::Pipelines::framebuffer_blend_lighten
Variants< FramebufferBlendLightenPipeline > framebuffer_blend_lighten
Definition: content_context.cc:254
impeller::ContentContext::Pipelines::source_a_top_blend
Variants< PorterDuffBlendPipeline > source_a_top_blend
Definition: content_context.cc:278
impeller::ContentContext::Pipelines::destination_a_top_blend
Variants< PorterDuffBlendPipeline > destination_a_top_blend
Definition: content_context.cc:270
impeller::ContentContext::Pipelines::radial_gradient_uniform_fill
Variants< RadialGradientUniformFillPipeline > radial_gradient_uniform_fill
Definition: content_context.cc:286
impeller::ContentContext::Pipelines::blend_lighten
Variants< BlendLightenPipeline > blend_lighten
Definition: content_context.cc:223
impeller::ContentContext::Pipelines::linear_gradient_uniform_fill
Variants< LinearGradientUniformFillPipeline > linear_gradient_uniform_fill
Definition: content_context.cc:266
impeller::ContentContext::Pipelines::framebuffer_blend_colorburn
Variants< FramebufferBlendColorBurnPipeline > framebuffer_blend_colorburn
Definition: content_context.cc:246
impeller::ContentContext::Pipelines::conical_gradient_fill_radial
Variants< ConicalGradientFillRadialPipeline > conical_gradient_fill_radial
Definition: content_context.cc:234
impeller::ContentContext::Pipelines::clip
Variants< ClipPipeline > clip
Definition: content_context.cc:231
impeller::ContentContext::Pipelines::destination_over_blend
Variants< PorterDuffBlendPipeline > destination_over_blend
Definition: content_context.cc:274
impeller::ContentContext::Pipelines::blend_exclusion
Variants< BlendExclusionPipeline > blend_exclusion
Definition: content_context.cc:220
impeller::ContentContext::Pipelines::rsuperellipse_blur
Variants< RSuperellipseBlurPipeline > rsuperellipse_blur
Definition: content_context.cc:288
impeller::ContentContext::Pipelines::srgb_to_linear_filter
Variants< SrgbToLinearFilterPipeline > srgb_to_linear_filter
Definition: content_context.cc:290
impeller::ContentContext::Pipelines::color_matrix_color_filter
Variants< ColorMatrixColorFilterPipeline > color_matrix_color_filter
Definition: content_context.cc:232
impeller::ContentContext::Pipelines::linear_to_srgb_filter
Variants< LinearToSrgbFilterPipeline > linear_to_srgb_filter
Definition: content_context.cc:267
impeller::ContentContext::Pipelines::conical_gradient_uniform_fill_radial
Variants< ConicalGradientUniformFillRadialPipeline > conical_gradient_uniform_fill_radial
Definition: content_context.cc:242
impeller::ContentContext::Pipelines::conical_gradient_ssbo_fill_strip
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_strip
Definition: content_context.cc:240
impeller::ContentContext::Pipelines::rrect_blur
Variants< RRectBlurPipeline > rrect_blur
Definition: content_context.cc:287
impeller::ContentContext::Pipelines::blend_darken
Variants< BlendDarkenPipeline > blend_darken
Definition: content_context.cc:218
impeller::ContentContext::Pipelines::texture
Variants< TexturePipeline > texture
Definition: content_context.cc:295
impeller::ContentContext::Pipelines::source_out_blend
Variants< PorterDuffBlendPipeline > source_out_blend
Definition: content_context.cc:281
impeller::ContentContext::Pipelines::framebuffer_blend_hue
Variants< FramebufferBlendHuePipeline > framebuffer_blend_hue
Definition: content_context.cc:253
impeller::ContentContext::Pipelines::texture_strict_src
Variants< TextureStrictSrcPipeline > texture_strict_src
Definition: content_context.cc:296
impeller::ContentContext::Pipelines::framebuffer_blend_color
Variants< FramebufferBlendColorPipeline > framebuffer_blend_color
Definition: content_context.cc:248
impeller::ContentContext::Pipelines::blend_hue
Variants< BlendHuePipeline > blend_hue
Definition: content_context.cc:222
impeller::ContentContext::Pipelines::framebuffer_blend_darken
Variants< FramebufferBlendDarkenPipeline > framebuffer_blend_darken
Definition: content_context.cc:249
impeller::ContentContext::Pipelines::fast_gradient
Variants< FastGradientPipeline > fast_gradient
Definition: content_context.cc:245
impeller::ContentContext::Pipelines::conical_gradient_uniform_fill_strip
Variants< ConicalGradientUniformFillStripPipeline > conical_gradient_uniform_fill_strip
Definition: content_context.cc:243
impeller::ContentContext::Pipelines::xor_blend
Variants< PorterDuffBlendPipeline > xor_blend
Definition: content_context.cc:283
impeller::ContentContext::Pipelines::gaussian_blur
Variants< GaussianBlurPipeline > gaussian_blur
Definition: content_context.cc:261
impeller::ContentContext::Pipelines::linear_gradient_ssbo_fill
Variants< LinearGradientSSBOFillPipeline > linear_gradient_ssbo_fill
Definition: content_context.cc:265
impeller::ContentContext::Pipelines::conical_gradient_ssbo_fill_strip_and_radial
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_strip_and_radial
Definition: content_context.cc:239
impeller::ContentContext::Pipelines::glyph_atlas
Variants< GlyphAtlasPipeline > glyph_atlas
Definition: content_context.cc:262
impeller::ContentContext::Pipelines::source_blend
Variants< PorterDuffBlendPipeline > source_blend
Definition: content_context.cc:279
impeller::ContentContext::Pipelines::blend_luminosity
Variants< BlendLuminosityPipeline > blend_luminosity
Definition: content_context.cc:224
impeller::ContentContext::Pipelines::border_mask_blur
Variants< BorderMaskBlurPipeline > border_mask_blur
Definition: content_context.cc:230
impeller::ContentContext::Pipelines::framebuffer_blend_screen
Variants< FramebufferBlendScreenPipeline > framebuffer_blend_screen
Definition: content_context.cc:259
impeller::ContentContext::Pipelines::framebuffer_blend_difference
Variants< FramebufferBlendDifferencePipeline > framebuffer_blend_difference
Definition: content_context.cc:250
impeller::ContentContext::Pipelines::yuv_to_rgb_filter
Variants< YUVToRGBFilterPipeline > yuv_to_rgb_filter
Definition: content_context.cc:300
impeller::ContentContext::Pipelines::radial_gradient_fill
Variants< RadialGradientFillPipeline > radial_gradient_fill
Definition: content_context.cc:284
impeller::ContentContext::Pipelines::conical_gradient_ssbo_fill_radial
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_radial
Definition: content_context.cc:238
impeller::ContentContext::Pipelines::conical_gradient_fill_strip_and_radial
Variants< ConicalGradientFillStripRadialPipeline > conical_gradient_fill_strip_and_radial
Definition: content_context.cc:236
impeller::ContentContext::Pipelines::blend_hardlight
Variants< BlendHardLightPipeline > blend_hardlight
Definition: content_context.cc:221
impeller::ContentContext::Pipelines::framebuffer_blend_colordodge
Variants< FramebufferBlendColorDodgePipeline > framebuffer_blend_colordodge
Definition: content_context.cc:247
impeller::ContentContext::Pipelines::destination_out_blend
Variants< PorterDuffBlendPipeline > destination_out_blend
Definition: content_context.cc:273
impeller::ContentContext::Pipelines::vertices_uber_1_
Variants< VerticesUber1Shader > vertices_uber_1_
Definition: content_context.cc:298
impeller::ContentContextOptions
Definition: content_context.h:40
impeller::ContentContextOptions::primitive_type
PrimitiveType primitive_type
Definition: content_context.h:97
impeller::ContentContextOptions::has_depth_stencil_attachments
bool has_depth_stencil_attachments
Definition: content_context.h:99
impeller::ContentContextOptions::stencil_mode
StencilMode stencil_mode
Definition: content_context.h:96
impeller::ContentContextOptions::depth_write_enabled
bool depth_write_enabled
Definition: content_context.h:100
impeller::ContentContextOptions::ApplyToPipelineDescriptor
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
Definition: content_context.cc:310
impeller::ContentContextOptions::blend_mode
BlendMode blend_mode
Definition: content_context.h:94
impeller::ContentContextOptions::color_attachment_pixel_format
PixelFormat color_attachment_pixel_format
Definition: content_context.h:98
impeller::ContentContextOptions::StencilMode::kOverdrawPreventionRestore
@ kOverdrawPreventionRestore
impeller::ContentContextOptions::StencilMode::kStencilEvenOddFill
@ kStencilEvenOddFill
impeller::ContentContextOptions::StencilMode::kOverdrawPreventionIncrement
@ kOverdrawPreventionIncrement
impeller::ContentContextOptions::StencilMode::kCoverCompareInverted
@ kCoverCompareInverted
impeller::ContentContextOptions::StencilMode::kStencilNonZeroFill
@ kStencilNonZeroFill
impeller::ContentContextOptions::StencilMode::kIgnore
@ kIgnore
impeller::ContentContextOptions::StencilMode::kCoverCompare
@ kCoverCompare
impeller::ContentContextOptions::sample_count
SampleCount sample_count
Definition: content_context.h:93
impeller::ContentContextOptions::is_for_rrect_blur_clear
bool is_for_rrect_blur_clear
Definition: content_context.h:101
impeller::ContentContextOptions::depth_compare
CompareFunction depth_compare
Definition: content_context.h:95
impeller::DepthAttachmentDescriptor
Definition: formats.h:590
impeller::DepthAttachmentDescriptor::depth_compare
CompareFunction depth_compare
Definition: formats.h:594
impeller::DepthAttachmentDescriptor::depth_write_enabled
bool depth_write_enabled
Definition: formats.h:598
impeller::PipelineBuilder::MakeDefaultPipelineDescriptor
static std::optional< PipelineDescriptor > MakeDefaultPipelineDescriptor(const Context &context, const std::vector< Scalar > &constants={})
Create a default pipeline descriptor using the combination reflected shader information....
Definition: pipeline_builder.h:49
impeller::StencilAttachmentDescriptor
Definition: formats.h:610
impeller::StencilAttachmentDescriptor::stencil_failure
StencilOperation stencil_failure
Definition: formats.h:620
impeller::StencilAttachmentDescriptor::stencil_compare
CompareFunction stencil_compare
Definition: formats.h:616
impeller::StencilAttachmentDescriptor::depth_stencil_pass
StencilOperation depth_stencil_pass
Definition: formats.h:629
impeller::TSize
Definition: size.h:25
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition: texture_descriptor.h:38
impeller::TextureDescriptor::size
ISize size
Definition: texture_descriptor.h:42
impeller::TextureDescriptor::storage_mode
StorageMode storage_mode
Definition: texture_descriptor.h:39
impeller::TextureDescriptor::format
PixelFormat format
Definition: texture_descriptor.h:41
tessellator.h
text_shadow_cache.h
texture_descriptor.h
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:68
texture_util.h
typographer_context.h
validation.h
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91