From 4bdf8304ba80bded2d4b1340ba32075362f43bb8 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 17 Jan 2024 20:44:08 -0800 Subject: [PATCH 1/4] [Impeller] Eliminate some shared_ptr copying from EntityPass::Render --- impeller/entity/entity_pass.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index dec9a98b15ed7..2990c7e7b0123 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -325,8 +325,8 @@ bool EntityPass::Render(ContentContext& renderer, Rect::MakeSize(root_render_target.GetRenderTargetSize()), {.readonly = true}); - IterateAllEntities([lazy_glyph_atlas = - renderer.GetLazyGlyphAtlas()](const Entity& entity) { + const auto& lazy_glyph_atlas = renderer.GetLazyGlyphAtlas(); + IterateAllEntities([&lazy_glyph_atlas](const Entity& entity) { if (const auto& contents = entity.GetContents()) { contents->PopulateGlyphAtlas(lazy_glyph_atlas, entity.DeriveTextScale()); } From 564f86d5978210b9e8f68e21a536903729d18b4d Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 18 Jan 2024 18:58:07 -0800 Subject: [PATCH 2/4] Documentaiton for SurfaceContextVK --- impeller/renderer/backend/vulkan/surface_context_vk.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/impeller/renderer/backend/vulkan/surface_context_vk.h b/impeller/renderer/backend/vulkan/surface_context_vk.h index 5c8a327685dba..07b65feb7b214 100644 --- a/impeller/renderer/backend/vulkan/surface_context_vk.h +++ b/impeller/renderer/backend/vulkan/surface_context_vk.h @@ -17,6 +17,16 @@ class ContextVK; class Surface; class SwapchainVK; +/// For Vulkan, there is both a ContextVK that implements Context and a +/// SurfaceContextVK that also implements Context and takes a ContextVK as its +/// parent. There is a one to many relationship between ContextVK and +/// SurfaceContextVK. +/// +/// Most operations in this class are delegated to the parent ContextVK. +/// This class specifically manages swapchains and creation of VkSurfaces on +/// Android. By maintaining the swapchain this way, it is possible to have +/// multiple surfaces sharing the same ContextVK without stepping on eachothers +/// swapchains. class SurfaceContextVK : public Context, public BackendCast { public: From d1033220b27cefaadd044a744bbfaf7d4f8b95ed Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 19 Jan 2024 09:02:51 -0800 Subject: [PATCH 3/4] Update surface_context_vk.h --- impeller/renderer/backend/vulkan/surface_context_vk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/renderer/backend/vulkan/surface_context_vk.h b/impeller/renderer/backend/vulkan/surface_context_vk.h index 07b65feb7b214..357bd5c53369c 100644 --- a/impeller/renderer/backend/vulkan/surface_context_vk.h +++ b/impeller/renderer/backend/vulkan/surface_context_vk.h @@ -25,7 +25,7 @@ class SwapchainVK; /// Most operations in this class are delegated to the parent ContextVK. /// This class specifically manages swapchains and creation of VkSurfaces on /// Android. By maintaining the swapchain this way, it is possible to have -/// multiple surfaces sharing the same ContextVK without stepping on eachothers +/// multiple surfaces sharing the same ContextVK without stepping on each other's /// swapchains. class SurfaceContextVK : public Context, public BackendCast { From ed2ebddcf6759c430bc92eab0d3f261bf9b9a2c9 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 19 Jan 2024 10:19:42 -0800 Subject: [PATCH 4/4] Update surface_context_vk.h --- impeller/renderer/backend/vulkan/surface_context_vk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impeller/renderer/backend/vulkan/surface_context_vk.h b/impeller/renderer/backend/vulkan/surface_context_vk.h index 357bd5c53369c..5c144759e480c 100644 --- a/impeller/renderer/backend/vulkan/surface_context_vk.h +++ b/impeller/renderer/backend/vulkan/surface_context_vk.h @@ -25,8 +25,8 @@ class SwapchainVK; /// Most operations in this class are delegated to the parent ContextVK. /// This class specifically manages swapchains and creation of VkSurfaces on /// Android. By maintaining the swapchain this way, it is possible to have -/// multiple surfaces sharing the same ContextVK without stepping on each other's -/// swapchains. +/// multiple surfaces sharing the same ContextVK without stepping on each +/// other's swapchains. class SurfaceContextVK : public Context, public BackendCast { public: