From a65754131e02ea2d2af54e608ebdcb5259c81d02 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Tue, 18 Apr 2023 22:50:20 -0700 Subject: [PATCH] [Impeller] Comprehensively label snapshots --- impeller/display_list/dl_image_impeller.cc | 3 ++- impeller/entity/contents/atlas_contents.cc | 3 ++- impeller/entity/contents/contents.cc | 5 +++-- impeller/entity/contents/contents.h | 3 ++- .../contents/filters/blend_filter_contents.cc | 18 ++++++++++++------ .../border_mask_blur_filter_contents.cc | 3 ++- .../filters/color_matrix_filter_contents.cc | 2 +- .../entity/contents/filters/filter_contents.cc | 6 ++++-- .../entity/contents/filters/filter_contents.h | 3 ++- .../filters/gaussian_blur_filter_contents.cc | 6 ++++-- .../filters/inputs/contents_filter_input.cc | 8 ++++++-- .../filters/inputs/contents_filter_input.h | 3 ++- .../inputs/filter_contents_filter_input.cc | 6 +++++- .../inputs/filter_contents_filter_input.h | 3 ++- .../contents/filters/inputs/filter_input.h | 3 ++- .../filters/inputs/texture_filter_input.cc | 1 + .../filters/inputs/texture_filter_input.h | 3 ++- .../filters/linear_to_srgb_filter_contents.cc | 3 ++- .../filters/local_matrix_filter_contents.cc | 5 +++-- .../contents/filters/matrix_filter_contents.cc | 2 +- .../filters/morphology_filter_contents.cc | 2 +- .../filters/srgb_to_linear_filter_contents.cc | 3 ++- .../filters/yuv_to_rgb_filter_contents.cc | 6 ++++-- .../contents/framebuffer_blend_contents.cc | 4 +++- impeller/entity/contents/texture_contents.cc | 6 ++++-- impeller/entity/contents/texture_contents.h | 3 ++- .../entity/contents/tiled_texture_contents.cc | 3 ++- impeller/entity/contents/vertices_contents.cc | 3 ++- 28 files changed, 80 insertions(+), 39 deletions(-) diff --git a/impeller/display_list/dl_image_impeller.cc b/impeller/display_list/dl_image_impeller.cc index 686cbc8618c4f..4a4933b58e0bf 100644 --- a/impeller/display_list/dl_image_impeller.cc +++ b/impeller/display_list/dl_image_impeller.cc @@ -31,7 +31,8 @@ sk_sp DlImageImpeller::MakeFromYUVTextures( impeller::Entity entity; entity.SetBlendMode(impeller::BlendMode::kSource); auto snapshot = yuv_to_rgb_filter_contents->RenderToSnapshot( - aiks_context->GetContentContext(), entity); + aiks_context->GetContentContext(), entity, std::nullopt, true, + "MakeYUVToRGBFilter Snapshot"); return impeller::DlImageImpeller::Make(snapshot->texture); } diff --git a/impeller/entity/contents/atlas_contents.cc b/impeller/entity/contents/atlas_contents.cc index 4231dc8f27734..4b49fd050e77e 100644 --- a/impeller/entity/contents/atlas_contents.cc +++ b/impeller/entity/contents/atlas_contents.cc @@ -248,7 +248,8 @@ bool AtlasContents::Render(const ContentContext& renderer, auto contents = ColorFilterContents::MakeBlend( blend_mode_, {FilterInput::Make(dst_contents), FilterInput::Make(src_contents)}); - auto snapshot = contents->RenderToSnapshot(renderer, entity); + auto snapshot = contents->RenderToSnapshot(renderer, entity, std::nullopt, + true, "AtlasContents Snapshot"); if (!snapshot.has_value()) { return false; } diff --git a/impeller/entity/contents/contents.cc b/impeller/entity/contents/contents.cc index 86e32eacd0182..3e498c0b12f31 100644 --- a/impeller/entity/contents/contents.cc +++ b/impeller/entity/contents/contents.cc @@ -56,14 +56,15 @@ std::optional Contents::RenderToSnapshot( const ContentContext& renderer, const Entity& entity, const std::optional& sampler_descriptor, - bool msaa_enabled) const { + bool msaa_enabled, + const std::string& label) const { auto coverage = GetCoverage(entity); if (!coverage.has_value()) { return std::nullopt; } auto texture = renderer.MakeSubpass( - "Snapshot", ISize::Ceil(coverage->size), + label, ISize::Ceil(coverage->size), [&contents = *this, &entity, &coverage](const ContentContext& renderer, RenderPass& pass) -> bool { Entity sub_entity; diff --git a/impeller/entity/contents/contents.h b/impeller/entity/contents/contents.h index 3d22803a6de26..7ed44adcda0f2 100644 --- a/impeller/entity/contents/contents.h +++ b/impeller/entity/contents/contents.h @@ -72,7 +72,8 @@ class Contents { const ContentContext& renderer, const Entity& entity, const std::optional& sampler_descriptor = std::nullopt, - bool msaa_enabled = true) const; + bool msaa_enabled = true, + const std::string& label = "Snapshot") const; virtual bool ShouldRender(const Entity& entity, const std::optional& stencil_coverage) const; diff --git a/impeller/entity/contents/filters/blend_filter_contents.cc b/impeller/entity/contents/filters/blend_filter_contents.cc index 10477d2e6272e..dc4cd2bae860e 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.cc +++ b/impeller/entity/contents/filters/blend_filter_contents.cc @@ -54,7 +54,8 @@ static std::optional AdvancedBlend( return std::nullopt; } - auto dst_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto dst_snapshot = + inputs[0]->GetSnapshot("AdvancedBlend(Dst)", renderer, entity); if (!dst_snapshot.has_value()) { return std::nullopt; } @@ -67,7 +68,8 @@ static std::optional AdvancedBlend( std::optional src_snapshot; std::array src_uvs; if (!foreground_color.has_value()) { - src_snapshot = inputs[1]->GetSnapshot(renderer, entity); + src_snapshot = + inputs[1]->GetSnapshot("AdvancedBlend(Src)", renderer, entity); if (!src_snapshot.has_value()) { if (!dst_snapshot.has_value()) { return std::nullopt; @@ -188,7 +190,8 @@ std::optional BlendFilterContents::CreateForegroundAdvancedBlend( BlendMode blend_mode, std::optional alpha, bool absorb_opacity) const { - auto dst_snapshot = input->GetSnapshot(renderer, entity); + auto dst_snapshot = + input->GetSnapshot("ForegroundAdvancedBlend", renderer, entity); if (!dst_snapshot.has_value()) { return std::nullopt; } @@ -353,7 +356,8 @@ std::optional BlendFilterContents::CreateForegroundPorterDuffBlend( BlendMode blend_mode, std::optional alpha, bool absorb_opacity) const { - auto dst_snapshot = input->GetSnapshot(renderer, entity); + auto dst_snapshot = + input->GetSnapshot("ForegroundPorterDuffBlend", renderer, entity); if (!dst_snapshot.has_value()) { return std::nullopt; } @@ -477,7 +481,8 @@ static std::optional PipelineBlend( using VS = BlendPipeline::VertexShader; using FS = BlendPipeline::FragmentShader; - auto dst_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto dst_snapshot = + inputs[0]->GetSnapshot("PipelineBlend(Dst)", renderer, entity); ContentContext::SubpassCallback callback = [&](const ContentContext& renderer, RenderPass& pass) { @@ -544,7 +549,8 @@ static std::optional PipelineBlend( for (auto texture_i = inputs.begin() + 1; texture_i < inputs.end(); texture_i++) { - auto src_input = texture_i->get()->GetSnapshot(renderer, entity); + auto src_input = texture_i->get()->GetSnapshot("PipelineBlend(Src)", + renderer, entity); if (!add_blend_command(src_input)) { return true; } 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 b9b72143045d4..900406ae1c817 100644 --- a/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc @@ -65,7 +65,8 @@ std::optional BorderMaskBlurFilterContents::RenderFilter( return std::nullopt; } - auto input_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto input_snapshot = + inputs[0]->GetSnapshot("BorderMaskBlur", renderer, entity); if (!input_snapshot.has_value()) { return std::nullopt; } diff --git a/impeller/entity/contents/filters/color_matrix_filter_contents.cc b/impeller/entity/contents/filters/color_matrix_filter_contents.cc index 88e7487318b6c..3d3018e35e127 100644 --- a/impeller/entity/contents/filters/color_matrix_filter_contents.cc +++ b/impeller/entity/contents/filters/color_matrix_filter_contents.cc @@ -41,7 +41,7 @@ std::optional ColorMatrixFilterContents::RenderFilter( return std::nullopt; } - auto input_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto input_snapshot = inputs[0]->GetSnapshot("ColorMatrix", renderer, entity); if (!input_snapshot.has_value()) { return std::nullopt; } diff --git a/impeller/entity/contents/filters/filter_contents.cc b/impeller/entity/contents/filters/filter_contents.cc index b8bfe7a9ceeae..f88f580fbd5cc 100644 --- a/impeller/entity/contents/filters/filter_contents.cc +++ b/impeller/entity/contents/filters/filter_contents.cc @@ -242,12 +242,14 @@ std::optional FilterContents::RenderToSnapshot( const ContentContext& renderer, const Entity& entity, const std::optional& sampler_descriptor, - bool msaa_enabled) const { + bool msaa_enabled, + const std::string& label) const { // Resolve the render instruction (entity) from the filter and render it to a // snapshot. if (std::optional result = GetEntity(renderer, entity); result.has_value()) { - return result->GetContents()->RenderToSnapshot(renderer, result.value()); + return result->GetContents()->RenderToSnapshot(renderer, result.value(), + std::nullopt, true, label); } return std::nullopt; diff --git a/impeller/entity/contents/filters/filter_contents.h b/impeller/entity/contents/filters/filter_contents.h index c85294549479c..645e928fc59ef 100644 --- a/impeller/entity/contents/filters/filter_contents.h +++ b/impeller/entity/contents/filters/filter_contents.h @@ -126,7 +126,8 @@ class FilterContents : public Contents { const ContentContext& renderer, const Entity& entity, const std::optional& sampler_descriptor = std::nullopt, - bool msaa_enabled = true) const override; + bool msaa_enabled = true, + const std::string& label = "Filter Snapshot") const override; virtual Matrix GetLocalTransform(const Matrix& parent_transform) const; diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 49350b66941b1..6e33eefccadb9 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -100,7 +100,8 @@ std::optional DirectionalGaussianBlurFilterContents::RenderFilter( // Input 0 snapshot. - auto input_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto input_snapshot = + inputs[0]->GetSnapshot("GaussianBlur", renderer, entity); if (!input_snapshot.has_value()) { return std::nullopt; } @@ -148,7 +149,8 @@ std::optional DirectionalGaussianBlurFilterContents::RenderFilter( // Source override snapshot. auto source = source_override_ ? source_override_ : inputs[0]; - auto source_snapshot = source->GetSnapshot(renderer, entity); + auto source_snapshot = + source->GetSnapshot("GaussianBlur(Override)", renderer, entity); if (!source_snapshot.has_value()) { return std::nullopt; } diff --git a/impeller/entity/contents/filters/inputs/contents_filter_input.cc b/impeller/entity/contents/filters/inputs/contents_filter_input.cc index e6e40224a4cff..9af4882eadf60 100644 --- a/impeller/entity/contents/filters/inputs/contents_filter_input.cc +++ b/impeller/entity/contents/filters/inputs/contents_filter_input.cc @@ -7,6 +7,8 @@ #include #include +#include "impeller/base/strings.h" + namespace impeller { ContentsFilterInput::ContentsFilterInput(std::shared_ptr contents, @@ -20,11 +22,13 @@ FilterInput::Variant ContentsFilterInput::GetInput() const { } std::optional ContentsFilterInput::GetSnapshot( + const std::string& label, const ContentContext& renderer, const Entity& entity) const { if (!snapshot_.has_value()) { - snapshot_ = contents_->RenderToSnapshot(renderer, entity, std::nullopt, - msaa_enabled_); + snapshot_ = contents_->RenderToSnapshot( + renderer, entity, std::nullopt, msaa_enabled_, + SPrintF("Contents to %s Filter Snapshot", label.c_str())); } return snapshot_; } diff --git a/impeller/entity/contents/filters/inputs/contents_filter_input.h b/impeller/entity/contents/filters/inputs/contents_filter_input.h index 61254a9fba692..85a975416cc71 100644 --- a/impeller/entity/contents/filters/inputs/contents_filter_input.h +++ b/impeller/entity/contents/filters/inputs/contents_filter_input.h @@ -16,7 +16,8 @@ class ContentsFilterInput final : public FilterInput { Variant GetInput() const override; // |FilterInput| - std::optional GetSnapshot(const ContentContext& renderer, + std::optional GetSnapshot(const std::string& label, + const ContentContext& renderer, const Entity& entity) const override; // |FilterInput| diff --git a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc index 8b19b87e20ec1..03e37839cd6b2 100644 --- a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc +++ b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.cc @@ -6,6 +6,7 @@ #include +#include "impeller/base/strings.h" #include "impeller/entity/contents/filters/filter_contents.h" namespace impeller { @@ -21,10 +22,13 @@ FilterInput::Variant FilterContentsFilterInput::GetInput() const { } std::optional FilterContentsFilterInput::GetSnapshot( + const std::string& label, const ContentContext& renderer, const Entity& entity) const { if (!snapshot_.has_value()) { - snapshot_ = filter_->RenderToSnapshot(renderer, entity); + snapshot_ = filter_->RenderToSnapshot( + renderer, entity, std::nullopt, true, + SPrintF("Filter to %s Filter Snapshot", label.c_str())); } return snapshot_; } diff --git a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h index 9562484a8f07a..778ca1e69eaf8 100644 --- a/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h +++ b/impeller/entity/contents/filters/inputs/filter_contents_filter_input.h @@ -16,7 +16,8 @@ class FilterContentsFilterInput final : public FilterInput { Variant GetInput() const override; // |FilterInput| - std::optional GetSnapshot(const ContentContext& renderer, + std::optional GetSnapshot(const std::string& label, + const ContentContext& renderer, const Entity& entity) const override; // |FilterInput| diff --git a/impeller/entity/contents/filters/inputs/filter_input.h b/impeller/entity/contents/filters/inputs/filter_input.h index 38090d679052c..07e185cca7fa9 100644 --- a/impeller/entity/contents/filters/inputs/filter_input.h +++ b/impeller/entity/contents/filters/inputs/filter_input.h @@ -45,7 +45,8 @@ class FilterInput { virtual Variant GetInput() const = 0; - virtual std::optional GetSnapshot(const ContentContext& renderer, + virtual std::optional GetSnapshot(const std::string& label, + const ContentContext& renderer, const Entity& entity) const = 0; std::optional GetLocalCoverage(const Entity& entity) const; diff --git a/impeller/entity/contents/filters/inputs/texture_filter_input.cc b/impeller/entity/contents/filters/inputs/texture_filter_input.cc index 2cdb8cce0f9d6..6134ca059a722 100644 --- a/impeller/entity/contents/filters/inputs/texture_filter_input.cc +++ b/impeller/entity/contents/filters/inputs/texture_filter_input.cc @@ -21,6 +21,7 @@ FilterInput::Variant TextureFilterInput::GetInput() const { } std::optional TextureFilterInput::GetSnapshot( + const std::string& label, const ContentContext& renderer, const Entity& entity) const { auto snapshot = diff --git a/impeller/entity/contents/filters/inputs/texture_filter_input.h b/impeller/entity/contents/filters/inputs/texture_filter_input.h index 4700f30cc2b0b..29f15c2e6fa51 100644 --- a/impeller/entity/contents/filters/inputs/texture_filter_input.h +++ b/impeller/entity/contents/filters/inputs/texture_filter_input.h @@ -18,7 +18,8 @@ class TextureFilterInput final : public FilterInput { Variant GetInput() const override; // |FilterInput| - std::optional GetSnapshot(const ContentContext& renderer, + std::optional GetSnapshot(const std::string& label, + const ContentContext& renderer, const Entity& entity) const override; // |FilterInput| 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 f4c2afd21897e..7b0a3618131ea 100644 --- a/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc +++ b/impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc @@ -31,7 +31,8 @@ std::optional LinearToSrgbFilterContents::RenderFilter( using VS = LinearToSrgbFilterPipeline::VertexShader; using FS = LinearToSrgbFilterPipeline::FragmentShader; - auto input_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto input_snapshot = + inputs[0]->GetSnapshot("LinearToSrgb", renderer, entity); if (!input_snapshot.has_value()) { return std::nullopt; } diff --git a/impeller/entity/contents/filters/local_matrix_filter_contents.cc b/impeller/entity/contents/filters/local_matrix_filter_contents.cc index 9f30faf2ebb2a..1cdce565db516 100644 --- a/impeller/entity/contents/filters/local_matrix_filter_contents.cc +++ b/impeller/entity/contents/filters/local_matrix_filter_contents.cc @@ -25,8 +25,9 @@ std::optional LocalMatrixFilterContents::RenderFilter( const Entity& entity, const Matrix& effect_transform, const Rect& coverage) const { - return Entity::FromSnapshot(inputs[0]->GetSnapshot(renderer, entity), - entity.GetBlendMode(), entity.GetStencilDepth()); + return Entity::FromSnapshot( + inputs[0]->GetSnapshot("LocalMatrix", renderer, entity), + entity.GetBlendMode(), entity.GetStencilDepth()); } } // namespace impeller diff --git a/impeller/entity/contents/filters/matrix_filter_contents.cc b/impeller/entity/contents/filters/matrix_filter_contents.cc index 0a745b64c48e7..b64d91bddcb67 100644 --- a/impeller/entity/contents/filters/matrix_filter_contents.cc +++ b/impeller/entity/contents/filters/matrix_filter_contents.cc @@ -28,7 +28,7 @@ std::optional MatrixFilterContents::RenderFilter( const Entity& entity, const Matrix& effect_transform, const Rect& coverage) const { - auto snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto snapshot = inputs[0]->GetSnapshot("Matrix", renderer, entity); if (!snapshot.has_value()) { return std::nullopt; } diff --git a/impeller/entity/contents/filters/morphology_filter_contents.cc b/impeller/entity/contents/filters/morphology_filter_contents.cc index 6048e6b72b732..4a94e1ce6cc65 100644 --- a/impeller/entity/contents/filters/morphology_filter_contents.cc +++ b/impeller/entity/contents/filters/morphology_filter_contents.cc @@ -51,7 +51,7 @@ std::optional DirectionalMorphologyFilterContents::RenderFilter( return std::nullopt; } - auto input_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto input_snapshot = inputs[0]->GetSnapshot("Morphology", renderer, entity); if (!input_snapshot.has_value()) { return std::nullopt; } 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 70576924acfbf..dd5c802638efa 100644 --- a/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc +++ b/impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc @@ -31,7 +31,8 @@ std::optional SrgbToLinearFilterContents::RenderFilter( using VS = SrgbToLinearFilterPipeline::VertexShader; using FS = SrgbToLinearFilterPipeline::FragmentShader; - auto input_snapshot = inputs[0]->GetSnapshot(renderer, entity); + auto input_snapshot = + inputs[0]->GetSnapshot("SrgbToLinear", renderer, entity); if (!input_snapshot.has_value()) { return std::nullopt; } 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 0b79cc5b10ded..bb9cc84f541d6 100644 --- a/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc +++ b/impeller/entity/contents/filters/yuv_to_rgb_filter_contents.cc @@ -50,8 +50,10 @@ std::optional YUVToRGBFilterContents::RenderFilter( using VS = YUVToRGBFilterPipeline::VertexShader; using FS = YUVToRGBFilterPipeline::FragmentShader; - auto y_input_snapshot = inputs[0]->GetSnapshot(renderer, entity); - auto uv_input_snapshot = inputs[1]->GetSnapshot(renderer, entity); + auto y_input_snapshot = + inputs[0]->GetSnapshot("YUVToRGB(Y)", renderer, entity); + auto uv_input_snapshot = + inputs[1]->GetSnapshot("YUVToRGB(UV)", renderer, entity); if (!y_input_snapshot.has_value() || !uv_input_snapshot.has_value()) { return std::nullopt; } diff --git a/impeller/entity/contents/framebuffer_blend_contents.cc b/impeller/entity/contents/framebuffer_blend_contents.cc index 05c615681613a..2e5595c824006 100644 --- a/impeller/entity/contents/framebuffer_blend_contents.cc +++ b/impeller/entity/contents/framebuffer_blend_contents.cc @@ -41,7 +41,9 @@ bool FramebufferBlendContents::Render(const ContentContext& renderer, auto& host_buffer = pass.GetTransientsBuffer(); - auto src_snapshot = child_contents_->RenderToSnapshot(renderer, entity); + auto src_snapshot = + child_contents_->RenderToSnapshot(renderer, entity, std::nullopt, true, + "FramebufferBlendContents Snapshot"); if (!src_snapshot.has_value()) { return true; } diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index 47763697e8411..149b9b66b784d 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -77,7 +77,8 @@ std::optional TextureContents::RenderToSnapshot( const ContentContext& renderer, const Entity& entity, const std::optional& sampler_descriptor, - bool msaa_enabled) const { + bool msaa_enabled, + const std::string& label) const { // Passthrough textures that have simple rectangle paths and complete source // rects. auto bounds = rect_; @@ -94,7 +95,8 @@ std::optional TextureContents::RenderToSnapshot( .opacity = opacity}; } return Contents::RenderToSnapshot( - renderer, entity, sampler_descriptor.value_or(sampler_descriptor_)); + renderer, entity, sampler_descriptor.value_or(sampler_descriptor_), true, + label); } static TextureFillVertexShader::PerVertexData ComputeVertexData( diff --git a/impeller/entity/contents/texture_contents.h b/impeller/entity/contents/texture_contents.h index 56600978e5ac2..0de6d290b0777 100644 --- a/impeller/entity/contents/texture_contents.h +++ b/impeller/entity/contents/texture_contents.h @@ -58,7 +58,8 @@ class TextureContents final : public Contents { const ContentContext& renderer, const Entity& entity, const std::optional& sampler_descriptor = std::nullopt, - bool msaa_enabled = true) const override; + bool msaa_enabled = true, + const std::string& label = "Texture Snapshot") const override; // |Contents| bool Render(const ContentContext& renderer, diff --git a/impeller/entity/contents/tiled_texture_contents.cc b/impeller/entity/contents/tiled_texture_contents.cc index ef3fa555b558c..e825e2acaf982 100644 --- a/impeller/entity/contents/tiled_texture_contents.cc +++ b/impeller/entity/contents/tiled_texture_contents.cc @@ -65,7 +65,8 @@ TiledTextureContents::CreateFilterTexture( const ContentContext& renderer) const { const ColorFilterProc& filter = color_filter_.value(); auto color_filter_contents = filter(FilterInput::Make(texture_)); - auto snapshot = color_filter_contents->RenderToSnapshot(renderer, Entity()); + auto snapshot = color_filter_contents->RenderToSnapshot( + renderer, Entity(), std::nullopt, true, "TiledTextureContents Snapshot"); if (snapshot.has_value()) { return snapshot.value().texture; } diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index 301a70a8abe30..14563ca77201b 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -107,7 +107,8 @@ bool VerticesUVContents::Render(const ContentContext& renderer, auto src_contents = parent_.GetSourceContents(); - auto snapshot = src_contents->RenderToSnapshot(renderer, entity); + auto snapshot = src_contents->RenderToSnapshot( + renderer, entity, std::nullopt, true, "VerticesUVContents Snapshot"); if (!snapshot.has_value()) { return false; }