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