From ddce052e3681c64f473628707dfc8a00b7a81fe1 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Fri, 17 Nov 2023 15:16:31 -0800 Subject: [PATCH] Make `testing/...` and `vulkan/...` compatible with `.clang-tidy`. (flutter/engine#48161) --- .../layers/platform_view_layer_unittests.cc | 4 +- engine/src/flutter/testing/mock_canvas.cc | 10 ++-- engine/src/flutter/testing/mock_canvas.h | 4 +- engine/src/flutter/testing/stream_capture.h | 2 +- .../src/flutter/vulkan/procs/vulkan_handle.h | 2 +- .../src/flutter/vulkan/vulkan_backbuffer.cc | 18 +++--- engine/src/flutter/vulkan/vulkan_backbuffer.h | 2 +- .../flutter/vulkan/vulkan_command_buffer.cc | 22 +++---- .../flutter/vulkan/vulkan_command_buffer.h | 2 +- engine/src/flutter/vulkan/vulkan_device.cc | 58 +++++++++---------- engine/src/flutter/vulkan/vulkan_device.h | 2 +- engine/src/flutter/vulkan/vulkan_window.cc | 23 ++++---- engine/src/flutter/vulkan/vulkan_window.h | 2 +- 13 files changed, 77 insertions(+), 74 deletions(-) diff --git a/engine/src/flutter/flow/layers/platform_view_layer_unittests.cc b/engine/src/flutter/flow/layers/platform_view_layer_unittests.cc index fd58203af4..b89447f3a5 100644 --- a/engine/src/flutter/flow/layers/platform_view_layer_unittests.cc +++ b/engine/src/flutter/flow/layers/platform_view_layer_unittests.cc @@ -77,11 +77,11 @@ TEST_F(PlatformViewLayerTest, ClippedPlatformViewPrerollsAndPaintsNothing) { {MockCanvas::DrawCall{0, MockCanvas::SaveData{1}}, MockCanvas::DrawCall{ 1, MockCanvas::ClipRectData{parent_clip, ClipOp::kIntersect, - MockCanvas::kHard_ClipEdgeStyle}}, + MockCanvas::kHardClipEdgeStyle}}, MockCanvas::DrawCall{1, MockCanvas::SaveData{2}}, MockCanvas::DrawCall{ 2, MockCanvas::ClipRectData{child_clip, ClipOp::kIntersect, - MockCanvas::kHard_ClipEdgeStyle}}, + MockCanvas::kHardClipEdgeStyle}}, MockCanvas::DrawCall{2, MockCanvas::RestoreData{1}}, MockCanvas::DrawCall{1, MockCanvas::RestoreData{0}}})); } diff --git a/engine/src/flutter/testing/mock_canvas.cc b/engine/src/flutter/testing/mock_canvas.cc index 8d5a51fd1b..14628e9e99 100644 --- a/engine/src/flutter/testing/mock_canvas.cc +++ b/engine/src/flutter/testing/mock_canvas.cc @@ -208,21 +208,21 @@ void MockCanvas::DrawDisplayList(const sk_sp display_list, } void MockCanvas::ClipRect(const SkRect& rect, ClipOp op, bool is_aa) { - ClipEdgeStyle style = is_aa ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle; + ClipEdgeStyle style = is_aa ? kSoftClipEdgeStyle : kHardClipEdgeStyle; draw_calls_.emplace_back( DrawCall{current_layer_, ClipRectData{rect, op, style}}); tracker_.clipRect(rect, op, is_aa); } void MockCanvas::ClipRRect(const SkRRect& rrect, ClipOp op, bool is_aa) { - ClipEdgeStyle style = is_aa ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle; + ClipEdgeStyle style = is_aa ? kSoftClipEdgeStyle : kHardClipEdgeStyle; draw_calls_.emplace_back( DrawCall{current_layer_, ClipRRectData{rrect, op, style}}); tracker_.clipRRect(rrect, op, is_aa); } void MockCanvas::ClipPath(const SkPath& path, ClipOp op, bool is_aa) { - ClipEdgeStyle style = is_aa ? kSoft_ClipEdgeStyle : kHard_ClipEdgeStyle; + ClipEdgeStyle style = is_aa ? kSoftClipEdgeStyle : kHardClipEdgeStyle; draw_calls_.emplace_back( DrawCall{current_layer_, ClipPathData{path, op, style}}); tracker_.clipPath(path, op, is_aa); @@ -501,8 +501,8 @@ bool operator==(const MockCanvas::ClipRectData& a, static std::ostream& operator<<(std::ostream& os, const MockCanvas::ClipEdgeStyle& style) { - return os << (style == MockCanvas::kSoft_ClipEdgeStyle ? "kSoftEdges" - : "kHardEdges"); + return os << (style == MockCanvas::kSoftClipEdgeStyle ? "kSoftEdges" + : "kHardEdges"); } std::ostream& operator<<(std::ostream& os, diff --git a/engine/src/flutter/testing/mock_canvas.h b/engine/src/flutter/testing/mock_canvas.h index 591f1c908e..4e04240a43 100644 --- a/engine/src/flutter/testing/mock_canvas.h +++ b/engine/src/flutter/testing/mock_canvas.h @@ -37,8 +37,8 @@ static constexpr SkRect kEmptyRect = SkRect::MakeEmpty(); class MockCanvas final : public DlCanvas { public: enum ClipEdgeStyle { - kHard_ClipEdgeStyle, - kSoft_ClipEdgeStyle, + kHardClipEdgeStyle, + kSoftClipEdgeStyle, }; struct SaveData { diff --git a/engine/src/flutter/testing/stream_capture.h b/engine/src/flutter/testing/stream_capture.h index d40a38045d..0b0db48638 100644 --- a/engine/src/flutter/testing/stream_capture.h +++ b/engine/src/flutter/testing/stream_capture.h @@ -21,7 +21,7 @@ namespace testing { class StreamCapture { public: // Begins capturing output to the specified stream. - StreamCapture(std::ostream* ostream); + explicit StreamCapture(std::ostream* ostream); // Stops capturing output to the specified stream, and restores the original // output buffer, if |Stop| has not already been called. diff --git a/engine/src/flutter/vulkan/procs/vulkan_handle.h b/engine/src/flutter/vulkan/procs/vulkan_handle.h index cf33394b49..15b2455887 100644 --- a/engine/src/flutter/vulkan/procs/vulkan_handle.h +++ b/engine/src/flutter/vulkan/procs/vulkan_handle.h @@ -24,7 +24,7 @@ class VulkanHandle { : handle_(handle), disposer_(disposer) {} VulkanHandle(VulkanHandle&& other) - : handle_(other.handle_), disposer_(other.disposer_) { + : handle_(other.handle_), disposer_(std::move(other.disposer_)) { other.handle_ = VK_NULL_HANDLE; other.disposer_ = nullptr; } diff --git a/engine/src/flutter/vulkan/vulkan_backbuffer.cc b/engine/src/flutter/vulkan/vulkan_backbuffer.cc index 5baf465b53..4225fb5ccd 100644 --- a/engine/src/flutter/vulkan/vulkan_backbuffer.cc +++ b/engine/src/flutter/vulkan/vulkan_backbuffer.cc @@ -15,7 +15,7 @@ namespace vulkan { VulkanBackbuffer::VulkanBackbuffer(const VulkanProcTable& p_vk, const VulkanHandle& device, const VulkanHandle& pool) - : vk(p_vk), + : vk_(p_vk), device_(device), usage_command_buffer_(p_vk, device, pool), render_command_buffer_(p_vk, device, pool), @@ -54,14 +54,14 @@ bool VulkanBackbuffer::CreateSemaphores() { }; auto semaphore_collect = [this](VkSemaphore semaphore) { - vk.DestroySemaphore(device_, semaphore, nullptr); + vk_.DestroySemaphore(device_, semaphore, nullptr); }; for (size_t i = 0; i < semaphores_.size(); i++) { VkSemaphore semaphore = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vk.CreateSemaphore(device_, &create_info, nullptr, - &semaphore)) != VK_SUCCESS) { + if (VK_CALL_LOG_ERROR(vk_.CreateSemaphore(device_, &create_info, nullptr, + &semaphore)) != VK_SUCCESS) { return false; } @@ -79,14 +79,14 @@ bool VulkanBackbuffer::CreateFences() { }; auto fence_collect = [this](VkFence fence) { - vk.DestroyFence(device_, fence, nullptr); + vk_.DestroyFence(device_, fence, nullptr); }; for (size_t i = 0; i < use_fences_.size(); i++) { VkFence fence = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vk.CreateFence(device_, &create_info, nullptr, - &fence)) != VK_SUCCESS) { + if (VK_CALL_LOG_ERROR(vk_.CreateFence(device_, &create_info, nullptr, + &fence)) != VK_SUCCESS) { return false; } @@ -103,7 +103,7 @@ bool VulkanBackbuffer::WaitFences() { fences[i] = use_fences_[i]; } - return VK_CALL_LOG_ERROR(vk.WaitForFences( + return VK_CALL_LOG_ERROR(vk_.WaitForFences( device_, static_cast(use_fences_.size()), fences, true, std::numeric_limits::max())) == VK_SUCCESS; } @@ -115,7 +115,7 @@ bool VulkanBackbuffer::ResetFences() { fences[i] = use_fences_[i]; } - return VK_CALL_LOG_ERROR(vk.ResetFences( + return VK_CALL_LOG_ERROR(vk_.ResetFences( device_, static_cast(use_fences_.size()), fences)) == VK_SUCCESS; } diff --git a/engine/src/flutter/vulkan/vulkan_backbuffer.h b/engine/src/flutter/vulkan/vulkan_backbuffer.h index c485be6d2d..e1585623cf 100644 --- a/engine/src/flutter/vulkan/vulkan_backbuffer.h +++ b/engine/src/flutter/vulkan/vulkan_backbuffer.h @@ -43,7 +43,7 @@ class VulkanBackbuffer { VulkanCommandBuffer& GetRenderCommandBuffer(); private: - const VulkanProcTable& vk; + const VulkanProcTable& vk_; const VulkanHandle& device_; std::array, 2> semaphores_; std::array, 2> use_fences_; diff --git a/engine/src/flutter/vulkan/vulkan_command_buffer.cc b/engine/src/flutter/vulkan/vulkan_command_buffer.cc index d8412d6c93..db35ab18df 100644 --- a/engine/src/flutter/vulkan/vulkan_command_buffer.cc +++ b/engine/src/flutter/vulkan/vulkan_command_buffer.cc @@ -12,7 +12,7 @@ VulkanCommandBuffer::VulkanCommandBuffer( const VulkanProcTable& p_vk, const VulkanHandle& device, const VulkanHandle& pool) - : vk(p_vk), device_(device), pool_(pool), valid_(false) { + : vk_(p_vk), device_(device), pool_(pool), valid_(false) { const VkCommandBufferAllocateInfo allocate_info = { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, .pNext = nullptr, @@ -23,14 +23,14 @@ VulkanCommandBuffer::VulkanCommandBuffer( VkCommandBuffer buffer = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vk.AllocateCommandBuffers(device_, &allocate_info, - &buffer)) != VK_SUCCESS) { + if (VK_CALL_LOG_ERROR(vk_.AllocateCommandBuffers(device_, &allocate_info, + &buffer)) != VK_SUCCESS) { FML_DLOG(INFO) << "Could not allocate command buffers."; return; } auto buffer_collect = [this](VkCommandBuffer buffer) { - vk.FreeCommandBuffers(device_, pool_, 1, &buffer); + vk_.FreeCommandBuffers(device_, pool_, 1, &buffer); }; handle_ = VulkanHandle{buffer, buffer_collect}; @@ -56,11 +56,12 @@ bool VulkanCommandBuffer::Begin() const { .pInheritanceInfo = nullptr, }; - return VK_CALL_LOG_ERROR(vk.BeginCommandBuffer(handle_, &info)) == VK_SUCCESS; + return VK_CALL_LOG_ERROR(vk_.BeginCommandBuffer(handle_, &info)) == + VK_SUCCESS; } bool VulkanCommandBuffer::End() const { - return VK_CALL_LOG_ERROR(vk.EndCommandBuffer(handle_)) == VK_SUCCESS; + return VK_CALL_LOG_ERROR(vk_.EndCommandBuffer(handle_)) == VK_SUCCESS; } bool VulkanCommandBuffer::InsertPipelineBarrier( @@ -73,10 +74,11 @@ bool VulkanCommandBuffer::InsertPipelineBarrier( const VkBufferMemoryBarrier* buffer_memory_barriers, uint32_t image_memory_barrier_count, const VkImageMemoryBarrier* image_memory_barriers) const { - vk.CmdPipelineBarrier(handle_, src_stage_flags, dest_stage_flags, - dependency_flags, memory_barrier_count, memory_barriers, - buffer_memory_barrier_count, buffer_memory_barriers, - image_memory_barrier_count, image_memory_barriers); + vk_.CmdPipelineBarrier(handle_, src_stage_flags, dest_stage_flags, + dependency_flags, memory_barrier_count, + memory_barriers, buffer_memory_barrier_count, + buffer_memory_barriers, image_memory_barrier_count, + image_memory_barriers); return true; } diff --git a/engine/src/flutter/vulkan/vulkan_command_buffer.h b/engine/src/flutter/vulkan/vulkan_command_buffer.h index fe037543e3..b19f485b90 100644 --- a/engine/src/flutter/vulkan/vulkan_command_buffer.h +++ b/engine/src/flutter/vulkan/vulkan_command_buffer.h @@ -41,7 +41,7 @@ class VulkanCommandBuffer { const VkImageMemoryBarrier* image_memory_barriers) const; private: - const VulkanProcTable& vk; + const VulkanProcTable& vk_; const VulkanHandle& device_; const VulkanHandle& pool_; VulkanHandle handle_; diff --git a/engine/src/flutter/vulkan/vulkan_device.cc b/engine/src/flutter/vulkan/vulkan_device.cc index 5325d6d524..5e2a3f36d2 100644 --- a/engine/src/flutter/vulkan/vulkan_device.cc +++ b/engine/src/flutter/vulkan/vulkan_device.cc @@ -32,11 +32,11 @@ static uint32_t FindGraphicsQueueIndex( VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, VulkanHandle physical_device, bool enable_validation_layers) - : vk(p_vk), + : vk_(p_vk), physical_device_(std::move(physical_device)), graphics_queue_index_(std::numeric_limits::max()), valid_(false) { - if (!physical_device_ || !vk.AreInstanceProcsSetup()) { + if (!physical_device_ || !vk_.AreInstanceProcsSetup()) { return; } @@ -60,20 +60,20 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, const char* extensions[] = { #if FML_OS_ANDROID - VK_KHR_SWAPCHAIN_EXTENSION_NAME, + VK_KHR_SWAPCHAIN_EXTENSION_NAME, #endif #if OS_FUCHSIA - VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, - VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, - VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, - VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME, - VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME, - VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME, + VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, + VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, + VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, + VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME, + VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME, + VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME, #endif }; auto enabled_layers = - DeviceLayersToEnable(vk, physical_device_, enable_validation_layers); + DeviceLayersToEnable(vk_, physical_device_, enable_validation_layers); const char* layers[enabled_layers.size()]; @@ -96,23 +96,23 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, VkDevice device = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vk.CreateDevice(physical_device_, &create_info, nullptr, - &device)) != VK_SUCCESS) { + if (VK_CALL_LOG_ERROR(vk_.CreateDevice(physical_device_, &create_info, + nullptr, &device)) != VK_SUCCESS) { FML_DLOG(INFO) << "Could not create device."; return; } device_ = VulkanHandle{ - device, [this](VkDevice device) { vk.DestroyDevice(device, nullptr); }}; + device, [this](VkDevice device) { vk_.DestroyDevice(device, nullptr); }}; - if (!vk.SetupDeviceProcAddresses(device_)) { + if (!vk_.SetupDeviceProcAddresses(device_)) { FML_DLOG(INFO) << "Could not set up device proc addresses."; return; } VkQueue queue = VK_NULL_HANDLE; - vk.GetDeviceQueue(device_, graphics_queue_index_, 0, &queue); + vk_.GetDeviceQueue(device_, graphics_queue_index_, 0, &queue); if (queue == VK_NULL_HANDLE) { FML_DLOG(INFO) << "Could not get the device queue handle."; @@ -133,13 +133,13 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, VulkanHandle device, uint32_t queue_family_index, VulkanHandle queue) - : vk(p_vk), + : vk_(p_vk), physical_device_(std::move(physical_device)), device_(std::move(device)), queue_(std::move(queue)), graphics_queue_index_(queue_family_index), valid_(false) { - if (!physical_device_ || !vk.AreInstanceProcsSetup()) { + if (!physical_device_ || !vk_.AreInstanceProcsSetup()) { return; } @@ -159,8 +159,8 @@ bool VulkanDevice::InitializeCommandPool() { }; VkCommandPool command_pool = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vk.CreateCommandPool(device_, &command_pool_create_info, - nullptr, &command_pool)) != + if (VK_CALL_LOG_ERROR(vk_.CreateCommandPool( + device_, &command_pool_create_info, nullptr, &command_pool)) != VK_SUCCESS) { FML_DLOG(INFO) << "Could not create the command pool."; return false; @@ -168,7 +168,7 @@ bool VulkanDevice::InitializeCommandPool() { command_pool_ = VulkanHandle{ command_pool, [this](VkCommandPool pool) { - vk.DestroyCommandPool(device_, pool, nullptr); + vk_.DestroyCommandPool(device_, pool, nullptr); }}; return true; @@ -183,7 +183,7 @@ bool VulkanDevice::IsValid() const { } bool VulkanDevice::WaitIdle() const { - return VK_CALL_LOG_ERROR(vk.DeviceWaitIdle(device_)) == VK_SUCCESS; + return VK_CALL_LOG_ERROR(vk_.DeviceWaitIdle(device_)) == VK_SUCCESS; } const VulkanHandle& VulkanDevice::GetHandle() const { @@ -220,7 +220,7 @@ bool VulkanDevice::GetSurfaceCapabilities( } bool success = - VK_CALL_LOG_ERROR(vk.GetPhysicalDeviceSurfaceCapabilitiesKHR( + VK_CALL_LOG_ERROR(vk_.GetPhysicalDeviceSurfaceCapabilitiesKHR( physical_device_, surface.Handle(), capabilities)) == VK_SUCCESS; if (!success) { @@ -254,7 +254,7 @@ bool VulkanDevice::GetPhysicalDeviceFeatures( if (features == nullptr || !physical_device_) { return false; } - vk.GetPhysicalDeviceFeatures(physical_device_, features); + vk_.GetPhysicalDeviceFeatures(physical_device_, features); return true; } @@ -289,13 +289,13 @@ std::vector VulkanDevice::GetQueueFamilyProperties() const { uint32_t count = 0; - vk.GetPhysicalDeviceQueueFamilyProperties(physical_device_, &count, nullptr); + vk_.GetPhysicalDeviceQueueFamilyProperties(physical_device_, &count, nullptr); std::vector properties; properties.resize(count, {}); - vk.GetPhysicalDeviceQueueFamilyProperties(physical_device_, &count, - properties.data()); + vk_.GetPhysicalDeviceQueueFamilyProperties(physical_device_, &count, + properties.data()); return properties; } @@ -310,7 +310,7 @@ int VulkanDevice::ChooseSurfaceFormat( } uint32_t format_count = 0; - if (VK_CALL_LOG_ERROR(vk.GetPhysicalDeviceSurfaceFormatsKHR( + if (VK_CALL_LOG_ERROR(vk_.GetPhysicalDeviceSurfaceFormatsKHR( physical_device_, surface.Handle(), &format_count, nullptr)) != VK_SUCCESS) { return -1; @@ -323,7 +323,7 @@ int VulkanDevice::ChooseSurfaceFormat( std::vector formats; formats.resize(format_count); - if (VK_CALL_LOG_ERROR(vk.GetPhysicalDeviceSurfaceFormatsKHR( + if (VK_CALL_LOG_ERROR(vk_.GetPhysicalDeviceSurfaceFormatsKHR( physical_device_, surface.Handle(), &format_count, formats.data())) != VK_SUCCESS) { return -1; @@ -388,7 +388,7 @@ bool VulkanDevice::QueueSubmit( .pSignalSemaphores = signal_semaphores.data(), }; - if (VK_CALL_LOG_ERROR(vk.QueueSubmit(queue_, 1, &submit_info, fence)) != + if (VK_CALL_LOG_ERROR(vk_.QueueSubmit(queue_, 1, &submit_info, fence)) != VK_SUCCESS) { return false; } diff --git a/engine/src/flutter/vulkan/vulkan_device.h b/engine/src/flutter/vulkan/vulkan_device.h index 559c4fab9d..275a462e33 100644 --- a/engine/src/flutter/vulkan/vulkan_device.h +++ b/engine/src/flutter/vulkan/vulkan_device.h @@ -76,7 +76,7 @@ class VulkanDevice { [[nodiscard]] bool WaitIdle() const; private: - VulkanProcTable& vk; + VulkanProcTable& vk_; VulkanHandle physical_device_; VulkanHandle device_; VulkanHandle queue_; diff --git a/engine/src/flutter/vulkan/vulkan_window.cc b/engine/src/flutter/vulkan/vulkan_window.cc index 95bd227dde..c0ab63eb00 100644 --- a/engine/src/flutter/vulkan/vulkan_window.cc +++ b/engine/src/flutter/vulkan/vulkan_window.cc @@ -8,6 +8,7 @@ #include #include +#include #include "flutter/flutter_vma/flutter_skia_vma.h" #include "flutter/vulkan/vulkan_skia_proc_table.h" @@ -26,14 +27,14 @@ namespace vulkan { VulkanWindow::VulkanWindow(fml::RefPtr proc_table, std::unique_ptr native_surface) : VulkanWindow(/*context/*/ nullptr, - proc_table, + std::move(proc_table), std::move(native_surface)) {} VulkanWindow::VulkanWindow(const sk_sp& context, fml::RefPtr proc_table, std::unique_ptr native_surface) - : valid_(false), vk(std::move(proc_table)), skia_gr_context_(context) { - if (!vk || !vk->HasAcquiredMandatoryProcAddresses()) { + : valid_(false), vk_(std::move(proc_table)), skia_gr_context_(context) { + if (!vk_ || !vk_->HasAcquiredMandatoryProcAddresses()) { FML_DLOG(INFO) << "Proc table has not acquired mandatory proc addresses."; return; } @@ -50,10 +51,10 @@ VulkanWindow::VulkanWindow(const sk_sp& context, native_surface->GetExtensionName() // child extension }; - application_ = std::make_unique(*vk, "Flutter", + application_ = std::make_unique(*vk_, "Flutter", std::move(extensions)); - if (!application_->IsValid() || !vk->AreInstanceProcsSetup()) { + if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it set up the // instance proc table entries. FML_DLOG(INFO) << "Instance proc addresses have not been set up."; @@ -65,7 +66,7 @@ VulkanWindow::VulkanWindow(const sk_sp& context, logical_device_ = application_->AcquireFirstCompatibleLogicalDevice(); if (logical_device_ == nullptr || !logical_device_->IsValid() || - !vk->AreDeviceProcsSetup()) { + !vk_->AreDeviceProcsSetup()) { // Make certain the device was created and it set up the device proc table // entries. FML_DLOG(INFO) << "Device proc addresses have not been set up."; @@ -77,7 +78,7 @@ VulkanWindow::VulkanWindow(const sk_sp& context, } // Create the logical surface from the native platform surface. - surface_ = std::make_unique(*vk, *application_, + surface_ = std::make_unique(*vk_, *application_, std::move(native_surface)); if (!surface_->IsValid()) { @@ -89,7 +90,7 @@ VulkanWindow::VulkanWindow(const sk_sp& context, memory_allocator_ = flutter::FlutterSkiaVulkanMemoryAllocator::Make( application_->GetAPIVersion(), application_->GetInstance(), logical_device_->GetPhysicalDeviceHandle(), logical_device_->GetHandle(), - vk, true); + vk_, true); // Create the Skia GrDirectContext. @@ -146,7 +147,7 @@ bool VulkanWindow::CreateSkiaGrContext() { } bool VulkanWindow::CreateSkiaBackendContext(GrVkBackendContext* context) { - auto getProc = CreateSkiaGetProc(vk); + auto getProc = CreateSkiaGetProc(vk_); if (getProc == nullptr) { return false; @@ -252,7 +253,7 @@ bool VulkanWindow::RecreateSwapchain() { // cannot create a new one to replace it. auto old_swapchain = std::move(swapchain_); - if (!vk->IsValid()) { + if (!vk_->IsValid()) { return false; } @@ -269,7 +270,7 @@ bool VulkanWindow::RecreateSwapchain() { } auto swapchain = std::make_unique( - *vk, *logical_device_, *surface_, skia_gr_context_.get(), + *vk_, *logical_device_, *surface_, skia_gr_context_.get(), std::move(old_swapchain), logical_device_->GetGraphicsQueueIndex()); if (!swapchain->IsValid()) { diff --git a/engine/src/flutter/vulkan/vulkan_window.h b/engine/src/flutter/vulkan/vulkan_window.h index bf8c541284..55d885d15d 100644 --- a/engine/src/flutter/vulkan/vulkan_window.h +++ b/engine/src/flutter/vulkan/vulkan_window.h @@ -58,7 +58,7 @@ class VulkanWindow { private: bool valid_; - fml::RefPtr vk; + fml::RefPtr vk_; std::unique_ptr application_; std::unique_ptr logical_device_; std::unique_ptr surface_;