diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 8ba65593034d5..fda3198c86527 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -7,7 +7,6 @@ #include #include -#include "impeller/base/strings.h" #include "impeller/entity/entity.h" #include "impeller/renderer/command_buffer.h" #include "impeller/renderer/formats.h" @@ -309,7 +308,6 @@ bool ContentContext::IsValid() const { } std::shared_ptr ContentContext::MakeSubpass( - const std::string& label, ISize texture_size, const SubpassCallback& subpass_callback, bool msaa_enabled) const { @@ -319,11 +317,11 @@ std::shared_ptr ContentContext::MakeSubpass( if (context->GetDeviceCapabilities().SupportsOffscreenMSAA() && msaa_enabled) { subpass_target = RenderTarget::CreateOffscreenMSAA( - *context, texture_size, SPrintF("%s Offscreen", label.c_str()), + *context, texture_size, "Contents Offscreen MSAA", RenderTarget::kDefaultColorAttachmentConfigMSAA, std::nullopt); } else { subpass_target = RenderTarget::CreateOffscreen( - *context, texture_size, SPrintF("%s Offscreen", label.c_str()), + *context, texture_size, "Contents Offscreen", RenderTarget::kDefaultColorAttachmentConfig, std::nullopt); } auto subpass_texture = subpass_target.GetRenderTargetTexture(); @@ -332,7 +330,7 @@ std::shared_ptr ContentContext::MakeSubpass( } auto sub_command_buffer = context->CreateCommandBuffer(); - sub_command_buffer->SetLabel(SPrintF("%s CommandBuffer", label.c_str())); + sub_command_buffer->SetLabel("Offscreen Contents Command Buffer"); if (!sub_command_buffer) { return nullptr; } @@ -341,7 +339,7 @@ std::shared_ptr ContentContext::MakeSubpass( if (!sub_renderpass) { return nullptr; } - sub_renderpass->SetLabel(SPrintF("%s RenderPass", label.c_str())); + sub_renderpass->SetLabel("OffscreenContentsPass"); if (!subpass_callback(*this, *sub_renderpass)) { return nullptr; diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index d32cc41f9df86..c5a57882eda59 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -603,8 +603,7 @@ class ContentContext { /// @brief Creates a new texture of size `texture_size` and calls /// `subpass_callback` with a `RenderPass` for drawing to the texture. - std::shared_ptr MakeSubpass(const std::string& label, - ISize texture_size, + std::shared_ptr MakeSubpass(ISize texture_size, const SubpassCallback& subpass_callback, bool msaa_enabled = true) const; diff --git a/impeller/entity/contents/contents.cc b/impeller/entity/contents/contents.cc index 437454d97f9e7..965ade2a7e750 100644 --- a/impeller/entity/contents/contents.cc +++ b/impeller/entity/contents/contents.cc @@ -6,7 +6,6 @@ #include #include "fml/logging.h" -#include "impeller/base/strings.h" #include "impeller/entity/contents/content_context.h" #include "impeller/entity/contents/texture_contents.h" #include "impeller/renderer/command_buffer.h" @@ -83,7 +82,7 @@ std::optional Contents::RenderToSnapshot( } auto texture = renderer.MakeSubpass( - "Snapshot", ISize::Ceil(coverage->size), + ISize::Ceil(coverage->size), [&contents = *this, &entity, &coverage](const ContentContext& renderer, RenderPass& pass) -> bool { Entity sub_entity; diff --git a/impeller/entity/contents/filters/blend_filter_contents.cc b/impeller/entity/contents/filters/blend_filter_contents.cc index 55c4c84decfee..e47d2200a5d36 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.cc +++ b/impeller/entity/contents/filters/blend_filter_contents.cc @@ -150,11 +150,11 @@ static std::optional AdvancedBlend( return true; }; - auto out_texture = renderer.MakeSubpass("Advanced Blend Filter", - ISize(coverage.size), callback); + auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("Advanced Blend Filter Texture"); return Contents::EntityFromSnapshot( Snapshot{.texture = out_texture, @@ -274,11 +274,11 @@ static std::optional PipelineBlend( return true; }; - auto out_texture = renderer.MakeSubpass("Pipeline Blend Filter", - ISize(coverage.size), callback); + auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("Pipeline Blend Filter Texture"); return Contents::EntityFromSnapshot( Snapshot{.texture = out_texture, diff --git a/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc b/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc index 9880e24e2547d..94d3642fff0f0 100644 --- a/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc @@ -122,11 +122,11 @@ std::optional BorderMaskBlurFilterContents::RenderFilter( return pass.AddCommand(std::move(cmd)); }; - auto out_texture = renderer.MakeSubpass("Border Mask Blur Filter", - ISize(coverage.size), callback); + auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("BorderMaskBlurFilter Texture"); return Contents::EntityFromSnapshot( Snapshot{.texture = out_texture, diff --git a/impeller/entity/contents/filters/color_matrix_filter_contents.cc b/impeller/entity/contents/filters/color_matrix_filter_contents.cc index e3aa364505a53..b0a0df6934cb7 100644 --- a/impeller/entity/contents/filters/color_matrix_filter_contents.cc +++ b/impeller/entity/contents/filters/color_matrix_filter_contents.cc @@ -97,11 +97,12 @@ std::optional ColorMatrixFilterContents::RenderFilter( return pass.AddCommand(std::move(cmd)); }; - auto out_texture = renderer.MakeSubpass( - "Color Matrix Filter", input_snapshot->texture->GetSize(), callback); + auto out_texture = + renderer.MakeSubpass(input_snapshot->texture->GetSize(), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("ColorMatrixFilter Texture"); return Contents::EntityFromSnapshot( Snapshot{.texture = out_texture, diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 29543df5aa80c..87cecd9996816 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -276,12 +276,12 @@ std::optional DirectionalGaussianBlurFilterContents::RenderFilter( Vector2 scaled_size = pass_texture_rect.size * scale; ISize floored_size = ISize(scaled_size.x, scaled_size.y); - auto out_texture = renderer.MakeSubpass("Directional Gaussian Blur Filter", - floored_size, callback); + auto out_texture = renderer.MakeSubpass(floored_size, callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("DirectionalGaussianBlurFilter Texture"); SamplerDescriptor sampler_desc; sampler_desc.min_filter = MinMagFilter::kLinear; diff --git a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc index c21585f9e3419..83ddd54bce119 100644 --- a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc +++ b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc @@ -74,11 +74,12 @@ std::optional LinearToSrgbFilterContents::RenderFilter( return pass.AddCommand(std::move(cmd)); }; - auto out_texture = renderer.MakeSubpass( - "Linear to sRGB Filter", input_snapshot->texture->GetSize(), callback); + auto out_texture = + renderer.MakeSubpass(input_snapshot->texture->GetSize(), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("LinearToSrgb Texture"); return Contents::EntityFromSnapshot( Snapshot{.texture = out_texture, diff --git a/impeller/entity/contents/filters/morphology_filter_contents.cc b/impeller/entity/contents/filters/morphology_filter_contents.cc index ca49965856071..4fa9e34016ff8 100644 --- a/impeller/entity/contents/filters/morphology_filter_contents.cc +++ b/impeller/entity/contents/filters/morphology_filter_contents.cc @@ -132,11 +132,11 @@ std::optional DirectionalMorphologyFilterContents::RenderFilter( return pass.AddCommand(cmd); }; - auto out_texture = renderer.MakeSubpass("Directional Morphology Filter", - ISize(coverage.size), callback); + auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("DirectionalMorphologyFilter Texture"); SamplerDescriptor sampler_desc; sampler_desc.min_filter = MinMagFilter::kLinear; diff --git a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc index 675143abef432..954522edca0fb 100644 --- a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc +++ b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc @@ -74,11 +74,12 @@ std::optional SrgbToLinearFilterContents::RenderFilter( return pass.AddCommand(std::move(cmd)); }; - auto out_texture = renderer.MakeSubpass( - "sRGB to Linear Filter", input_snapshot->texture->GetSize(), callback); + auto out_texture = + renderer.MakeSubpass(input_snapshot->texture->GetSize(), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("SrgbToLinear Texture"); return Contents::EntityFromSnapshot( Snapshot{.texture = out_texture, diff --git a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc index 2428f0ad66072..4ad85582e84ee 100644 --- a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc +++ b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc @@ -111,11 +111,12 @@ std::optional YUVToRGBFilterContents::RenderFilter( return pass.AddCommand(std::move(cmd)); }; - auto out_texture = renderer.MakeSubpass( - "YUV to RGB Filter", y_input_snapshot->texture->GetSize(), callback); + auto out_texture = + renderer.MakeSubpass(y_input_snapshot->texture->GetSize(), callback); if (!out_texture) { return std::nullopt; } + out_texture->SetLabel("YUVToRGB Texture"); return Contents::EntityFromSnapshot(Snapshot{.texture = out_texture}, entity.GetBlendMode(),