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/build_config.h"
14#include "flutter/fml/logging.h"
15#include "flutter/fml/status_or.h"
28#include "impeller/entity/checkerboard.frag.h"
29#include "impeller/entity/checkerboard.vert.h"
32#include "impeller/entity/border_mask_blur.frag.h"
33#include "impeller/entity/clip.frag.h"
34#include "impeller/entity/clip.vert.h"
35#include "impeller/entity/color_matrix_color_filter.frag.h"
36#include "impeller/entity/conical_gradient_fill.frag.h"
37#include "impeller/entity/filter_position.vert.h"
38#include "impeller/entity/filter_position_uv.vert.h"
39#include "impeller/entity/gaussian.frag.h"
40#include "impeller/entity/glyph_atlas.frag.h"
41#include "impeller/entity/glyph_atlas.vert.h"
42#include "impeller/entity/gradient_fill.vert.h"
43#include "impeller/entity/linear_gradient_fill.frag.h"
44#include "impeller/entity/linear_to_srgb_filter.frag.h"
45#include "impeller/entity/morphology_filter.frag.h"
46#include "impeller/entity/porter_duff_blend.frag.h"
47#include "impeller/entity/porter_duff_blend.vert.h"
48#include "impeller/entity/radial_gradient_fill.frag.h"
49#include "impeller/entity/rrect_blur.frag.h"
50#include "impeller/entity/rrect_blur.vert.h"
51#include "impeller/entity/solid_fill.frag.h"
52#include "impeller/entity/solid_fill.vert.h"
53#include "impeller/entity/srgb_to_linear_filter.frag.h"
54#include "impeller/entity/sweep_gradient_fill.frag.h"
55#include "impeller/entity/texture_fill.frag.h"
56#include "impeller/entity/texture_fill.vert.h"
57#include "impeller/entity/texture_fill_strict_src.frag.h"
58#include "impeller/entity/texture_uv_fill.vert.h"
59#include "impeller/entity/tiled_texture_fill.frag.h"
60#include "impeller/entity/yuv_to_rgb_filter.frag.h"
64#include "impeller/entity/conical_gradient_ssbo_fill.frag.h"
65#include "impeller/entity/linear_gradient_ssbo_fill.frag.h"
66#include "impeller/entity/radial_gradient_ssbo_fill.frag.h"
67#include "impeller/entity/sweep_gradient_ssbo_fill.frag.h"
69#include "impeller/entity/advanced_blend.frag.h"
70#include "impeller/entity/advanced_blend.vert.h"
72#include "impeller/entity/framebuffer_blend.frag.h"
73#include "impeller/entity/framebuffer_blend.vert.h"
75#include "impeller/entity/vertices_uber.frag.h"
77#ifdef IMPELLER_ENABLE_OPENGLES
78#include "impeller/entity/tiled_texture_fill_external.frag.h"
88using CheckerboardPipeline =
89 RenderPipelineHandle<CheckerboardVertexShader, CheckerboardFragmentShader>;
94 LinearGradientFillFragmentShader>;
99 RadialGradientFillFragmentShader>;
102 ConicalGradientFillFragmentShader>;
105 SweepGradientFillFragmentShader>;
108 LinearGradientSsboFillFragmentShader>;
111 ConicalGradientSsboFillFragmentShader>;
114 RadialGradientSsboFillFragmentShader>;
117 SweepGradientSsboFillFragmentShader>;
124 TextureFillStrictSrcFragmentShader>;
127 TiledTextureFillFragmentShader>;
132 BorderMaskBlurFragmentShader>;
135 MorphologyFilterFragmentShader>;
138 ColorMatrixColorFilterFragmentShader>;
141 LinearToSrgbFilterFragmentShader>;
144 SrgbToLinearFilterFragmentShader>;
147 YuvToRgbFilterFragmentShader>;
154 PorterDuffBlendFragmentShader>;
159 AdvancedBlendFragmentShader>;
162 AdvancedBlendFragmentShader>;
165 AdvancedBlendFragmentShader>;
167 AdvancedBlendFragmentShader>;
170 AdvancedBlendFragmentShader>;
173 AdvancedBlendFragmentShader>;
176 AdvancedBlendFragmentShader>;
178 AdvancedBlendFragmentShader>;
180 AdvancedBlendFragmentShader>;
183 AdvancedBlendFragmentShader>;
185 AdvancedBlendFragmentShader>;
187 AdvancedBlendFragmentShader>;
190 AdvancedBlendFragmentShader>;
192 AdvancedBlendFragmentShader>;
195 AdvancedBlendFragmentShader>;
199 FramebufferBlendFragmentShader>;
202 FramebufferBlendFragmentShader>;
205 FramebufferBlendFragmentShader>;
208 FramebufferBlendFragmentShader>;
211 FramebufferBlendFragmentShader>;
214 FramebufferBlendFragmentShader>;
217 FramebufferBlendFragmentShader>;
220 FramebufferBlendFragmentShader>;
223 FramebufferBlendFragmentShader>;
226 FramebufferBlendFragmentShader>;
229 FramebufferBlendFragmentShader>;
232 FramebufferBlendFragmentShader>;
235 FramebufferBlendFragmentShader>;
238 FramebufferBlendFragmentShader>;
241 FramebufferBlendFragmentShader>;
245 VerticesUberFragmentShader>;
247#ifdef IMPELLER_ENABLE_OPENGLES
248using TiledTextureExternalPipeline =
250 TiledTextureFillExternalFragmentShader>;
373class RenderTargetCache;
378 std::shared_ptr<Context> context,
379 std::shared_ptr<TypographerContext> typographer_context,
380 std::shared_ptr<RenderTargetAllocator> render_target_allocator =
nullptr);
386#if IMPELLER_ENABLE_3D
387 std::shared_ptr<scene::SceneContext> GetSceneContext()
const;
393 std::shared_ptr<Pipeline<PipelineDescriptor>> GetCheckerboardPipeline(
395 return GetPipeline(checkerboard_pipelines_, opts);
401 return GetPipeline(linear_gradient_fill_pipelines_, opts);
404 std::shared_ptr<Pipeline<PipelineDescriptor>>
407 return GetPipeline(linear_gradient_ssbo_fill_pipelines_, opts);
410 std::shared_ptr<Pipeline<PipelineDescriptor>>
413 return GetPipeline(radial_gradient_ssbo_fill_pipelines_, opts);
416 std::shared_ptr<Pipeline<PipelineDescriptor>>
419 return GetPipeline(conical_gradient_ssbo_fill_pipelines_, opts);
422 std::shared_ptr<Pipeline<PipelineDescriptor>>
425 return GetPipeline(sweep_gradient_ssbo_fill_pipelines_, opts);
430 return GetPipeline(radial_gradient_fill_pipelines_, opts);
435 return GetPipeline(conical_gradient_fill_pipelines_, opts);
440 return GetPipeline(rrect_blur_pipelines_, opts);
445 return GetPipeline(sweep_gradient_fill_pipelines_, opts);
450 return GetPipeline(solid_fill_pipelines_, opts);
455 return GetPipeline(texture_pipelines_, opts);
460 return GetPipeline(texture_strict_src_pipelines_, opts);
463#ifdef IMPELLER_ENABLE_OPENGLES
464 std::shared_ptr<Pipeline<PipelineDescriptor>> GetTiledTextureExternalPipeline(
468 return GetPipeline(tiled_texture_external_pipelines_, opts);
474 return GetPipeline(tiled_texture_pipelines_, opts);
479 return GetPipeline(gaussian_blur_pipelines_, opts);
484 return GetPipeline(border_mask_blur_pipelines_, opts);
489 return GetPipeline(morphology_filter_pipelines_, opts);
492 std::shared_ptr<Pipeline<PipelineDescriptor>>
494 return GetPipeline(color_matrix_color_filter_pipelines_, opts);
499 return GetPipeline(linear_to_srgb_filter_pipelines_, opts);
504 return GetPipeline(srgb_to_linear_filter_pipelines_, opts);
509 return GetPipeline(clip_pipelines_, opts);
514 return GetPipeline(glyph_atlas_pipelines_, opts);
519 return GetPipeline(yuv_to_rgb_filter_pipelines_, opts);
524 return GetPipeline(porter_duff_blend_pipelines_, opts);
531 return GetPipeline(blend_color_pipelines_, opts);
536 return GetPipeline(blend_colorburn_pipelines_, opts);
541 return GetPipeline(blend_colordodge_pipelines_, opts);
546 return GetPipeline(blend_darken_pipelines_, opts);
551 return GetPipeline(blend_difference_pipelines_, opts);
556 return GetPipeline(blend_exclusion_pipelines_, opts);
561 return GetPipeline(blend_hardlight_pipelines_, opts);
566 return GetPipeline(blend_hue_pipelines_, opts);
571 return GetPipeline(blend_lighten_pipelines_, opts);
576 return GetPipeline(blend_luminosity_pipelines_, opts);
581 return GetPipeline(blend_multiply_pipelines_, opts);
586 return GetPipeline(blend_overlay_pipelines_, opts);
591 return GetPipeline(blend_saturation_pipelines_, opts);
596 return GetPipeline(blend_screen_pipelines_, opts);
601 return GetPipeline(blend_softlight_pipelines_, opts);
605 std::shared_ptr<Pipeline<PipelineDescriptor>>
608 return GetPipeline(framebuffer_blend_color_pipelines_, opts);
611 std::shared_ptr<Pipeline<PipelineDescriptor>>
614 return GetPipeline(framebuffer_blend_colorburn_pipelines_, opts);
617 std::shared_ptr<Pipeline<PipelineDescriptor>>
620 return GetPipeline(framebuffer_blend_colordodge_pipelines_, opts);
623 std::shared_ptr<Pipeline<PipelineDescriptor>>
626 return GetPipeline(framebuffer_blend_darken_pipelines_, opts);
629 std::shared_ptr<Pipeline<PipelineDescriptor>>
632 return GetPipeline(framebuffer_blend_difference_pipelines_, opts);
635 std::shared_ptr<Pipeline<PipelineDescriptor>>
638 return GetPipeline(framebuffer_blend_exclusion_pipelines_, opts);
641 std::shared_ptr<Pipeline<PipelineDescriptor>>
644 return GetPipeline(framebuffer_blend_hardlight_pipelines_, opts);
650 return GetPipeline(framebuffer_blend_hue_pipelines_, opts);
653 std::shared_ptr<Pipeline<PipelineDescriptor>>
656 return GetPipeline(framebuffer_blend_lighten_pipelines_, opts);
659 std::shared_ptr<Pipeline<PipelineDescriptor>>
662 return GetPipeline(framebuffer_blend_luminosity_pipelines_, opts);
665 std::shared_ptr<Pipeline<PipelineDescriptor>>
668 return GetPipeline(framebuffer_blend_multiply_pipelines_, opts);
671 std::shared_ptr<Pipeline<PipelineDescriptor>>
674 return GetPipeline(framebuffer_blend_overlay_pipelines_, opts);
677 std::shared_ptr<Pipeline<PipelineDescriptor>>
680 return GetPipeline(framebuffer_blend_saturation_pipelines_, opts);
683 std::shared_ptr<Pipeline<PipelineDescriptor>>
686 return GetPipeline(framebuffer_blend_screen_pipelines_, opts);
689 std::shared_ptr<Pipeline<PipelineDescriptor>>
692 return GetPipeline(framebuffer_blend_softlight_pipelines_, opts);
697 return GetPipeline(vertices_uber_shader_, opts);
716 std::string_view label,
718 const std::shared_ptr<CommandBuffer>& command_buffer,
720 bool msaa_enabled =
true,
721 bool depth_stencil_enabled =
false,
722 int32_t mip_count = 1)
const;
726 std::string_view label,
728 const std::shared_ptr<CommandBuffer>& command_buffer,
732 return lazy_glyph_atlas_;
736 return render_target_cache_;
749 const std::string& unique_entrypoint_name,
752 create_callback)
const;
757 const std::string& unique_entrypoint_name)
const;
766 std::shared_ptr<Context> context_;
767 std::shared_ptr<LazyGlyphAtlas> lazy_glyph_atlas_;
775 void InitializeCommonlyUsedShadersIfNeeded()
const;
777 struct RuntimeEffectPipelineKey {
778 std::string unique_entrypoint_name;
789 constexpr bool operator()(
const RuntimeEffectPipelineKey& lhs,
790 const RuntimeEffectPipelineKey& rhs)
const {
791 return lhs.unique_entrypoint_name == rhs.unique_entrypoint_name &&
797 mutable std::unordered_map<RuntimeEffectPipelineKey,
798 std::shared_ptr<Pipeline<PipelineDescriptor>>,
799 RuntimeEffectPipelineKey::Hash,
800 RuntimeEffectPipelineKey::Equal>
801 runtime_effect_pipelines_;
816 template <
class PipelineHandleT>
819 Variants() =
default;
822 std::unique_ptr<PipelineHandleT> pipeline) {
823 pipelines_[
options] = std::move(pipeline);
826 void SetDefault(
const ContentContextOptions&
options,
827 std::unique_ptr<PipelineHandleT> pipeline) {
829 Set(
options, std::move(pipeline));
832 void CreateDefault(
const Context& context,
833 const ContentContextOptions&
options,
834 const std::initializer_list<Scalar>& constants = {}) {
835 auto desc = PipelineHandleT::Builder::MakeDefaultPipelineDescriptor(
837 if (!
desc.has_value()) {
841 options.ApplyToPipelineDescriptor(*desc);
842 SetDefault(
options, std::make_unique<PipelineHandleT>(context, desc));
845 PipelineHandleT*
Get(
const ContentContextOptions&
options)
const {
846 if (
auto found = pipelines_.find(
options); found != pipelines_.end()) {
847 return found->second.get();
852 PipelineHandleT* GetDefault()
const {
853 if (!default_options_.has_value()) {
856 return Get(default_options_.value());
859 size_t GetPipelineCount()
const {
return pipelines_.size(); }
862 std::optional<ContentContextOptions> default_options_;
863 std::unordered_map<ContentContextOptions,
864 std::unique_ptr<PipelineHandleT>,
865 ContentContextOptions::Hash,
866 ContentContextOptions::Equal>
869 Variants(
const Variants&) =
delete;
871 Variants& operator=(
const Variants&) =
delete;
879 mutable Variants<CheckerboardPipeline> checkerboard_pipelines_;
882 mutable Variants<SolidFillPipeline> solid_fill_pipelines_;
883 mutable Variants<LinearGradientFillPipeline> linear_gradient_fill_pipelines_;
884 mutable Variants<RadialGradientFillPipeline> radial_gradient_fill_pipelines_;
885 mutable Variants<ConicalGradientFillPipeline>
886 conical_gradient_fill_pipelines_;
887 mutable Variants<SweepGradientFillPipeline> sweep_gradient_fill_pipelines_;
888 mutable Variants<LinearGradientSSBOFillPipeline>
889 linear_gradient_ssbo_fill_pipelines_;
890 mutable Variants<RadialGradientSSBOFillPipeline>
891 radial_gradient_ssbo_fill_pipelines_;
892 mutable Variants<ConicalGradientSSBOFillPipeline>
893 conical_gradient_ssbo_fill_pipelines_;
894 mutable Variants<SweepGradientSSBOFillPipeline>
895 sweep_gradient_ssbo_fill_pipelines_;
896 mutable Variants<RRectBlurPipeline> rrect_blur_pipelines_;
897 mutable Variants<TexturePipeline> texture_pipelines_;
898 mutable Variants<TextureStrictSrcPipeline> texture_strict_src_pipelines_;
899#ifdef IMPELLER_ENABLE_OPENGLES
900 mutable Variants<TiledTextureExternalPipeline>
901 tiled_texture_external_pipelines_;
903 mutable Variants<TiledTexturePipeline> tiled_texture_pipelines_;
904 mutable Variants<GaussianBlurPipeline> gaussian_blur_pipelines_;
905 mutable Variants<BorderMaskBlurPipeline> border_mask_blur_pipelines_;
906 mutable Variants<MorphologyFilterPipeline> morphology_filter_pipelines_;
907 mutable Variants<ColorMatrixColorFilterPipeline>
908 color_matrix_color_filter_pipelines_;
909 mutable Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter_pipelines_;
910 mutable Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter_pipelines_;
911 mutable Variants<ClipPipeline> clip_pipelines_;
912 mutable Variants<GlyphAtlasPipeline> glyph_atlas_pipelines_;
913 mutable Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter_pipelines_;
914 mutable Variants<PorterDuffBlendPipeline> porter_duff_blend_pipelines_;
916 mutable Variants<BlendColorPipeline> blend_color_pipelines_;
917 mutable Variants<BlendColorBurnPipeline> blend_colorburn_pipelines_;
918 mutable Variants<BlendColorDodgePipeline> blend_colordodge_pipelines_;
919 mutable Variants<BlendDarkenPipeline> blend_darken_pipelines_;
920 mutable Variants<BlendDifferencePipeline> blend_difference_pipelines_;
921 mutable Variants<BlendExclusionPipeline> blend_exclusion_pipelines_;
922 mutable Variants<BlendHardLightPipeline> blend_hardlight_pipelines_;
923 mutable Variants<BlendHuePipeline> blend_hue_pipelines_;
924 mutable Variants<BlendLightenPipeline> blend_lighten_pipelines_;
925 mutable Variants<BlendLuminosityPipeline> blend_luminosity_pipelines_;
926 mutable Variants<BlendMultiplyPipeline> blend_multiply_pipelines_;
927 mutable Variants<BlendOverlayPipeline> blend_overlay_pipelines_;
928 mutable Variants<BlendSaturationPipeline> blend_saturation_pipelines_;
929 mutable Variants<BlendScreenPipeline> blend_screen_pipelines_;
930 mutable Variants<BlendSoftLightPipeline> blend_softlight_pipelines_;
932 mutable Variants<FramebufferBlendColorPipeline>
933 framebuffer_blend_color_pipelines_;
934 mutable Variants<FramebufferBlendColorBurnPipeline>
935 framebuffer_blend_colorburn_pipelines_;
936 mutable Variants<FramebufferBlendColorDodgePipeline>
937 framebuffer_blend_colordodge_pipelines_;
938 mutable Variants<FramebufferBlendDarkenPipeline>
939 framebuffer_blend_darken_pipelines_;
940 mutable Variants<FramebufferBlendDifferencePipeline>
941 framebuffer_blend_difference_pipelines_;
942 mutable Variants<FramebufferBlendExclusionPipeline>
943 framebuffer_blend_exclusion_pipelines_;
944 mutable Variants<FramebufferBlendHardLightPipeline>
945 framebuffer_blend_hardlight_pipelines_;
946 mutable Variants<FramebufferBlendHuePipeline>
947 framebuffer_blend_hue_pipelines_;
948 mutable Variants<FramebufferBlendLightenPipeline>
949 framebuffer_blend_lighten_pipelines_;
950 mutable Variants<FramebufferBlendLuminosityPipeline>
951 framebuffer_blend_luminosity_pipelines_;
952 mutable Variants<FramebufferBlendMultiplyPipeline>
953 framebuffer_blend_multiply_pipelines_;
954 mutable Variants<FramebufferBlendOverlayPipeline>
955 framebuffer_blend_overlay_pipelines_;
956 mutable Variants<FramebufferBlendSaturationPipeline>
957 framebuffer_blend_saturation_pipelines_;
958 mutable Variants<FramebufferBlendScreenPipeline>
959 framebuffer_blend_screen_pipelines_;
960 mutable Variants<FramebufferBlendSoftLightPipeline>
961 framebuffer_blend_softlight_pipelines_;
962 mutable Variants<VerticesUberShader> vertices_uber_shader_;
964 template <
class TypedPipeline>
965 std::shared_ptr<Pipeline<PipelineDescriptor>> GetPipeline(
966 Variants<TypedPipeline>& container,
967 ContentContextOptions opts)
const {
968 TypedPipeline* pipeline = CreateIfNeeded(container, opts);
972 return pipeline->WaitAndGet();
975 template <
class RenderPipelineHandleT>
976 RenderPipelineHandleT* CreateIfNeeded(
977 Variants<RenderPipelineHandleT>& container,
978 ContentContextOptions opts)
const {
984 opts.wireframe =
true;
987 if (RenderPipelineHandleT* found = container.Get(opts)) {
991 RenderPipelineHandleT* default_handle = container.GetDefault();
996 std::shared_ptr<Pipeline<PipelineDescriptor>> pipeline =
997 default_handle->WaitAndGet();
1002 auto variant_future = pipeline->CreateVariant(
1003 [&opts, variants_count =
1004 container.GetPipelineCount()](PipelineDescriptor& desc) {
1005 opts.ApplyToPipelineDescriptor(desc);
1007 SPrintF(
"%s V#%zu", desc.GetLabel().c_str(), variants_count));
1009 std::unique_ptr<RenderPipelineHandleT> variant =
1010 std::make_unique<RenderPipelineHandleT>(std::move(variant_future));
1011 container.Set(opts, std::move(variant));
1012 return container.Get(opts);
1015 bool is_valid_ =
false;
1016 std::shared_ptr<Tessellator> tessellator_;
1017#if IMPELLER_ENABLE_3D
1018 std::shared_ptr<scene::SceneContext> scene_context_;
1020 std::shared_ptr<RenderTargetAllocator> render_target_cache_;
1021 std::shared_ptr<HostBuffer> host_buffer_;
1022 std::shared_ptr<Texture> empty_texture_;
1023 bool wireframe_ =
false;
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 > > 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
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Render passes encode render commands directed as one specific render target into an underlying comman...
#define FML_CHECK(condition)
#define FML_DCHECK(condition)
const GrXPFactory * Get(SkBlendMode mode)
constexpr std::size_t HashCombine()
PrimitiveType
Decides how backend draws pixels based on input vertices.
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 ContentContextOptions &lhs, const ContentContextOptions &rhs) const
constexpr uint64_t operator()(const ContentContextOptions &o) const
PrimitiveType primitive_type
bool has_depth_stencil_attachments
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
PixelFormat color_attachment_pixel_format
@ kOverdrawPreventionRestore
@ kOverdrawPreventionIncrement
bool is_for_rrect_blur_clear
CompareFunction depth_compare
constexpr bool operator()(const RuntimeEffectPipelineKey &lhs, const RuntimeEffectPipelineKey &rhs) const
std::size_t operator()(const RuntimeEffectPipelineKey &key) const