Flutter Engine
The Flutter Engine
content_context.h
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#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
6#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
7
8#include <initializer_list>
9#include <memory>
10#include <optional>
11#include <unordered_map>
12
13#include "flutter/fml/logging.h"
14#include "flutter/fml/status_or.h"
25
26#include "impeller/entity/border_mask_blur.frag.h"
27#include "impeller/entity/clip.frag.h"
28#include "impeller/entity/clip.vert.h"
29#include "impeller/entity/color_matrix_color_filter.frag.h"
30#include "impeller/entity/conical_gradient_fill.frag.h"
31#include "impeller/entity/fast_gradient.frag.h"
32#include "impeller/entity/fast_gradient.vert.h"
33#include "impeller/entity/filter_position.vert.h"
34#include "impeller/entity/filter_position_uv.vert.h"
35#include "impeller/entity/gaussian.frag.h"
36#include "impeller/entity/glyph_atlas.frag.h"
37#include "impeller/entity/glyph_atlas.vert.h"
38#include "impeller/entity/gradient_fill.vert.h"
39#include "impeller/entity/linear_gradient_fill.frag.h"
40#include "impeller/entity/linear_to_srgb_filter.frag.h"
41#include "impeller/entity/morphology_filter.frag.h"
42#include "impeller/entity/porter_duff_blend.frag.h"
43#include "impeller/entity/porter_duff_blend.vert.h"
44#include "impeller/entity/radial_gradient_fill.frag.h"
45#include "impeller/entity/rrect_blur.frag.h"
46#include "impeller/entity/rrect_blur.vert.h"
47#include "impeller/entity/solid_fill.frag.h"
48#include "impeller/entity/solid_fill.vert.h"
49#include "impeller/entity/srgb_to_linear_filter.frag.h"
50#include "impeller/entity/sweep_gradient_fill.frag.h"
51#include "impeller/entity/texture_fill.frag.h"
52#include "impeller/entity/texture_fill.vert.h"
53#include "impeller/entity/texture_fill_strict_src.frag.h"
54#include "impeller/entity/texture_uv_fill.vert.h"
55#include "impeller/entity/tiled_texture_fill.frag.h"
56#include "impeller/entity/yuv_to_rgb_filter.frag.h"
57
58#include "impeller/entity/conical_gradient_ssbo_fill.frag.h"
59#include "impeller/entity/linear_gradient_ssbo_fill.frag.h"
60#include "impeller/entity/radial_gradient_ssbo_fill.frag.h"
61#include "impeller/entity/sweep_gradient_ssbo_fill.frag.h"
62
63#include "impeller/entity/advanced_blend.frag.h"
64#include "impeller/entity/advanced_blend.vert.h"
65
66#include "impeller/entity/framebuffer_blend.frag.h"
67#include "impeller/entity/framebuffer_blend.vert.h"
68
69#include "impeller/entity/vertices_uber.frag.h"
70
71#ifdef IMPELLER_ENABLE_OPENGLES
72#include "impeller/entity/tiled_texture_fill_external.frag.h"
73#endif // IMPELLER_ENABLE_OPENGLES
74
75#if IMPELLER_ENABLE_3D
76#include "impeller/scene/scene_context.h" // nogncheck
77#endif
78
79namespace impeller {
80
84 RenderPipelineHandle<GradientFillVertexShader,
85 LinearGradientFillFragmentShader>;
89 RenderPipelineHandle<GradientFillVertexShader,
90 RadialGradientFillFragmentShader>;
92 RenderPipelineHandle<GradientFillVertexShader,
93 ConicalGradientFillFragmentShader>;
95 RenderPipelineHandle<GradientFillVertexShader,
96 SweepGradientFillFragmentShader>;
98 RenderPipelineHandle<GradientFillVertexShader,
99 LinearGradientSsboFillFragmentShader>;
101 RenderPipelineHandle<GradientFillVertexShader,
102 ConicalGradientSsboFillFragmentShader>;
104 RenderPipelineHandle<GradientFillVertexShader,
105 RadialGradientSsboFillFragmentShader>;
107 RenderPipelineHandle<GradientFillVertexShader,
108 SweepGradientSsboFillFragmentShader>;
114 RenderPipelineHandle<TextureFillVertexShader,
115 TextureFillStrictSrcFragmentShader>;
117 RenderPipelineHandle<TextureUvFillVertexShader,
118 TiledTextureFillFragmentShader>;
122 RenderPipelineHandle<FilterPositionUvVertexShader,
123 BorderMaskBlurFragmentShader>;
125 RenderPipelineHandle<FilterPositionUvVertexShader,
126 MorphologyFilterFragmentShader>;
128 RenderPipelineHandle<FilterPositionVertexShader,
129 ColorMatrixColorFilterFragmentShader>;
131 RenderPipelineHandle<FilterPositionVertexShader,
132 LinearToSrgbFilterFragmentShader>;
134 RenderPipelineHandle<FilterPositionVertexShader,
135 SrgbToLinearFilterFragmentShader>;
137 RenderPipelineHandle<FilterPositionVertexShader,
138 YuvToRgbFilterFragmentShader>;
139
142
144 RenderPipelineHandle<PorterDuffBlendVertexShader,
145 PorterDuffBlendFragmentShader>;
147
148// Advanced blends
149using BlendColorPipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
150 AdvancedBlendFragmentShader>;
152 RenderPipelineHandle<AdvancedBlendVertexShader,
153 AdvancedBlendFragmentShader>;
155 RenderPipelineHandle<AdvancedBlendVertexShader,
156 AdvancedBlendFragmentShader>;
157using BlendDarkenPipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
158 AdvancedBlendFragmentShader>;
160 RenderPipelineHandle<AdvancedBlendVertexShader,
161 AdvancedBlendFragmentShader>;
163 RenderPipelineHandle<AdvancedBlendVertexShader,
164 AdvancedBlendFragmentShader>;
166 RenderPipelineHandle<AdvancedBlendVertexShader,
167 AdvancedBlendFragmentShader>;
168using BlendHuePipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
169 AdvancedBlendFragmentShader>;
170using BlendLightenPipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
171 AdvancedBlendFragmentShader>;
173 RenderPipelineHandle<AdvancedBlendVertexShader,
174 AdvancedBlendFragmentShader>;
175using BlendMultiplyPipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
176 AdvancedBlendFragmentShader>;
177using BlendOverlayPipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
178 AdvancedBlendFragmentShader>;
180 RenderPipelineHandle<AdvancedBlendVertexShader,
181 AdvancedBlendFragmentShader>;
182using BlendScreenPipeline = RenderPipelineHandle<AdvancedBlendVertexShader,
183 AdvancedBlendFragmentShader>;
185 RenderPipelineHandle<AdvancedBlendVertexShader,
186 AdvancedBlendFragmentShader>;
187// Framebuffer Advanced Blends
189 RenderPipelineHandle<FramebufferBlendVertexShader,
190 FramebufferBlendFragmentShader>;
192 RenderPipelineHandle<FramebufferBlendVertexShader,
193 FramebufferBlendFragmentShader>;
195 RenderPipelineHandle<FramebufferBlendVertexShader,
196 FramebufferBlendFragmentShader>;
198 RenderPipelineHandle<FramebufferBlendVertexShader,
199 FramebufferBlendFragmentShader>;
201 RenderPipelineHandle<FramebufferBlendVertexShader,
202 FramebufferBlendFragmentShader>;
204 RenderPipelineHandle<FramebufferBlendVertexShader,
205 FramebufferBlendFragmentShader>;
207 RenderPipelineHandle<FramebufferBlendVertexShader,
208 FramebufferBlendFragmentShader>;
210 RenderPipelineHandle<FramebufferBlendVertexShader,
211 FramebufferBlendFragmentShader>;
213 RenderPipelineHandle<FramebufferBlendVertexShader,
214 FramebufferBlendFragmentShader>;
216 RenderPipelineHandle<FramebufferBlendVertexShader,
217 FramebufferBlendFragmentShader>;
219 RenderPipelineHandle<FramebufferBlendVertexShader,
220 FramebufferBlendFragmentShader>;
222 RenderPipelineHandle<FramebufferBlendVertexShader,
223 FramebufferBlendFragmentShader>;
225 RenderPipelineHandle<FramebufferBlendVertexShader,
226 FramebufferBlendFragmentShader>;
228 RenderPipelineHandle<FramebufferBlendVertexShader,
229 FramebufferBlendFragmentShader>;
231 RenderPipelineHandle<FramebufferBlendVertexShader,
232 FramebufferBlendFragmentShader>;
233
234/// Draw Vertices/Atlas Uber Shader
235using VerticesUberShader = RenderPipelineHandle<PorterDuffBlendVertexShader,
236 VerticesUberFragmentShader>;
237
238#ifdef IMPELLER_ENABLE_OPENGLES
239using TiledTextureExternalPipeline =
240 RenderPipelineHandle<TextureUvFillVertexShader,
241 TiledTextureFillExternalFragmentShader>;
242#endif // IMPELLER_ENABLE_OPENGLES
243
244/// Pipeline state configuration.
245///
246/// Each unique combination of these options requires a different pipeline state
247/// object to be built. This struct is used as a key for the per-pipeline
248/// variant cache.
249///
250/// When adding fields to this key, reliant features should take care to limit
251/// the combinatorical explosion of variations. A sufficiently complicated
252/// Flutter application may easily require building hundreds of PSOs in total,
253/// but they shouldn't require e.g. 10s of thousands.
255 enum class StencilMode : uint8_t {
256 /// Turn the stencil test off. Used when drawing without stencil-then-cover
257 /// or overdraw prevention.
258 kIgnore,
259
260 // Operations used for stencil-then-cover.
261
262 /// Draw the stencil for the NonZero fill path rule.
263 ///
264 /// The stencil ref should always be 0 on commands using this mode.
265 kStencilNonZeroFill,
266 /// Draw the stencil for the EvenOdd fill path rule.
267 ///
268 /// The stencil ref should always be 0 on commands using this mode.
269 kStencilEvenOddFill,
270 /// Used for draw calls which fill in the stenciled area. Intended to be
271 /// used after `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set
272 /// up the stencil buffer. Also cleans up the stencil buffer by resetting
273 /// everything to zero.
274 ///
275 /// The stencil ref should always be 0 on commands using this mode.
276 kCoverCompare,
277 /// The opposite of `kCoverCompare`. Used for draw calls which fill in the
278 /// non-stenciled area (intersection clips). Intended to be used after
279 /// `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set up the
280 /// stencil buffer. Also cleans up the stencil buffer by resetting
281 /// everything to zero.
282 ///
283 /// The stencil ref should always be 0 on commands using this mode.
284 kCoverCompareInverted,
285
286 // Operations used for the "overdraw prevention" mechanism. This is used for
287 // drawing strokes.
288
289 /// For each fragment, increment the stencil value if it's currently zero.
290 /// Discard fragments when the value is non-zero. This prevents
291 /// self-overlapping strokes from drawing over themselves.
292 ///
293 /// Note that this is done for rendering correctness, not performance. If a
294 /// stroke is drawn with a backdrop-reliant blend and self-intersects, then
295 /// the intersected geometry will render incorrectly when overdrawn because
296 /// we don't adjust the geometry prevent self-intersection.
297 ///
298 /// The stencil ref should always be 0 on commands using this mode.
299 kOverdrawPreventionIncrement,
300 /// Reset the stencil to a new maximum value specified by the ref (currently
301 /// always 0).
302 ///
303 /// The stencil ref should always be 0 on commands using this mode.
304 kOverdrawPreventionRestore,
305 };
306
315 bool wireframe = false;
317
318 struct Hash {
319 constexpr uint64_t operator()(const ContentContextOptions& o) const {
320 static_assert(sizeof(o.sample_count) == 1);
321 static_assert(sizeof(o.blend_mode) == 1);
322 static_assert(sizeof(o.sample_count) == 1);
323 static_assert(sizeof(o.depth_compare) == 1);
324 static_assert(sizeof(o.stencil_mode) == 1);
325 static_assert(sizeof(o.primitive_type) == 1);
326 static_assert(sizeof(o.color_attachment_pixel_format) == 1);
327
328 return (o.is_for_rrect_blur_clear ? 1llu : 0llu) << 0 |
329 (o.wireframe ? 1llu : 0llu) << 1 |
330 (o.has_depth_stencil_attachments ? 1llu : 0llu) << 2 |
331 (o.depth_write_enabled ? 1llu : 0llu) << 3 |
332 // enums
333 static_cast<uint64_t>(o.color_attachment_pixel_format) << 8 |
334 static_cast<uint64_t>(o.primitive_type) << 16 |
335 static_cast<uint64_t>(o.stencil_mode) << 24 |
336 static_cast<uint64_t>(o.depth_compare) << 32 |
337 static_cast<uint64_t>(o.blend_mode) << 40 |
338 static_cast<uint64_t>(o.sample_count) << 48;
339 }
340 };
341
342 struct Equal {
343 constexpr bool operator()(const ContentContextOptions& lhs,
344 const ContentContextOptions& rhs) const {
345 return lhs.sample_count == rhs.sample_count &&
346 lhs.blend_mode == rhs.blend_mode &&
348 lhs.depth_compare == rhs.depth_compare &&
349 lhs.stencil_mode == rhs.stencil_mode &&
350 lhs.primitive_type == rhs.primitive_type &&
355 lhs.wireframe == rhs.wireframe &&
357 }
358 };
359
361};
362
363class Tessellator;
364class RenderTargetCache;
365
367 public:
368 explicit ContentContext(
369 std::shared_ptr<Context> context,
370 std::shared_ptr<TypographerContext> typographer_context,
371 std::shared_ptr<RenderTargetAllocator> render_target_allocator = nullptr);
372
374
375 bool IsValid() const;
376
377#if IMPELLER_ENABLE_3D
378 std::shared_ptr<scene::SceneContext> GetSceneContext() const;
379#endif // IMPELLER_ENABLE_3D
380
381 std::shared_ptr<Tessellator> GetTessellator() const;
382
383 std::shared_ptr<Pipeline<PipelineDescriptor>> GetFastGradientPipeline(
384 ContentContextOptions opts) const {
385 return GetPipeline(fast_gradient_pipelines_, opts);
386 }
387
388 std::shared_ptr<Pipeline<PipelineDescriptor>> GetLinearGradientFillPipeline(
389 ContentContextOptions opts) const {
390 return GetPipeline(linear_gradient_fill_pipelines_, opts);
391 }
392
393 std::shared_ptr<Pipeline<PipelineDescriptor>>
395 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
396 return GetPipeline(linear_gradient_ssbo_fill_pipelines_, opts);
397 }
398
399 std::shared_ptr<Pipeline<PipelineDescriptor>>
401 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
402 return GetPipeline(radial_gradient_ssbo_fill_pipelines_, opts);
403 }
404
405 std::shared_ptr<Pipeline<PipelineDescriptor>>
407 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
408 return GetPipeline(conical_gradient_ssbo_fill_pipelines_, opts);
409 }
410
411 std::shared_ptr<Pipeline<PipelineDescriptor>>
413 FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
414 return GetPipeline(sweep_gradient_ssbo_fill_pipelines_, opts);
415 }
416
417 std::shared_ptr<Pipeline<PipelineDescriptor>> GetRadialGradientFillPipeline(
418 ContentContextOptions opts) const {
419 return GetPipeline(radial_gradient_fill_pipelines_, opts);
420 }
421
422 std::shared_ptr<Pipeline<PipelineDescriptor>> GetConicalGradientFillPipeline(
423 ContentContextOptions opts) const {
424 return GetPipeline(conical_gradient_fill_pipelines_, opts);
425 }
426
427 std::shared_ptr<Pipeline<PipelineDescriptor>> GetRRectBlurPipeline(
428 ContentContextOptions opts) const {
429 return GetPipeline(rrect_blur_pipelines_, opts);
430 }
431
432 std::shared_ptr<Pipeline<PipelineDescriptor>> GetSweepGradientFillPipeline(
433 ContentContextOptions opts) const {
434 return GetPipeline(sweep_gradient_fill_pipelines_, opts);
435 }
436
437 std::shared_ptr<Pipeline<PipelineDescriptor>> GetSolidFillPipeline(
438 ContentContextOptions opts) const {
439 return GetPipeline(solid_fill_pipelines_, opts);
440 }
441
442 std::shared_ptr<Pipeline<PipelineDescriptor>> GetTexturePipeline(
443 ContentContextOptions opts) const {
444 return GetPipeline(texture_pipelines_, opts);
445 }
446
447 std::shared_ptr<Pipeline<PipelineDescriptor>> GetTextureStrictSrcPipeline(
448 ContentContextOptions opts) const {
449 return GetPipeline(texture_strict_src_pipelines_, opts);
450 }
451
452#ifdef IMPELLER_ENABLE_OPENGLES
453 std::shared_ptr<Pipeline<PipelineDescriptor>> GetTiledTextureExternalPipeline(
454 ContentContextOptions opts) const {
455 FML_DCHECK(GetContext()->GetBackendType() ==
457 return GetPipeline(tiled_texture_external_pipelines_, opts);
458 }
459#endif // IMPELLER_ENABLE_OPENGLES
460
461 std::shared_ptr<Pipeline<PipelineDescriptor>> GetTiledTexturePipeline(
462 ContentContextOptions opts) const {
463 return GetPipeline(tiled_texture_pipelines_, opts);
464 }
465
466 std::shared_ptr<Pipeline<PipelineDescriptor>> GetGaussianBlurPipeline(
467 ContentContextOptions opts) const {
468 return GetPipeline(gaussian_blur_pipelines_, opts);
469 }
470
471 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBorderMaskBlurPipeline(
472 ContentContextOptions opts) const {
473 return GetPipeline(border_mask_blur_pipelines_, opts);
474 }
475
476 std::shared_ptr<Pipeline<PipelineDescriptor>> GetMorphologyFilterPipeline(
477 ContentContextOptions opts) const {
478 return GetPipeline(morphology_filter_pipelines_, opts);
479 }
480
481 std::shared_ptr<Pipeline<PipelineDescriptor>>
483 return GetPipeline(color_matrix_color_filter_pipelines_, opts);
484 }
485
486 std::shared_ptr<Pipeline<PipelineDescriptor>> GetLinearToSrgbFilterPipeline(
487 ContentContextOptions opts) const {
488 return GetPipeline(linear_to_srgb_filter_pipelines_, opts);
489 }
490
491 std::shared_ptr<Pipeline<PipelineDescriptor>> GetSrgbToLinearFilterPipeline(
492 ContentContextOptions opts) const {
493 return GetPipeline(srgb_to_linear_filter_pipelines_, opts);
494 }
495
496 std::shared_ptr<Pipeline<PipelineDescriptor>> GetClipPipeline(
497 ContentContextOptions opts) const {
498 return GetPipeline(clip_pipelines_, opts);
499 }
500
501 std::shared_ptr<Pipeline<PipelineDescriptor>> GetGlyphAtlasPipeline(
502 ContentContextOptions opts) const {
503 return GetPipeline(glyph_atlas_pipelines_, opts);
504 }
505
506 std::shared_ptr<Pipeline<PipelineDescriptor>> GetYUVToRGBFilterPipeline(
507 ContentContextOptions opts) const {
508 return GetPipeline(yuv_to_rgb_filter_pipelines_, opts);
509 }
510
511 std::shared_ptr<Pipeline<PipelineDescriptor>> GetPorterDuffBlendPipeline(
512 ContentContextOptions opts) const {
513 return GetPipeline(porter_duff_blend_pipelines_, opts);
514 }
515
516 // Advanced blends.
517
518 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendColorPipeline(
519 ContentContextOptions opts) const {
520 return GetPipeline(blend_color_pipelines_, opts);
521 }
522
523 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendColorBurnPipeline(
524 ContentContextOptions opts) const {
525 return GetPipeline(blend_colorburn_pipelines_, opts);
526 }
527
528 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendColorDodgePipeline(
529 ContentContextOptions opts) const {
530 return GetPipeline(blend_colordodge_pipelines_, opts);
531 }
532
533 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendDarkenPipeline(
534 ContentContextOptions opts) const {
535 return GetPipeline(blend_darken_pipelines_, opts);
536 }
537
538 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendDifferencePipeline(
539 ContentContextOptions opts) const {
540 return GetPipeline(blend_difference_pipelines_, opts);
541 }
542
543 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendExclusionPipeline(
544 ContentContextOptions opts) const {
545 return GetPipeline(blend_exclusion_pipelines_, opts);
546 }
547
548 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendHardLightPipeline(
549 ContentContextOptions opts) const {
550 return GetPipeline(blend_hardlight_pipelines_, opts);
551 }
552
553 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendHuePipeline(
554 ContentContextOptions opts) const {
555 return GetPipeline(blend_hue_pipelines_, opts);
556 }
557
558 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendLightenPipeline(
559 ContentContextOptions opts) const {
560 return GetPipeline(blend_lighten_pipelines_, opts);
561 }
562
563 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendLuminosityPipeline(
564 ContentContextOptions opts) const {
565 return GetPipeline(blend_luminosity_pipelines_, opts);
566 }
567
568 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendMultiplyPipeline(
569 ContentContextOptions opts) const {
570 return GetPipeline(blend_multiply_pipelines_, opts);
571 }
572
573 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendOverlayPipeline(
574 ContentContextOptions opts) const {
575 return GetPipeline(blend_overlay_pipelines_, opts);
576 }
577
578 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendSaturationPipeline(
579 ContentContextOptions opts) const {
580 return GetPipeline(blend_saturation_pipelines_, opts);
581 }
582
583 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendScreenPipeline(
584 ContentContextOptions opts) const {
585 return GetPipeline(blend_screen_pipelines_, opts);
586 }
587
588 std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendSoftLightPipeline(
589 ContentContextOptions opts) const {
590 return GetPipeline(blend_softlight_pipelines_, opts);
591 }
592
593 // Framebuffer Advanced Blends
594 std::shared_ptr<Pipeline<PipelineDescriptor>>
596 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
597 return GetPipeline(framebuffer_blend_color_pipelines_, opts);
598 }
599
600 std::shared_ptr<Pipeline<PipelineDescriptor>>
602 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
603 return GetPipeline(framebuffer_blend_colorburn_pipelines_, opts);
604 }
605
606 std::shared_ptr<Pipeline<PipelineDescriptor>>
608 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
609 return GetPipeline(framebuffer_blend_colordodge_pipelines_, opts);
610 }
611
612 std::shared_ptr<Pipeline<PipelineDescriptor>>
614 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
615 return GetPipeline(framebuffer_blend_darken_pipelines_, opts);
616 }
617
618 std::shared_ptr<Pipeline<PipelineDescriptor>>
620 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
621 return GetPipeline(framebuffer_blend_difference_pipelines_, opts);
622 }
623
624 std::shared_ptr<Pipeline<PipelineDescriptor>>
626 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
627 return GetPipeline(framebuffer_blend_exclusion_pipelines_, opts);
628 }
629
630 std::shared_ptr<Pipeline<PipelineDescriptor>>
632 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
633 return GetPipeline(framebuffer_blend_hardlight_pipelines_, opts);
634 }
635
636 std::shared_ptr<Pipeline<PipelineDescriptor>> GetFramebufferBlendHuePipeline(
637 ContentContextOptions opts) const {
638 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
639 return GetPipeline(framebuffer_blend_hue_pipelines_, opts);
640 }
641
642 std::shared_ptr<Pipeline<PipelineDescriptor>>
644 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
645 return GetPipeline(framebuffer_blend_lighten_pipelines_, opts);
646 }
647
648 std::shared_ptr<Pipeline<PipelineDescriptor>>
650 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
651 return GetPipeline(framebuffer_blend_luminosity_pipelines_, opts);
652 }
653
654 std::shared_ptr<Pipeline<PipelineDescriptor>>
656 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
657 return GetPipeline(framebuffer_blend_multiply_pipelines_, opts);
658 }
659
660 std::shared_ptr<Pipeline<PipelineDescriptor>>
662 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
663 return GetPipeline(framebuffer_blend_overlay_pipelines_, opts);
664 }
665
666 std::shared_ptr<Pipeline<PipelineDescriptor>>
668 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
669 return GetPipeline(framebuffer_blend_saturation_pipelines_, opts);
670 }
671
672 std::shared_ptr<Pipeline<PipelineDescriptor>>
674 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
675 return GetPipeline(framebuffer_blend_screen_pipelines_, opts);
676 }
677
678 std::shared_ptr<Pipeline<PipelineDescriptor>>
680 FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
681 return GetPipeline(framebuffer_blend_softlight_pipelines_, opts);
682 }
683
684 std::shared_ptr<Pipeline<PipelineDescriptor>> GetDrawVerticesUberShader(
685 ContentContextOptions opts) const {
686 return GetPipeline(vertices_uber_shader_, opts);
687 }
688
689 // An empty 1x1 texture for binding drawVertices/drawAtlas or other cases
690 // that don't always have a texture (due to blending).
691 std::shared_ptr<Texture> GetEmptyTexture() const;
692
693 std::shared_ptr<Context> GetContext() const;
694
695 const Capabilities& GetDeviceCapabilities() const;
696
697 void SetWireframe(bool wireframe);
698
701
702 /// @brief Creates a new texture of size `texture_size` and calls
703 /// `subpass_callback` with a `RenderPass` for drawing to the texture.
705 std::string_view label,
706 ISize texture_size,
707 const std::shared_ptr<CommandBuffer>& command_buffer,
708 const SubpassCallback& subpass_callback,
709 bool msaa_enabled = true,
710 bool depth_stencil_enabled = false,
711 int32_t mip_count = 1) const;
712
713 /// Makes a subpass that will render to `subpass_target`.
715 std::string_view label,
716 const RenderTarget& subpass_target,
717 const std::shared_ptr<CommandBuffer>& command_buffer,
718 const SubpassCallback& subpass_callback) const;
719
720 const std::shared_ptr<LazyGlyphAtlas>& GetLazyGlyphAtlas() const {
721 return lazy_glyph_atlas_;
722 }
723
724 const std::shared_ptr<RenderTargetAllocator>& GetRenderTargetCache() const {
725 return render_target_cache_;
726 }
727
728 /// RuntimeEffect pipelines must be obtained via this method to avoid
729 /// re-creating them every frame.
730 ///
731 /// The unique_entrypoint_name comes from RuntimeEffect::GetEntrypoint.
732 /// Impellerc generates a unique entrypoint name for runtime effect shaders
733 /// based on the input file name and shader stage.
734 ///
735 /// The create_callback is synchronously invoked exactly once if a cached
736 /// pipeline is not found.
737 std::shared_ptr<Pipeline<PipelineDescriptor>> GetCachedRuntimeEffectPipeline(
738 const std::string& unique_entrypoint_name,
740 const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
741 create_callback) const;
742
743 /// Used by hot reload/hot restart to clear a cached pipeline from
744 /// GetCachedRuntimeEffectPipeline.
746 const std::string& unique_entrypoint_name) const;
747
748 /// @brief Retrieve the currnent host buffer for transient storage.
749 ///
750 /// This is only safe to use from the raster threads. Other threads should
751 /// allocate their own device buffers.
752 HostBuffer& GetTransientsBuffer() const { return *host_buffer_; }
753
754 private:
755 std::shared_ptr<Context> context_;
756 std::shared_ptr<LazyGlyphAtlas> lazy_glyph_atlas_;
757
758 /// Run backend specific additional setup and create common shader variants.
759 ///
760 /// This bootstrap is intended to improve the performance of several
761 /// first frame benchmarks that are tracked in the flutter device lab.
762 /// The workload includes initializing commonly used but not default
763 /// shader variants, as well as forcing driver initialization.
764 void InitializeCommonlyUsedShadersIfNeeded() const;
765
766 struct RuntimeEffectPipelineKey {
767 std::string unique_entrypoint_name;
769
770 struct Hash {
771 std::size_t operator()(const RuntimeEffectPipelineKey& key) const {
772 return fml::HashCombine(key.unique_entrypoint_name,
774 }
775 };
776
777 struct Equal {
778 constexpr bool operator()(const RuntimeEffectPipelineKey& lhs,
779 const RuntimeEffectPipelineKey& rhs) const {
780 return lhs.unique_entrypoint_name == rhs.unique_entrypoint_name &&
781 ContentContextOptions::Equal{}(lhs.options, rhs.options);
782 }
783 };
784 };
785
786 mutable std::unordered_map<RuntimeEffectPipelineKey,
787 std::shared_ptr<Pipeline<PipelineDescriptor>>,
789 RuntimeEffectPipelineKey::Equal>
790 runtime_effect_pipelines_;
791
792 /// Holds multiple Pipelines associated with the same PipelineHandle types.
793 ///
794 /// For example, it may have multiple
795 /// RenderPipelineHandle<SolidFillVertexShader, SolidFillFragmentShader>
796 /// instances for different blend modes. From them you can access the
797 /// Pipeline.
798 ///
799 /// See also:
800 /// - impeller::ContentContextOptions - options from which variants are
801 /// created.
802 /// - impeller::Pipeline::CreateVariant
803 /// - impeller::RenderPipelineHandle<> - The type of objects this typically
804 /// contains.
805 template <class PipelineHandleT>
806 class Variants {
807 public:
808 Variants() = default;
809
810 void Set(const ContentContextOptions& options,
811 std::unique_ptr<PipelineHandleT> pipeline) {
812 pipelines_[options] = std::move(pipeline);
813 }
814
815 void SetDefault(const ContentContextOptions& options,
816 std::unique_ptr<PipelineHandleT> pipeline) {
817 default_options_ = options;
818 Set(options, std::move(pipeline));
819 }
820
821 void CreateDefault(const Context& context,
822 const ContentContextOptions& options,
823 const std::initializer_list<Scalar>& constants = {}) {
824 auto desc = PipelineHandleT::Builder::MakeDefaultPipelineDescriptor(
825 context, constants);
826 if (!desc.has_value()) {
827 VALIDATION_LOG << "Failed to create default pipeline.";
828 return;
829 }
830 options.ApplyToPipelineDescriptor(*desc);
831 SetDefault(options, std::make_unique<PipelineHandleT>(context, desc));
832 }
833
834 PipelineHandleT* Get(const ContentContextOptions& options) const {
835 if (auto found = pipelines_.find(options); found != pipelines_.end()) {
836 return found->second.get();
837 }
838 return nullptr;
839 }
840
841 PipelineHandleT* GetDefault() const {
842 if (!default_options_.has_value()) {
843 return nullptr;
844 }
845 return Get(default_options_.value());
846 }
847
848 size_t GetPipelineCount() const { return pipelines_.size(); }
849
850 private:
851 std::optional<ContentContextOptions> default_options_;
852 std::unordered_map<ContentContextOptions,
853 std::unique_ptr<PipelineHandleT>,
855 ContentContextOptions::Equal>
856 pipelines_;
857
858 Variants(const Variants&) = delete;
859
860 Variants& operator=(const Variants&) = delete;
861 };
862
863 // These are mutable because while the prototypes are created eagerly, any
864 // variants requested from that are lazily created and cached in the variants
865 // map.
866
867 mutable Variants<SolidFillPipeline> solid_fill_pipelines_;
868 mutable Variants<FastGradientPipeline> fast_gradient_pipelines_;
869 mutable Variants<LinearGradientFillPipeline> linear_gradient_fill_pipelines_;
870 mutable Variants<RadialGradientFillPipeline> radial_gradient_fill_pipelines_;
871 mutable Variants<ConicalGradientFillPipeline>
872 conical_gradient_fill_pipelines_;
873 mutable Variants<SweepGradientFillPipeline> sweep_gradient_fill_pipelines_;
874 mutable Variants<LinearGradientSSBOFillPipeline>
875 linear_gradient_ssbo_fill_pipelines_;
876 mutable Variants<RadialGradientSSBOFillPipeline>
877 radial_gradient_ssbo_fill_pipelines_;
878 mutable Variants<ConicalGradientSSBOFillPipeline>
879 conical_gradient_ssbo_fill_pipelines_;
880 mutable Variants<SweepGradientSSBOFillPipeline>
881 sweep_gradient_ssbo_fill_pipelines_;
882 mutable Variants<RRectBlurPipeline> rrect_blur_pipelines_;
883 mutable Variants<TexturePipeline> texture_pipelines_;
884 mutable Variants<TextureStrictSrcPipeline> texture_strict_src_pipelines_;
885#ifdef IMPELLER_ENABLE_OPENGLES
886 mutable Variants<TiledTextureExternalPipeline>
887 tiled_texture_external_pipelines_;
888#endif // IMPELLER_ENABLE_OPENGLES
889 mutable Variants<TiledTexturePipeline> tiled_texture_pipelines_;
890 mutable Variants<GaussianBlurPipeline> gaussian_blur_pipelines_;
891 mutable Variants<BorderMaskBlurPipeline> border_mask_blur_pipelines_;
892 mutable Variants<MorphologyFilterPipeline> morphology_filter_pipelines_;
893 mutable Variants<ColorMatrixColorFilterPipeline>
894 color_matrix_color_filter_pipelines_;
895 mutable Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter_pipelines_;
896 mutable Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter_pipelines_;
897 mutable Variants<ClipPipeline> clip_pipelines_;
898 mutable Variants<GlyphAtlasPipeline> glyph_atlas_pipelines_;
899 mutable Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter_pipelines_;
900 mutable Variants<PorterDuffBlendPipeline> porter_duff_blend_pipelines_;
901 // Advanced blends.
902 mutable Variants<BlendColorPipeline> blend_color_pipelines_;
903 mutable Variants<BlendColorBurnPipeline> blend_colorburn_pipelines_;
904 mutable Variants<BlendColorDodgePipeline> blend_colordodge_pipelines_;
905 mutable Variants<BlendDarkenPipeline> blend_darken_pipelines_;
906 mutable Variants<BlendDifferencePipeline> blend_difference_pipelines_;
907 mutable Variants<BlendExclusionPipeline> blend_exclusion_pipelines_;
908 mutable Variants<BlendHardLightPipeline> blend_hardlight_pipelines_;
909 mutable Variants<BlendHuePipeline> blend_hue_pipelines_;
910 mutable Variants<BlendLightenPipeline> blend_lighten_pipelines_;
911 mutable Variants<BlendLuminosityPipeline> blend_luminosity_pipelines_;
912 mutable Variants<BlendMultiplyPipeline> blend_multiply_pipelines_;
913 mutable Variants<BlendOverlayPipeline> blend_overlay_pipelines_;
914 mutable Variants<BlendSaturationPipeline> blend_saturation_pipelines_;
915 mutable Variants<BlendScreenPipeline> blend_screen_pipelines_;
916 mutable Variants<BlendSoftLightPipeline> blend_softlight_pipelines_;
917 // Framebuffer Advanced blends.
918 mutable Variants<FramebufferBlendColorPipeline>
919 framebuffer_blend_color_pipelines_;
920 mutable Variants<FramebufferBlendColorBurnPipeline>
921 framebuffer_blend_colorburn_pipelines_;
922 mutable Variants<FramebufferBlendColorDodgePipeline>
923 framebuffer_blend_colordodge_pipelines_;
924 mutable Variants<FramebufferBlendDarkenPipeline>
925 framebuffer_blend_darken_pipelines_;
926 mutable Variants<FramebufferBlendDifferencePipeline>
927 framebuffer_blend_difference_pipelines_;
928 mutable Variants<FramebufferBlendExclusionPipeline>
929 framebuffer_blend_exclusion_pipelines_;
930 mutable Variants<FramebufferBlendHardLightPipeline>
931 framebuffer_blend_hardlight_pipelines_;
932 mutable Variants<FramebufferBlendHuePipeline>
933 framebuffer_blend_hue_pipelines_;
934 mutable Variants<FramebufferBlendLightenPipeline>
935 framebuffer_blend_lighten_pipelines_;
936 mutable Variants<FramebufferBlendLuminosityPipeline>
937 framebuffer_blend_luminosity_pipelines_;
938 mutable Variants<FramebufferBlendMultiplyPipeline>
939 framebuffer_blend_multiply_pipelines_;
940 mutable Variants<FramebufferBlendOverlayPipeline>
941 framebuffer_blend_overlay_pipelines_;
942 mutable Variants<FramebufferBlendSaturationPipeline>
943 framebuffer_blend_saturation_pipelines_;
944 mutable Variants<FramebufferBlendScreenPipeline>
945 framebuffer_blend_screen_pipelines_;
946 mutable Variants<FramebufferBlendSoftLightPipeline>
947 framebuffer_blend_softlight_pipelines_;
948 mutable Variants<VerticesUberShader> vertices_uber_shader_;
949
950 template <class TypedPipeline>
951 std::shared_ptr<Pipeline<PipelineDescriptor>> GetPipeline(
952 Variants<TypedPipeline>& container,
953 ContentContextOptions opts) const {
954 TypedPipeline* pipeline = CreateIfNeeded(container, opts);
955 if (!pipeline) {
956 return nullptr;
957 }
958 return pipeline->WaitAndGet();
959 }
960
961 template <class RenderPipelineHandleT>
962 RenderPipelineHandleT* CreateIfNeeded(
963 Variants<RenderPipelineHandleT>& container,
964 ContentContextOptions opts) const {
965 if (!IsValid()) {
966 return nullptr;
967 }
968
969 if (wireframe_) {
970 opts.wireframe = true;
971 }
972
973 if (RenderPipelineHandleT* found = container.Get(opts)) {
974 return found;
975 }
976
977 RenderPipelineHandleT* default_handle = container.GetDefault();
978
979 // The default must always be initialized in the constructor.
980 FML_CHECK(default_handle != nullptr);
981
982 std::shared_ptr<Pipeline<PipelineDescriptor>> pipeline =
983 default_handle->WaitAndGet();
984 if (!pipeline) {
985 return nullptr;
986 }
987
988 auto variant_future = pipeline->CreateVariant(
989 /*async=*/false, [&opts, variants_count = container.GetPipelineCount()](
990 PipelineDescriptor& desc) {
991 opts.ApplyToPipelineDescriptor(desc);
992 desc.SetLabel(
993 SPrintF("%s V#%zu", desc.GetLabel().c_str(), variants_count));
994 });
995 std::unique_ptr<RenderPipelineHandleT> variant =
996 std::make_unique<RenderPipelineHandleT>(std::move(variant_future));
997 container.Set(opts, std::move(variant));
998 return container.Get(opts);
999 }
1000
1001 bool is_valid_ = false;
1002 std::shared_ptr<Tessellator> tessellator_;
1003#if IMPELLER_ENABLE_3D
1004 std::shared_ptr<scene::SceneContext> scene_context_;
1005#endif // IMPELLER_ENABLE_3D
1006 std::shared_ptr<RenderTargetAllocator> render_target_cache_;
1007 std::shared_ptr<HostBuffer> host_buffer_;
1008 std::shared_ptr<Texture> empty_texture_;
1009 bool wireframe_ = false;
1010
1011 ContentContext(const ContentContext&) = delete;
1012
1013 ContentContext& operator=(const ContentContext&) = delete;
1014};
1015
1016} // namespace impeller
1017
1018#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
const char * options
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetConicalGradientSSBOFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRadialGradientFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendSoftLightPipeline(ContentContextOptions opts) const
std::shared_ptr< Tessellator > GetTessellator() const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
std::shared_ptr< Texture > GetEmptyTexture() const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendScreenPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendSaturationPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBorderMaskBlurPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTiledTexturePipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSweepGradientFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendDarkenPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
ContentContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendOverlayPipeline(ContentContextOptions opts) const
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
fml::StatusOr< RenderTarget > MakeSubpass(std::string_view label, ISize texture_size, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback, bool msaa_enabled=true, bool depth_stencil_enabled=false, int32_t mip_count=1) const
Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing t...
const Capabilities & GetDeviceCapabilities() const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTexturePipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendLuminosityPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGaussianBlurPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendHuePipeline(ContentContextOptions opts) const
void SetWireframe(bool wireframe)
std::shared_ptr< Pipeline< PipelineDescriptor > > GetGlyphAtlasPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFastGradientPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor > >()> &create_callback) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetDrawVerticesUberShader(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendColorBurnPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendColorDodgePipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendColorPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendExclusionPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetConicalGradientFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendDifferencePipeline(ContentContextOptions opts) const
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendHardLightPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRRectBlurPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetClipPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetLinearGradientFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetMorphologyFilterPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetPorterDuffBlendPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendMultiplyPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetTextureStrictSrcPipeline(ContentContextOptions opts) const
std::shared_ptr< Context > GetContext() const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetBlendLightenPipeline(ContentContextOptions opts) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:33
#define FML_CHECK(condition)
Definition: logging.h:85
#define FML_DCHECK(condition)
Definition: logging.h:103
Dart_NativeFunction function
Definition: fuchsia.cc:51
const GrXPFactory * Get(SkBlendMode mode)
static uint32_t Hash(uint32_t key)
Definition: hashmap_test.cc:65
constexpr std::size_t HashCombine()
Definition: hash_combine.h:25
PrimitiveType
Decides how backend draws pixels based on input vertices.
Definition: formats.h:352
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99
CompareFunction
Definition: formats.h:546
@ kAlways
Comparison test passes always passes.
BlendMode
Definition: color.h:59
SampleCount
Definition: formats.h:295
constexpr bool operator()(const ContentContextOptions &lhs, const ContentContextOptions &rhs) const
constexpr uint64_t operator()(const ContentContextOptions &o) const
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
constexpr bool operator()(const RuntimeEffectPipelineKey &lhs, const RuntimeEffectPipelineKey &rhs) const
std::size_t operator()(const RuntimeEffectPipelineKey &key) const
#define VALIDATION_LOG
Definition: validation.h:73