25#include "impeller/entity/texture_fill.frag.h"
26#include "impeller/entity/texture_fill.vert.h"
37#define _IMPELLER_BLEND_MODE_FILTER_NAME_LIST(blend_mode) \
38 "Blend Filter " #blend_mode,
40static constexpr const char* kBlendModeFilterNames[] = {
43const std::string_view BlendModeToFilterString(
BlendMode blend_mode) {
44 return kBlendModeFilterNames[
static_cast<std::underlying_type_t<BlendMode>
>(
95template <
typename TPipeline>
100 const Rect& coverage,
102 std::optional<Color> foreground_color,
105 std::optional<Scalar> alpha) {
106 using VS =
typename TPipeline::VertexShader;
107 using FS =
typename TPipeline::FragmentShader;
113 const size_t total_inputs =
114 inputs.size() + (foreground_color.has_value() ? 1 : 0);
115 if (total_inputs < 2) {
120 inputs[0]->GetSnapshot(
"AdvancedBlend(Dst)", renderer, entity);
121 if (!dst_snapshot.has_value()) {
124 auto maybe_dst_uvs = dst_snapshot->GetCoverageUVs(coverage);
125 if (!maybe_dst_uvs.has_value()) {
128 auto dst_uvs = maybe_dst_uvs.value();
130 std::optional<Snapshot> src_snapshot;
131 std::array<Point, 4> src_uvs;
132 if (!foreground_color.has_value()) {
134 inputs[1]->GetSnapshot(
"AdvancedBlend(Src)", renderer, entity);
135 if (!src_snapshot.has_value()) {
136 if (!dst_snapshot.has_value()) {
141 auto maybe_src_uvs = src_snapshot->GetCoverageUVs(coverage);
142 if (!maybe_src_uvs.has_value()) {
143 if (!dst_snapshot.has_value()) {
148 src_uvs = maybe_src_uvs.value();
151 Rect subpass_coverage = coverage;
153 auto coverage_hint = entity.
GetContents()->GetCoverageHint();
155 if (coverage_hint.has_value()) {
156 auto maybe_subpass_coverage =
158 if (!maybe_subpass_coverage.has_value()) {
162 subpass_coverage = *maybe_subpass_coverage;
174 auto size = pass.GetRenderTargetSize();
176 std::array<typename VS::PerVertexData, 4> vertices = {
177 typename VS::PerVertexData{
Point(0, 0), dst_uvs[0], src_uvs[0]},
178 typename VS::PerVertexData{
Point(size.width, 0), dst_uvs[1],
180 typename VS::PerVertexData{
Point(0, size.height), dst_uvs[2],
182 typename VS::PerVertexData{
Point(size.width, size.height), dst_uvs[3],
191 PipelineRef pipeline = std::invoke(pipeline_proc, renderer, options);
194 pass.SetCommandLabel(BlendModeToFilterString(blend_mode));
196 pass.SetVertexBuffer(std::move(vtx_buffer));
197 pass.SetPipeline(pipeline);
199 typename FS::BlendInfo blend_info;
200 typename VS::FrameInfo frame_info;
203 renderer.
GetContext()->GetSamplerLibrary()->GetSampler(
204 dst_snapshot->sampler_descriptor);
205 FS::BindTextureSamplerDst(pass, dst_snapshot->texture, dst_sampler);
206 frame_info.dst_y_coord_scale = dst_snapshot->texture->GetYCoordScale();
207 blend_info.dst_input_alpha =
209 ? dst_snapshot->opacity
212 if (foreground_color.has_value()) {
213 blend_info.color_factor = 1;
214 blend_info.color = foreground_color.value();
218 FS::BindTextureSamplerSrc(pass, dst_snapshot->texture, dst_sampler);
221 renderer.
GetContext()->GetSamplerLibrary()->GetSampler(
222 src_snapshot->sampler_descriptor);
223 blend_info.color_factor = 0;
224 blend_info.src_input_alpha = src_snapshot->opacity;
225 FS::BindTextureSamplerSrc(pass, src_snapshot->texture, src_sampler);
226 frame_info.src_y_coord_scale = src_snapshot->texture->GetYCoordScale();
228 auto blend_uniform = data_host_buffer.EmplaceUniform(blend_info);
229 FS::BindBlendInfo(pass, blend_uniform);
231 frame_info.mvp = pass.GetOrthographicTransform() *
235 auto uniform_view = data_host_buffer.EmplaceUniform(frame_info);
236 VS::BindFrameInfo(pass, uniform_view);
238 return pass.Draw().ok();
241 std::shared_ptr<CommandBuffer> command_buffer =
243 if (!command_buffer) {
254 if (!render_target.
ok()) {
257 if (!renderer.
GetContext()->EnqueueCommandBuffer(std::move(command_buffer))) {
263 .
texture = render_target.
value().GetRenderTargetTexture(),
268 .sampler_descriptor = {},
271 : dst_snapshot->opacity) *
272 alpha.value_or(1.0)},
276std::optional<Entity> BlendFilterContents::CreateForegroundAdvancedBlend(
277 const std::shared_ptr<FilterInput>&
input,
278 const ContentContext& renderer,
279 const Entity& entity,
280 const Rect& coverage,
281 Color foreground_color,
283 std::optional<Scalar> alpha,
286 input->GetSnapshot(
"ForegroundAdvancedBlend", renderer, entity);
287 if (!dst_snapshot.has_value()) {
291 RenderProc render_proc = [foreground_color, dst_snapshot, blend_mode, alpha,
292 absorb_opacity](
const ContentContext& renderer,
293 const Entity& entity,
294 RenderPass& pass) ->
bool {
295 using VS = BlendScreenPipeline::VertexShader;
296 using FS = BlendScreenPipeline::FragmentShader;
298 auto& data_host_buffer = renderer.GetTransientsDataBuffer();
299 auto size = dst_snapshot->texture->GetSize();
301 std::array<VS::PerVertexData, 4> vertices = {
302 VS::PerVertexData{{0, 0}, {0, 0}, {0, 0}},
303 VS::PerVertexData{
Point(
size.width, 0), {1, 0}, {1, 0}},
304 VS::PerVertexData{
Point(0,
size.height), {0, 1}, {0, 1}},
305 VS::PerVertexData{
Point(
size.width,
size.height), {1, 1}, {1, 1}},
310 pass.SetCommandLabel(BlendModeToFilterString(blend_mode));
312 pass.SetVertexBuffer(std::move(vtx_buffer));
316 switch (blend_mode) {
318 pass.SetPipeline(renderer.GetBlendScreenPipeline(options));
321 pass.SetPipeline(renderer.GetBlendOverlayPipeline(options));
324 pass.SetPipeline(renderer.GetBlendDarkenPipeline(options));
327 pass.SetPipeline(renderer.GetBlendLightenPipeline(options));
330 pass.SetPipeline(renderer.GetBlendColorDodgePipeline(options));
333 pass.SetPipeline(renderer.GetBlendColorBurnPipeline(options));
336 pass.SetPipeline(renderer.GetBlendHardLightPipeline(options));
339 pass.SetPipeline(renderer.GetBlendSoftLightPipeline(options));
342 pass.SetPipeline(renderer.GetBlendDifferencePipeline(options));
345 pass.SetPipeline(renderer.GetBlendExclusionPipeline(options));
348 pass.SetPipeline(renderer.GetBlendMultiplyPipeline(options));
351 pass.SetPipeline(renderer.GetBlendHuePipeline(options));
354 pass.SetPipeline(renderer.GetBlendSaturationPipeline(options));
357 pass.SetPipeline(renderer.GetBlendColorPipeline(options));
360 pass.SetPipeline(renderer.GetBlendLuminosityPipeline(options));
366 FS::BlendInfo blend_info;
367 VS::FrameInfo frame_info;
369 raw_ptr<const Sampler> dst_sampler =
370 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
371 dst_snapshot->sampler_descriptor);
372 FS::BindTextureSamplerDst(pass, dst_snapshot->texture, dst_sampler);
373 frame_info.dst_y_coord_scale = dst_snapshot->texture->GetYCoordScale();
376 entity.GetShaderClipDepth(), pass,
377 entity.GetTransform() * dst_snapshot->transform);
379 blend_info.dst_input_alpha =
381 ? dst_snapshot->opacity * alpha.value_or(1.0)
384 blend_info.color_factor = 1;
385 blend_info.color = foreground_color;
389 FS::BindTextureSamplerSrc(pass, dst_snapshot->texture, dst_sampler);
391 auto blend_uniform = data_host_buffer.EmplaceUniform(blend_info);
392 FS::BindBlendInfo(pass, blend_uniform);
394 auto uniform_view = data_host_buffer.EmplaceUniform(frame_info);
395 VS::BindFrameInfo(pass, uniform_view);
397 return pass.Draw().ok();
400 [coverage](
const Entity& entity) -> std::optional<Rect> {
401 return coverage.TransformBounds(entity.GetTransform());
407 sub_entity.SetContents(std::move(contents));
408 sub_entity.SetBlendMode(entity.GetBlendMode());
413std::optional<Entity> BlendFilterContents::CreateForegroundPorterDuffBlend(
414 const std::shared_ptr<FilterInput>&
input,
415 const ContentContext& renderer,
416 const Entity& entity,
417 const Rect& coverage,
418 Color foreground_color,
420 std::optional<Scalar> alpha,
427 input->GetSnapshot(
"ForegroundPorterDuffBlend", renderer, entity);
428 if (!dst_snapshot.has_value()) {
436 RenderProc render_proc = [foreground_color, dst_snapshot, blend_mode,
437 absorb_opacity, alpha](
438 const ContentContext& renderer,
439 const Entity& entity, RenderPass& pass) ->
bool {
440 using VS = PorterDuffBlendPipeline::VertexShader;
441 using FS = PorterDuffBlendPipeline::FragmentShader;
443 auto& data_host_buffer = renderer.GetTransientsDataBuffer();
444 auto size = dst_snapshot->texture->GetSize();
445 auto color = foreground_color.Premultiply();
447 std::array<VS::PerVertexData, 4> vertices = {
448 VS::PerVertexData{{0, 0}, {0, 0}, color},
449 VS::PerVertexData{
Point(
size.width, 0), {1, 0}, color},
450 VS::PerVertexData{
Point(0,
size.height), {0, 1}, color},
451 VS::PerVertexData{
Point(
size.width,
size.height), {1, 1}, color},
457 pass.SetCommandLabel(BlendModeToFilterString(blend_mode));
459 pass.SetVertexBuffer(std::move(vtx_buffer));
462 pass.SetPipeline(renderer.GetPorterDuffPipeline(blend_mode, options));
464 FS::FragInfo frag_info;
465 VS::FrameInfo frame_info;
468 entity.GetShaderClipDepth(), pass,
469 entity.GetTransform() * dst_snapshot->transform);
471 raw_ptr<const Sampler> dst_sampler =
472 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
473 dst_snapshot->sampler_descriptor);
474 FS::BindTextureSamplerDst(pass, dst_snapshot->texture, dst_sampler);
475 frame_info.texture_sampler_y_coord_scale =
476 dst_snapshot->texture->GetYCoordScale();
478 frag_info.input_alpha_output_alpha_tmx_tmy =
480 ? dst_snapshot->opacity * alpha.value_or(1.0)
483 frag_info.use_strict_source_rect = 0.0;
485 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
486 VS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
488 return pass.Draw().ok();
492 [coverage](
const Entity& entity) -> std::optional<Rect> {
493 return coverage.TransformBounds(entity.GetTransform());
499 sub_entity.SetContents(std::move(contents));
500 sub_entity.SetBlendMode(entity.GetBlendMode());
509 const Rect& coverage,
511 std::optional<Color> foreground_color,
513 std::optional<Scalar> alpha) {
514 using VS = TexturePipeline::VertexShader;
515 using FS = TexturePipeline::FragmentShader;
518 inputs[0]->GetSnapshot(
"PipelineBlend(Dst)", renderer, entity);
519 if (!dst_snapshot.has_value()) {
523 Rect subpass_coverage = coverage;
525 auto coverage_hint = entity.
GetContents()->GetCoverageHint();
527 if (coverage_hint.has_value()) {
528 auto maybe_subpass_coverage =
530 if (!maybe_subpass_coverage.has_value()) {
534 subpass_coverage = *maybe_subpass_coverage;
543 pass.SetCommandLabel(BlendModeToFilterString(blend_mode));
548 auto add_blend_command = [&](std::optional<Snapshot>
input) {
549 if (!
input.has_value()) {
552 auto input_coverage =
input->GetCoverage();
553 if (!input_coverage.has_value()) {
558 renderer.
GetContext()->GetSamplerLibrary()->GetSampler(
559 input->sampler_descriptor);
560 FS::BindTextureSampler(pass,
input->texture, sampler);
562 auto size =
input->texture->GetSize();
563 std::array<VS::PerVertexData, 4> vertices = {
565 VS::PerVertexData{
Point(size.width, 0),
Point(1, 0)},
566 VS::PerVertexData{
Point(0, size.height),
Point(0, 1)},
567 VS::PerVertexData{
Point(size.width, size.height),
Point(1, 1)},
569 pass.SetVertexBuffer(
572 VS::FrameInfo frame_info;
573 frame_info.mvp = pass.GetOrthographicTransform() *
576 frame_info.texture_sampler_y_coord_scale =
577 input->texture->GetYCoordScale();
579 FS::FragInfo frag_info;
584 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
585 VS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
587 return pass.Draw().ok();
593 if (!add_blend_command(dst_snapshot)) {
599 if (inputs.size() >= 2) {
600 options.blend_mode = blend_mode;
603 for (
auto texture_i = inputs.begin() + 1; texture_i < inputs.end();
605 auto src_input = texture_i->get()->GetSnapshot(
"PipelineBlend(Src)",
607 if (!add_blend_command(src_input)) {
615 if (foreground_color.has_value()) {
616 auto contents = std::make_shared<SolidColorContents>();
618 contents->SetGeometry(&geom);
619 contents->SetColor(foreground_color.value());
624 if (!foreground_entity.
Render(renderer, pass)) {
632 std::shared_ptr<CommandBuffer> command_buffer =
634 if (!command_buffer) {
647 if (!render_target.
ok()) {
650 if (!renderer.
GetContext()->EnqueueCommandBuffer(std::move(command_buffer))) {
656 .
texture = render_target.
value().GetRenderTargetTexture(),
661 .sampler_descriptor = {},
664 : dst_snapshot->opacity) *
665 alpha.value_or(1.0)},
669std::optional<Entity> BlendFilterContents::CreateFramebufferAdvancedBlend(
671 const ContentContext& renderer,
672 const Entity& entity,
673 const Rect& coverage,
674 std::optional<Color> foreground_color,
676 std::optional<Scalar> alpha,
680 (inputs.size() == 1u && foreground_color.has_value()));
683 inputs[0]->GetSnapshot(
"ForegroundAdvancedBlend", renderer, entity);
684 if (!dst_snapshot.has_value()) {
688 std::shared_ptr<Texture> foreground_texture;
695 HostBuffer& data_host_buffer = renderer.GetTransientsDataBuffer();
698 using FS = TextureFillFragmentShader;
699 using VS = TextureFillVertexShader;
701 pass.SetCommandLabel(
"Framebuffer Advanced Blend");
704 pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options));
706 VS::FrameInfo frame_info;
708 frame_info.texture_sampler_y_coord_scale =
709 dst_snapshot->texture->GetYCoordScale();
711 FS::FragInfo frag_info;
712 frag_info.alpha = 1.0;
714 std::array<VS::PerVertexData, 4> vertices = {
715 VS::PerVertexData{{0, 0}, {0, 0}},
716 VS::PerVertexData{
Point(1, 0), {1, 0}},
717 VS::PerVertexData{
Point(0, 1), {0, 1}},
718 VS::PerVertexData{
Point(1, 1), {1, 1}},
720 pass.SetVertexBuffer(
723 VS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
724 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
725 FS::BindTextureSampler(
726 pass, dst_snapshot->texture,
727 renderer.GetContext()->GetSamplerLibrary()->GetSampler({}));
729 if (!pass.Draw().ok()) {
735 using VS = FramebufferBlendScreenPipeline::VertexShader;
736 using FS = FramebufferBlendScreenPipeline::FragmentShader;
740 std::shared_ptr<Texture> src_texture;
741 SamplerDescriptor src_sampler_descriptor = SamplerDescriptor{};
742 if (foreground_color.has_value()) {
743 src_texture = foreground_texture;
746 inputs[0]->GetSnapshot(
"ForegroundAdvancedBlend", renderer, entity);
747 if (!src_snapshot.has_value()) {
753 src_texture = src_snapshot->texture;
754 src_sampler_descriptor = src_snapshot->sampler_descriptor;
757 std::array<VS::PerVertexData, 4> vertices = {
768 pass.SetCommandLabel(
"Framebuffer Advanced Blend Filter");
769 pass.SetVertexBuffer(
772 switch (blend_mode) {
774 pass.SetPipeline(renderer.GetFramebufferBlendScreenPipeline(options));
778 renderer.GetFramebufferBlendOverlayPipeline(options));
781 pass.SetPipeline(renderer.GetFramebufferBlendDarkenPipeline(options));
785 renderer.GetFramebufferBlendLightenPipeline(options));
789 renderer.GetFramebufferBlendColorDodgePipeline(options));
793 renderer.GetFramebufferBlendColorBurnPipeline(options));
797 renderer.GetFramebufferBlendHardLightPipeline(options));
801 renderer.GetFramebufferBlendSoftLightPipeline(options));
805 renderer.GetFramebufferBlendDifferencePipeline(options));
809 renderer.GetFramebufferBlendExclusionPipeline(options));
813 renderer.GetFramebufferBlendMultiplyPipeline(options));
816 pass.SetPipeline(renderer.GetFramebufferBlendHuePipeline(options));
820 renderer.GetFramebufferBlendSaturationPipeline(options));
823 pass.SetPipeline(renderer.GetFramebufferBlendColorPipeline(options));
827 renderer.GetFramebufferBlendLuminosityPipeline(options));
833 VS::FrameInfo frame_info;
834 FS::FragInfo frag_info;
836 raw_ptr<const Sampler> src_sampler =
837 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
838 src_sampler_descriptor);
839 FS::BindTextureSamplerSrc(pass, src_texture, src_sampler);
842 frame_info.src_y_coord_scale = src_texture->GetYCoordScale();
843 VS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
845 frag_info.src_input_alpha = 1.0;
846 frag_info.dst_input_alpha =
848 ? dst_snapshot->opacity
850 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
852 return pass.Draw().ok();
856 std::shared_ptr<CommandBuffer> cmd_buffer =
857 renderer.GetContext()->CreateCommandBuffer();
860 if (foreground_color.has_value()) {
861 TextureDescriptor desc;
866 renderer.GetContext()->GetResourceAllocator()->CreateTexture(desc);
867 if (!foreground_texture) {
870 std::shared_ptr<BlitPass> blit_pass = cmd_buffer->CreateBlitPass();
871 auto buffer_view = renderer.GetTransientsDataBuffer().Emplace(
872 foreground_color->Premultiply().ToR8G8B8A8(), 4);
874 blit_pass->AddCopy(std::move(
buffer_view), foreground_texture);
875 if (!blit_pass->EncodeCommands()) {
881 renderer.MakeSubpass(
"FramebufferBlend",
882 dst_snapshot->texture->GetSize(),
889 if (!render_target.
ok()) {
892 if (!renderer.GetContext()->EnqueueCommandBuffer(std::move(cmd_buffer))) {
898 .texture = render_target.
value().GetRenderTargetTexture(),
903 .sampler_descriptor = {},
906 : dst_snapshot->opacity) *
907 alpha.value_or(1.0)},
908 entity.GetBlendMode());
911#define BLEND_CASE(mode) \
912 case BlendMode::k##mode: \
913 advanced_blend_proc_ = \
914 [](const FilterInput::Vector& inputs, const ContentContext& renderer, \
915 const Entity& entity, const Rect& coverage, BlendMode blend_mode, \
916 std::optional<Color> fg_color, \
917 ColorFilterContents::AbsorbOpacity absorb_opacity, \
918 std::optional<Scalar> alpha) { \
919 PipelineProc p = &ContentContext::GetBlend##mode##Pipeline; \
920 return AdvancedBlend<Blend##mode##Pipeline>( \
921 inputs, renderer, entity, coverage, blend_mode, fg_color, \
922 absorb_opacity, p, alpha); \
928 VALIDATION_LOG <<
"Invalid blend mode " <<
static_cast<int>(blend_mode)
929 <<
" assigned to BlendFilterContents.";
932 blend_mode_ = blend_mode;
935 switch (blend_mode) {
958 foreground_color_ = color;
961std::optional<Entity> BlendFilterContents::RenderFilter(
965 const Matrix& effect_transform,
966 const Rect& coverage,
967 const std::optional<Rect>& coverage_hint)
const {
968 if (inputs.empty()) {
972 if (inputs.size() == 1 && !foreground_color_.has_value()) {
979 if (inputs.size() == 1 && foreground_color_.has_value() &&
981 return CreateForegroundPorterDuffBlend(
982 inputs[0], renderer, entity, coverage, foreground_color_.value(),
985 return PipelineBlend(inputs, renderer, entity, coverage, blend_mode_,
991 return CreateFramebufferAdvancedBlend(inputs, renderer, entity, coverage,
992 foreground_color_, blend_mode_,
995 if (inputs.size() == 1 && foreground_color_.has_value() &&
997 return CreateForegroundAdvancedBlend(
998 inputs[0], renderer, entity, coverage, foreground_color_.value(),
1001 return advanced_blend_proc_(inputs, renderer, entity, coverage, blend_mode_,
static std::shared_ptr< Contents > Make(RenderProc render_proc, CoverageProc coverage_proc)
~BlendFilterContents() override
void SetBlendMode(BlendMode blend_mode)
void SetForegroundColor(std::optional< Color > color)
Sets a source color which is blended after all of the inputs have been blended.
virtual bool SupportsFramebufferFetch() const =0
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
std::optional< Scalar > GetAlpha() const
AbsorbOpacity GetAbsorbOpacity() const
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
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 GetTexturePipeline(ContentContextOptions opts) const
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
std::shared_ptr< Context > GetContext() const
std::function< std::optional< Rect >(const Entity &entity)> CoverageProc
std::function< bool(const ContentContext &renderer, const Entity &entity, RenderPass &pass)> RenderProc
const std::shared_ptr< Contents > & GetContents() const
Matrix GetShaderTransform(const RenderPass &pass) const
BlendMode GetBlendMode() const
void SetContents(std::shared_ptr< Contents > contents)
void SetBlendMode(BlendMode blend_mode)
static constexpr BlendMode kLastAdvancedBlendMode
bool Render(const ContentContext &renderer, RenderPass &parent_pass) const
static constexpr BlendMode kLastPipelineBlendMode
static Entity FromSnapshot(const Snapshot &snapshot, BlendMode blend_mode=BlendMode::kSrcOver)
Create an entity that can be used to render a given snapshot.
Render passes encode render commands directed as one specific render target into an underlying comman...
#define IMPELLER_FOR_EACH_BLEND_MODE(V)
FlutterDesktopBinaryReply callback
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
static constexpr Scalar Saturation(Vector3 color)
raw_ptr< Pipeline< PipelineDescriptor > > PipelineRef
A raw ptr to a pipeline object.
LinePipeline::FragmentShader FS
VertexBuffer CreateVertexBuffer(std::array< VertexType, size > input, HostBuffer &data_host_buffer)
Create an index-less vertex buffer from a fixed size array.
static std::optional< Entity > PipelineBlend(const FilterInput::Vector &inputs, const ContentContext &renderer, const Entity &entity, const Rect &coverage, BlendMode blend_mode, std::optional< Color > foreground_color, ColorFilterContents::AbsorbOpacity absorb_opacity, std::optional< Scalar > alpha)
std::optional< BlendMode > InvertPorterDuffBlend(BlendMode blend_mode)
LinePipeline::VertexShader VS
PipelineRef(ContentContext::*)(ContentContextOptions) const PipelineProc
static std::optional< Entity > AdvancedBlend(const FilterInput::Vector &inputs, const ContentContext &renderer, const Entity &entity, const Rect &coverage, BlendMode blend_mode, std::optional< Color > foreground_color, ColorFilterContents::AbsorbOpacity absorb_opacity, PipelineProc pipeline_proc, std::optional< Scalar > alpha)
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
ContentContextOptions OptionsFromPass(const RenderPass &pass)
static constexpr Scalar Luminosity(Vector3 color)
A 4x4 matrix using column-major storage.
static constexpr Matrix MakeOrthographic(TSize< T > size)
static constexpr Matrix MakeTranslation(const Vector3 &t)
Represents a texture and its intended draw transform/sampler configuration.
std::shared_ptr< Texture > texture
constexpr std::optional< TRect > Intersection(const TRect &o) const
constexpr TSize< Type > GetSize() const
Returns the size of the rectangle which may be negative in either width or height and may have been c...
static constexpr TRect MakeSize(const TSize< U > &size)
constexpr TPoint< Type > GetOrigin() const
Returns the upper left corner of the rectangle as specified by the left/top or x/y values when it was...