5 #ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
8 #include <initializer_list>
11 #include <unordered_map>
13 #include "flutter/fml/logging.h"
14 #include "flutter/fml/status_or.h"
27 #include "impeller/entity/border_mask_blur.frag.h"
28 #include "impeller/entity/clip.frag.h"
29 #include "impeller/entity/clip.vert.h"
30 #include "impeller/entity/color_matrix_color_filter.frag.h"
31 #include "impeller/entity/conical_gradient_fill.frag.h"
32 #include "impeller/entity/fast_gradient.frag.h"
33 #include "impeller/entity/fast_gradient.vert.h"
34 #include "impeller/entity/filter_position.vert.h"
35 #include "impeller/entity/filter_position_uv.vert.h"
36 #include "impeller/entity/gaussian.frag.h"
37 #include "impeller/entity/glyph_atlas.frag.h"
38 #include "impeller/entity/glyph_atlas.vert.h"
39 #include "impeller/entity/gradient_fill.vert.h"
40 #include "impeller/entity/linear_gradient_fill.frag.h"
41 #include "impeller/entity/linear_to_srgb_filter.frag.h"
42 #include "impeller/entity/morphology_filter.frag.h"
43 #include "impeller/entity/porter_duff_blend.frag.h"
44 #include "impeller/entity/porter_duff_blend.vert.h"
45 #include "impeller/entity/radial_gradient_fill.frag.h"
46 #include "impeller/entity/rrect_blur.frag.h"
47 #include "impeller/entity/rrect_blur.vert.h"
48 #include "impeller/entity/solid_fill.frag.h"
49 #include "impeller/entity/solid_fill.vert.h"
50 #include "impeller/entity/srgb_to_linear_filter.frag.h"
51 #include "impeller/entity/sweep_gradient_fill.frag.h"
52 #include "impeller/entity/texture_downsample.frag.h"
53 #include "impeller/entity/texture_fill.frag.h"
54 #include "impeller/entity/texture_fill.vert.h"
55 #include "impeller/entity/texture_fill_strict_src.frag.h"
56 #include "impeller/entity/texture_uv_fill.vert.h"
57 #include "impeller/entity/tiled_texture_fill.frag.h"
58 #include "impeller/entity/yuv_to_rgb_filter.frag.h"
60 #include "impeller/entity/conical_gradient_uniform_fill.frag.h"
61 #include "impeller/entity/linear_gradient_uniform_fill.frag.h"
62 #include "impeller/entity/radial_gradient_uniform_fill.frag.h"
63 #include "impeller/entity/sweep_gradient_uniform_fill.frag.h"
65 #include "impeller/entity/conical_gradient_ssbo_fill.frag.h"
66 #include "impeller/entity/linear_gradient_ssbo_fill.frag.h"
67 #include "impeller/entity/radial_gradient_ssbo_fill.frag.h"
68 #include "impeller/entity/sweep_gradient_ssbo_fill.frag.h"
70 #include "impeller/entity/advanced_blend.frag.h"
71 #include "impeller/entity/advanced_blend.vert.h"
73 #include "impeller/entity/framebuffer_blend.frag.h"
74 #include "impeller/entity/framebuffer_blend.vert.h"
76 #include "impeller/entity/vertices_uber.frag.h"
78 #ifdef IMPELLER_ENABLE_OPENGLES
79 #include "impeller/entity/texture_downsample_gles.frag.h"
80 #include "impeller/entity/tiled_texture_fill_external.frag.h"
89 LinearGradientFillFragmentShader>;
94 RadialGradientFillFragmentShader>;
97 ConicalGradientFillFragmentShader>;
100 SweepGradientFillFragmentShader>;
103 LinearGradientUniformFillFragmentShader>;
106 ConicalGradientUniformFillFragmentShader>;
109 RadialGradientUniformFillFragmentShader>;
112 SweepGradientUniformFillFragmentShader>;
115 LinearGradientSsboFillFragmentShader>;
118 ConicalGradientSsboFillFragmentShader>;
121 RadialGradientSsboFillFragmentShader>;
124 SweepGradientSsboFillFragmentShader>;
131 TextureDownsampleFragmentShader>;
134 TextureFillStrictSrcFragmentShader>;
137 TiledTextureFillFragmentShader>;
142 BorderMaskBlurFragmentShader>;
145 MorphologyFilterFragmentShader>;
148 ColorMatrixColorFilterFragmentShader>;
151 LinearToSrgbFilterFragmentShader>;
154 SrgbToLinearFilterFragmentShader>;
157 YuvToRgbFilterFragmentShader>;
164 PorterDuffBlendFragmentShader>;
169 AdvancedBlendFragmentShader>;
172 AdvancedBlendFragmentShader>;
175 AdvancedBlendFragmentShader>;
177 AdvancedBlendFragmentShader>;
180 AdvancedBlendFragmentShader>;
183 AdvancedBlendFragmentShader>;
186 AdvancedBlendFragmentShader>;
188 AdvancedBlendFragmentShader>;
190 AdvancedBlendFragmentShader>;
193 AdvancedBlendFragmentShader>;
195 AdvancedBlendFragmentShader>;
197 AdvancedBlendFragmentShader>;
200 AdvancedBlendFragmentShader>;
202 AdvancedBlendFragmentShader>;
205 AdvancedBlendFragmentShader>;
209 FramebufferBlendFragmentShader>;
212 FramebufferBlendFragmentShader>;
215 FramebufferBlendFragmentShader>;
218 FramebufferBlendFragmentShader>;
221 FramebufferBlendFragmentShader>;
224 FramebufferBlendFragmentShader>;
227 FramebufferBlendFragmentShader>;
230 FramebufferBlendFragmentShader>;
233 FramebufferBlendFragmentShader>;
236 FramebufferBlendFragmentShader>;
239 FramebufferBlendFragmentShader>;
242 FramebufferBlendFragmentShader>;
245 FramebufferBlendFragmentShader>;
248 FramebufferBlendFragmentShader>;
251 FramebufferBlendFragmentShader>;
255 VerticesUberFragmentShader>;
257 #ifdef IMPELLER_ENABLE_OPENGLES
258 using TiledTextureExternalPipeline =
260 TiledTextureFillExternalFragmentShader>;
261 using TiledTextureUvExternalPipeline =
263 TiledTextureFillExternalFragmentShader>;
264 using TextureDownsampleGlesPipeline =
266 TextureDownsampleGlesFragmentShader>;
369 class RenderTargetCache;
374 std::shared_ptr<Context> context,
375 std::shared_ptr<TypographerContext> typographer_context,
376 std::shared_ptr<RenderTargetAllocator> render_target_allocator =
nullptr);
385 return GetPipeline(fast_gradient_pipelines_, opts);
389 return GetPipeline(linear_gradient_fill_pipelines_, opts);
394 return GetPipeline(linear_gradient_uniform_fill_pipelines_, opts);
399 return GetPipeline(radial_gradient_uniform_fill_pipelines_, opts);
404 return GetPipeline(conical_gradient_uniform_fill_pipelines_, opts);
409 return GetPipeline(sweep_gradient_uniform_fill_pipelines_, opts);
415 return GetPipeline(linear_gradient_ssbo_fill_pipelines_, opts);
421 return GetPipeline(radial_gradient_ssbo_fill_pipelines_, opts);
427 return GetPipeline(conical_gradient_ssbo_fill_pipelines_, opts);
433 return GetPipeline(sweep_gradient_ssbo_fill_pipelines_, opts);
437 return GetPipeline(radial_gradient_fill_pipelines_, opts);
441 return GetPipeline(conical_gradient_fill_pipelines_, opts);
445 return GetPipeline(rrect_blur_pipelines_, opts);
449 return GetPipeline(sweep_gradient_fill_pipelines_, opts);
453 return GetPipeline(solid_fill_pipelines_, opts);
457 return GetPipeline(texture_pipelines_, opts);
461 return GetPipeline(texture_strict_src_pipelines_, opts);
464 #ifdef IMPELLER_ENABLE_OPENGLES
467 return GetPipeline(texture_downsample_gles_pipelines_, opts);
471 ContentContextOptions opts)
const {
474 return GetPipeline(tiled_texture_external_pipelines_, opts);
478 ContentContextOptions opts)
const {
481 return GetPipeline(tiled_texture_uv_external_pipelines_, opts);
486 return GetPipeline(tiled_texture_pipelines_, opts);
490 return GetPipeline(gaussian_blur_pipelines_, opts);
494 return GetPipeline(border_mask_blur_pipelines_, opts);
498 return GetPipeline(morphology_filter_pipelines_, opts);
503 return GetPipeline(color_matrix_color_filter_pipelines_, opts);
507 return GetPipeline(linear_to_srgb_filter_pipelines_, opts);
511 return GetPipeline(srgb_to_linear_filter_pipelines_, opts);
515 return GetPipeline(clip_pipelines_, opts);
519 return GetPipeline(glyph_atlas_pipelines_, opts);
523 return GetPipeline(yuv_to_rgb_filter_pipelines_, opts);
582 return GetPipeline(clear_blend_pipelines_, opts);
586 return GetPipeline(source_blend_pipelines_, opts);
590 return GetPipeline(destination_blend_pipelines_, opts);
594 return GetPipeline(source_over_blend_pipelines_, opts);
599 return GetPipeline(destination_over_blend_pipelines_, opts);
603 return GetPipeline(source_in_blend_pipelines_, opts);
607 return GetPipeline(destination_in_blend_pipelines_, opts);
611 return GetPipeline(source_out_blend_pipelines_, opts);
615 return GetPipeline(destination_out_blend_pipelines_, opts);
619 return GetPipeline(source_a_top_blend_pipelines_, opts);
624 return GetPipeline(destination_a_top_blend_pipelines_, opts);
628 return GetPipeline(xor_blend_pipelines_, opts);
632 return GetPipeline(plus_blend_pipelines_, opts);
636 return GetPipeline(modulate_blend_pipelines_, opts);
640 return GetPipeline(screen_blend_pipelines_, opts);
646 return GetPipeline(blend_color_pipelines_, opts);
650 return GetPipeline(blend_colorburn_pipelines_, opts);
654 return GetPipeline(blend_colordodge_pipelines_, opts);
658 return GetPipeline(blend_darken_pipelines_, opts);
662 return GetPipeline(blend_difference_pipelines_, opts);
666 return GetPipeline(blend_exclusion_pipelines_, opts);
670 return GetPipeline(blend_hardlight_pipelines_, opts);
674 return GetPipeline(blend_hue_pipelines_, opts);
678 return GetPipeline(blend_lighten_pipelines_, opts);
682 return GetPipeline(blend_luminosity_pipelines_, opts);
686 return GetPipeline(blend_multiply_pipelines_, opts);
690 return GetPipeline(blend_overlay_pipelines_, opts);
694 return GetPipeline(blend_saturation_pipelines_, opts);
698 return GetPipeline(blend_screen_pipelines_, opts);
702 return GetPipeline(blend_softlight_pipelines_, opts);
706 return GetPipeline(texture_downsample_pipelines_, opts);
713 return GetPipeline(framebuffer_blend_color_pipelines_, opts);
719 return GetPipeline(framebuffer_blend_colorburn_pipelines_, opts);
725 return GetPipeline(framebuffer_blend_colordodge_pipelines_, opts);
731 return GetPipeline(framebuffer_blend_darken_pipelines_, opts);
737 return GetPipeline(framebuffer_blend_difference_pipelines_, opts);
743 return GetPipeline(framebuffer_blend_exclusion_pipelines_, opts);
749 return GetPipeline(framebuffer_blend_hardlight_pipelines_, opts);
754 return GetPipeline(framebuffer_blend_hue_pipelines_, opts);
760 return GetPipeline(framebuffer_blend_lighten_pipelines_, opts);
766 return GetPipeline(framebuffer_blend_luminosity_pipelines_, opts);
772 return GetPipeline(framebuffer_blend_multiply_pipelines_, opts);
778 return GetPipeline(framebuffer_blend_overlay_pipelines_, opts);
784 return GetPipeline(framebuffer_blend_saturation_pipelines_, opts);
790 return GetPipeline(framebuffer_blend_screen_pipelines_, opts);
796 return GetPipeline(framebuffer_blend_softlight_pipelines_, opts);
800 return GetPipeline(vertices_uber_shader_, opts);
819 std::string_view label,
821 const std::shared_ptr<CommandBuffer>& command_buffer,
823 bool msaa_enabled =
true,
824 bool depth_stencil_enabled =
false,
825 int32_t mip_count = 1)
const;
829 std::string_view label,
831 const std::shared_ptr<CommandBuffer>& command_buffer,
835 return lazy_glyph_atlas_;
839 return render_target_cache_;
852 const std::string& unique_entrypoint_name,
855 create_callback)
const;
860 const std::string& unique_entrypoint_name)
const;
869 std::shared_ptr<Context> context_;
870 std::shared_ptr<LazyGlyphAtlas> lazy_glyph_atlas_;
878 void InitializeCommonlyUsedShadersIfNeeded()
const;
880 struct RuntimeEffectPipelineKey {
881 std::string unique_entrypoint_name;
885 std::size_t
operator()(
const RuntimeEffectPipelineKey& key)
const {
886 return fml::HashCombine(key.unique_entrypoint_name,
887 key.options.ToKey());
892 constexpr
bool operator()(
const RuntimeEffectPipelineKey& lhs,
893 const RuntimeEffectPipelineKey& rhs)
const {
894 return lhs.unique_entrypoint_name == rhs.unique_entrypoint_name &&
895 lhs.options.ToKey() == rhs.options.ToKey();
900 mutable std::unordered_map<RuntimeEffectPipelineKey,
901 std::shared_ptr<Pipeline<PipelineDescriptor>>,
902 RuntimeEffectPipelineKey::Hash,
903 RuntimeEffectPipelineKey::Equal>
904 runtime_effect_pipelines_;
919 template <
class PipelineHandleT>
922 Variants() =
default;
925 std::unique_ptr<PipelineHandleT> pipeline) {
926 uint64_t p_key = options.
ToKey();
927 for (
const auto& [key, pipeline] : pipelines_) {
932 pipelines_.push_back(std::make_pair(p_key, std::move(pipeline)));
935 void SetDefault(
const ContentContextOptions& options,
936 std::unique_ptr<PipelineHandleT> pipeline) {
937 default_options_ = options;
938 Set(options, std::move(pipeline));
941 void CreateDefault(
const Context& context,
942 const ContentContextOptions& options,
943 const std::vector<Scalar>& constants = {}) {
944 auto desc = PipelineHandleT::Builder::MakeDefaultPipelineDescriptor(
946 if (!desc.has_value()) {
950 options.ApplyToPipelineDescriptor(*desc);
951 SetDefault(options, std::make_unique<PipelineHandleT>(context, desc));
954 PipelineHandleT* Get(
const ContentContextOptions& options)
const {
955 uint64_t p_key = options.ToKey();
956 for (
const auto& [key, pipeline] : pipelines_) {
958 return pipeline.get();
964 PipelineHandleT* GetDefault()
const {
965 if (!default_options_.has_value()) {
968 return Get(default_options_.value());
971 size_t GetPipelineCount()
const {
return pipelines_.size(); }
974 std::optional<ContentContextOptions> default_options_;
975 std::vector<std::pair<uint64_t, std::unique_ptr<PipelineHandleT>>>
978 Variants(
const Variants&) =
delete;
980 Variants& operator=(
const Variants&) =
delete;
987 mutable Variants<SolidFillPipeline> solid_fill_pipelines_;
988 mutable Variants<FastGradientPipeline> fast_gradient_pipelines_;
989 mutable Variants<LinearGradientFillPipeline> linear_gradient_fill_pipelines_;
990 mutable Variants<RadialGradientFillPipeline> radial_gradient_fill_pipelines_;
991 mutable Variants<ConicalGradientFillPipeline>
992 conical_gradient_fill_pipelines_;
993 mutable Variants<SweepGradientFillPipeline> sweep_gradient_fill_pipelines_;
994 mutable Variants<LinearGradientUniformFillPipeline>
995 linear_gradient_uniform_fill_pipelines_;
996 mutable Variants<RadialGradientUniformFillPipeline>
997 radial_gradient_uniform_fill_pipelines_;
998 mutable Variants<ConicalGradientUniformFillPipeline>
999 conical_gradient_uniform_fill_pipelines_;
1000 mutable Variants<SweepGradientUniformFillPipeline>
1001 sweep_gradient_uniform_fill_pipelines_;
1002 mutable Variants<LinearGradientSSBOFillPipeline>
1003 linear_gradient_ssbo_fill_pipelines_;
1004 mutable Variants<RadialGradientSSBOFillPipeline>
1005 radial_gradient_ssbo_fill_pipelines_;
1006 mutable Variants<ConicalGradientSSBOFillPipeline>
1007 conical_gradient_ssbo_fill_pipelines_;
1008 mutable Variants<SweepGradientSSBOFillPipeline>
1009 sweep_gradient_ssbo_fill_pipelines_;
1010 mutable Variants<RRectBlurPipeline> rrect_blur_pipelines_;
1011 mutable Variants<TexturePipeline> texture_pipelines_;
1012 mutable Variants<TextureDownsamplePipeline> texture_downsample_pipelines_;
1013 mutable Variants<TextureStrictSrcPipeline> texture_strict_src_pipelines_;
1014 #ifdef IMPELLER_ENABLE_OPENGLES
1015 mutable Variants<TiledTextureExternalPipeline>
1016 tiled_texture_external_pipelines_;
1017 mutable Variants<TextureDownsampleGlesPipeline>
1018 texture_downsample_gles_pipelines_;
1019 mutable Variants<TiledTextureUvExternalPipeline>
1020 tiled_texture_uv_external_pipelines_;
1022 mutable Variants<TiledTexturePipeline> tiled_texture_pipelines_;
1023 mutable Variants<GaussianBlurPipeline> gaussian_blur_pipelines_;
1024 mutable Variants<BorderMaskBlurPipeline> border_mask_blur_pipelines_;
1025 mutable Variants<MorphologyFilterPipeline> morphology_filter_pipelines_;
1026 mutable Variants<ColorMatrixColorFilterPipeline>
1027 color_matrix_color_filter_pipelines_;
1028 mutable Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter_pipelines_;
1029 mutable Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter_pipelines_;
1030 mutable Variants<ClipPipeline> clip_pipelines_;
1031 mutable Variants<GlyphAtlasPipeline> glyph_atlas_pipelines_;
1032 mutable Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter_pipelines_;
1035 mutable Variants<PorterDuffBlendPipeline> clear_blend_pipelines_;
1036 mutable Variants<PorterDuffBlendPipeline> source_blend_pipelines_;
1037 mutable Variants<PorterDuffBlendPipeline> destination_blend_pipelines_;
1038 mutable Variants<PorterDuffBlendPipeline> source_over_blend_pipelines_;
1039 mutable Variants<PorterDuffBlendPipeline> destination_over_blend_pipelines_;
1040 mutable Variants<PorterDuffBlendPipeline> source_in_blend_pipelines_;
1041 mutable Variants<PorterDuffBlendPipeline> destination_in_blend_pipelines_;
1042 mutable Variants<PorterDuffBlendPipeline> source_out_blend_pipelines_;
1043 mutable Variants<PorterDuffBlendPipeline> destination_out_blend_pipelines_;
1044 mutable Variants<PorterDuffBlendPipeline> source_a_top_blend_pipelines_;
1045 mutable Variants<PorterDuffBlendPipeline> destination_a_top_blend_pipelines_;
1046 mutable Variants<PorterDuffBlendPipeline> xor_blend_pipelines_;
1047 mutable Variants<PorterDuffBlendPipeline> plus_blend_pipelines_;
1048 mutable Variants<PorterDuffBlendPipeline> modulate_blend_pipelines_;
1049 mutable Variants<PorterDuffBlendPipeline> screen_blend_pipelines_;
1052 mutable Variants<BlendColorPipeline> blend_color_pipelines_;
1053 mutable Variants<BlendColorBurnPipeline> blend_colorburn_pipelines_;
1054 mutable Variants<BlendColorDodgePipeline> blend_colordodge_pipelines_;
1055 mutable Variants<BlendDarkenPipeline> blend_darken_pipelines_;
1056 mutable Variants<BlendDifferencePipeline> blend_difference_pipelines_;
1057 mutable Variants<BlendExclusionPipeline> blend_exclusion_pipelines_;
1058 mutable Variants<BlendHardLightPipeline> blend_hardlight_pipelines_;
1059 mutable Variants<BlendHuePipeline> blend_hue_pipelines_;
1060 mutable Variants<BlendLightenPipeline> blend_lighten_pipelines_;
1061 mutable Variants<BlendLuminosityPipeline> blend_luminosity_pipelines_;
1062 mutable Variants<BlendMultiplyPipeline> blend_multiply_pipelines_;
1063 mutable Variants<BlendOverlayPipeline> blend_overlay_pipelines_;
1064 mutable Variants<BlendSaturationPipeline> blend_saturation_pipelines_;
1065 mutable Variants<BlendScreenPipeline> blend_screen_pipelines_;
1066 mutable Variants<BlendSoftLightPipeline> blend_softlight_pipelines_;
1068 mutable Variants<FramebufferBlendColorPipeline>
1069 framebuffer_blend_color_pipelines_;
1070 mutable Variants<FramebufferBlendColorBurnPipeline>
1071 framebuffer_blend_colorburn_pipelines_;
1072 mutable Variants<FramebufferBlendColorDodgePipeline>
1073 framebuffer_blend_colordodge_pipelines_;
1074 mutable Variants<FramebufferBlendDarkenPipeline>
1075 framebuffer_blend_darken_pipelines_;
1076 mutable Variants<FramebufferBlendDifferencePipeline>
1077 framebuffer_blend_difference_pipelines_;
1078 mutable Variants<FramebufferBlendExclusionPipeline>
1079 framebuffer_blend_exclusion_pipelines_;
1080 mutable Variants<FramebufferBlendHardLightPipeline>
1081 framebuffer_blend_hardlight_pipelines_;
1082 mutable Variants<FramebufferBlendHuePipeline>
1083 framebuffer_blend_hue_pipelines_;
1084 mutable Variants<FramebufferBlendLightenPipeline>
1085 framebuffer_blend_lighten_pipelines_;
1086 mutable Variants<FramebufferBlendLuminosityPipeline>
1087 framebuffer_blend_luminosity_pipelines_;
1088 mutable Variants<FramebufferBlendMultiplyPipeline>
1089 framebuffer_blend_multiply_pipelines_;
1090 mutable Variants<FramebufferBlendOverlayPipeline>
1091 framebuffer_blend_overlay_pipelines_;
1092 mutable Variants<FramebufferBlendSaturationPipeline>
1093 framebuffer_blend_saturation_pipelines_;
1094 mutable Variants<FramebufferBlendScreenPipeline>
1095 framebuffer_blend_screen_pipelines_;
1096 mutable Variants<FramebufferBlendSoftLightPipeline>
1097 framebuffer_blend_softlight_pipelines_;
1098 mutable Variants<VerticesUberShader> vertices_uber_shader_;
1100 template <
class TypedPipeline>
1101 PipelineRef GetPipeline(Variants<TypedPipeline>& container,
1102 ContentContextOptions opts)
const {
1103 TypedPipeline* pipeline = CreateIfNeeded(container, opts);
1105 return raw_ptr<Pipeline<PipelineDescriptor>>();
1107 return raw_ptr(pipeline->WaitAndGet());
1110 template <
class RenderPipelineHandleT>
1111 RenderPipelineHandleT* CreateIfNeeded(
1112 Variants<RenderPipelineHandleT>& container,
1113 ContentContextOptions opts)
const {
1119 opts.wireframe =
true;
1122 if (RenderPipelineHandleT* found = container.Get(opts)) {
1126 RenderPipelineHandleT* default_handle = container.GetDefault();
1129 FML_CHECK(default_handle !=
nullptr);
1131 const std::shared_ptr<Pipeline<PipelineDescriptor>>& pipeline =
1132 default_handle->WaitAndGet();
1137 auto variant_future = pipeline->CreateVariant(
1138 false, [&opts, variants_count = container.GetPipelineCount()](
1139 PipelineDescriptor& desc) {
1140 opts.ApplyToPipelineDescriptor(desc);
1142 SPrintF(
"%s V#%zu", desc.GetLabel().data(), variants_count));
1144 std::unique_ptr<RenderPipelineHandleT> variant =
1145 std::make_unique<RenderPipelineHandleT>(std::move(variant_future));
1146 container.Set(opts, std::move(variant));
1147 return container.Get(opts);
1150 bool is_valid_ =
false;
1151 std::shared_ptr<Tessellator> tessellator_;
1152 std::shared_ptr<RenderTargetAllocator> render_target_cache_;
1153 std::shared_ptr<HostBuffer> host_buffer_;
1154 std::shared_ptr<Texture> empty_texture_;
1155 bool wireframe_ =
false;
PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
std::shared_ptr< Texture > GetEmptyTexture() const
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
ContentContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const
PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts) const
fml::StatusOr< RenderTarget > MakeSubpass(std::string_view label, ISize texture_size, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback, bool msaa_enabled=true, bool depth_stencil_enabled=false, int32_t mip_count=1) const
Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing t...
const Capabilities & GetDeviceCapabilities() const
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const
PipelineRef GetCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor >>()> &create_callback) const
PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetDrawVerticesUberShader(ContentContextOptions opts) const
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const
void SetWireframe(bool wireframe)
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const
PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const
PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
PipelineRef GetClipPipeline(ContentContextOptions opts) const
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const
PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
Tessellator & GetTessellator() const
PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const
PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
std::shared_ptr< Context > GetContext() const
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const
Render passes encode render commands directed as one specific render target into an underlying comman...
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
PrimitiveType
Decides how backend draws pixels based on input vertices.
raw_ptr< Pipeline< PipelineDescriptor > > PipelineRef
A raw ptr to a pipeline object.
const char * BlendModeToString(BlendMode blend_mode)
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
@ kAlways
Comparison test passes always passes.
constexpr bool operator()(const RuntimeEffectPipelineKey &lhs, const RuntimeEffectPipelineKey &rhs) const
std::size_t operator()(const RuntimeEffectPipelineKey &key) const
PrimitiveType primitive_type
bool has_depth_stencil_attachments
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
constexpr uint64_t ToKey() const
PixelFormat color_attachment_pixel_format
@ kOverdrawPreventionRestore
@ kOverdrawPreventionIncrement
bool is_for_rrect_blur_clear
CompareFunction depth_compare