diff --git a/impeller/aiks/picture.cc b/impeller/aiks/picture.cc index 8fc31dc31f45b..2b811b8abf4e8 100644 --- a/impeller/aiks/picture.cc +++ b/impeller/aiks/picture.cc @@ -53,7 +53,7 @@ std::shared_ptr Picture::RenderToTexture( // This texture isn't host visible, but we might want to add host visible // features to Image someday. - auto impeller_context = context.GetContext(); + const std::shared_ptr& impeller_context = context.GetContext(); // Do not use the render target cache as the lifecycle of this texture // will outlive a particular frame. RenderTargetAllocator render_target_allocator = diff --git a/impeller/entity/contents/clip_contents.cc b/impeller/entity/contents/clip_contents.cc index 873622256e79c..51c90832a07ec 100644 --- a/impeller/entity/contents/clip_contents.cc +++ b/impeller/entity/contents/clip_contents.cc @@ -125,7 +125,6 @@ bool ClipContents::Render(const ContentContext& renderer, options.primitive_type = geometry_result.type; pass.SetPipeline(renderer.GetClipPipeline(options)); - auto allocator = renderer.GetContext()->GetResourceAllocator(); pass.SetVertexBuffer(std::move(geometry_result.vertex_buffer)); info.mvp = geometry_result.transform; diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 538682eed9099..6c142cf2357ae 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -414,7 +414,7 @@ fml::StatusOr ContentContext::MakeSubpass( ISize texture_size, const SubpassCallback& subpass_callback, bool msaa_enabled) const { - std::shared_ptr context = GetContext(); + const std::shared_ptr& context = GetContext(); RenderTarget subpass_target; if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) { subpass_target = RenderTarget::CreateOffscreenMSAA( @@ -438,7 +438,7 @@ fml::StatusOr ContentContext::MakeSubpass( const std::string& label, const RenderTarget& subpass_target, const SubpassCallback& subpass_callback) const { - std::shared_ptr context = GetContext(); + const std::shared_ptr& context = GetContext(); auto subpass_texture = subpass_target.GetRenderTargetTexture(); if (!subpass_texture) { diff --git a/impeller/entity/contents/runtime_effect_contents.cc b/impeller/entity/contents/runtime_effect_contents.cc index a85eb815b1696..54170ffff091f 100644 --- a/impeller/entity/contents/runtime_effect_contents.cc +++ b/impeller/entity/contents/runtime_effect_contents.cc @@ -16,6 +16,7 @@ #include "impeller/entity/contents/clip_contents.h" #include "impeller/entity/contents/content_context.h" #include "impeller/entity/runtime_effect.vert.h" +#include "impeller/renderer/capabilities.h" #include "impeller/renderer/pipeline_library.h" #include "impeller/renderer/render_pass.h" #include "impeller/renderer/shader_function.h" @@ -68,8 +69,8 @@ static std::shared_ptr MakeShaderMetadata( bool RuntimeEffectContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { - auto context = renderer.GetContext(); - auto library = context->GetShaderLibrary(); + const std::shared_ptr& context = renderer.GetContext(); + const std::shared_ptr& library = context->GetShaderLibrary(); //-------------------------------------------------------------------------- /// Get or register shader. @@ -138,7 +139,7 @@ bool RuntimeEffectContents::Render(const ContentContext& renderer, /// layouts are known from the uniforms. /// - const auto& caps = context->GetCapabilities(); + const std::shared_ptr& caps = context->GetCapabilities(); const auto color_attachment_format = caps->GetDefaultColorFormat(); const auto stencil_attachment_format = caps->GetDefaultStencilFormat(); diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index dec9a98b15ed7..f666c5caf8004 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -249,7 +249,7 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer, ISize size, int mip_count, const Color& clear_color) { - auto context = renderer.GetContext(); + const std::shared_ptr& context = renderer.GetContext(); /// All of the load/store actions are managed by `InlinePassContext` when /// `RenderPasses` are created, so we just set them to `kDontCare` here. @@ -843,7 +843,7 @@ bool EntityPass::OnRender( collapsed_parent_pass) const { TRACE_EVENT0("impeller", "EntityPass::OnRender"); - auto context = renderer.GetContext(); + const std::shared_ptr& context = renderer.GetContext(); InlinePassContext pass_context(context, pass_target, GetTotalPassReads(renderer), GetElementCount(), collapsed_parent_pass); diff --git a/impeller/runtime_stage/runtime_stage_playground.cc b/impeller/runtime_stage/runtime_stage_playground.cc index 3762581e85213..1267b6031dbce 100644 --- a/impeller/runtime_stage/runtime_stage_playground.cc +++ b/impeller/runtime_stage/runtime_stage_playground.cc @@ -20,7 +20,8 @@ RuntimeStagePlayground::~RuntimeStagePlayground() = default; bool RuntimeStagePlayground::RegisterStage(const RuntimeStage& stage) { std::promise registration; auto future = registration.get_future(); - auto library = GetContext()->GetShaderLibrary(); + const std::shared_ptr& library = + GetContext()->GetShaderLibrary(); GetContext()->GetShaderLibrary()->RegisterFunction( stage.GetEntrypoint(), ToShaderStage(stage.GetShaderStage()), stage.GetCodeMapping(),