[Impeller] clang-tidy fixes (flutter/engine#42503)

This commit is contained in:
Jason Simmons 2023-06-02 07:23:24 -07:00 committed by GitHub
parent 733739e295
commit 862953134f
10 changed files with 15 additions and 13 deletions

View File

@ -100,7 +100,7 @@ void ConfigureStencil(const ProcTableGLES& gl,
gl.Enable(GL_STENCIL_TEST);
const auto& front = pipeline.GetFrontStencilAttachmentDescriptor();
const auto& back = pipeline.GetBackStencilAttachmentDescriptor();
if (front == back) {
if (front.has_value() && front == back) {
ConfigureStencil(GL_FRONT_AND_BACK, gl, *front, stencil_reference);
} else if (front.has_value()) {
ConfigureStencil(GL_FRONT, gl, *front, stencil_reference);

View File

@ -14,8 +14,9 @@ namespace impeller {
class TrackedObjectsVK {
public:
explicit TrackedObjectsVK(std::weak_ptr<const DeviceHolder> device_holder,
const std::shared_ptr<CommandPoolVK>& pool)
explicit TrackedObjectsVK(
const std::weak_ptr<const DeviceHolder>& device_holder,
const std::shared_ptr<CommandPoolVK>& pool)
: desc_pool_(device_holder) {
if (!pool) {
return;
@ -96,7 +97,7 @@ class TrackedObjectsVK {
};
CommandEncoderVK::CommandEncoderVK(
std::weak_ptr<const DeviceHolder> device_holder,
const std::weak_ptr<const DeviceHolder>& device_holder,
const std::shared_ptr<QueueVK>& queue,
const std::shared_ptr<CommandPoolVK>& pool,
std::shared_ptr<FenceWaiterVK> fence_waiter)

View File

@ -79,7 +79,7 @@ class CommandEncoderVK {
std::shared_ptr<TrackedObjectsVK> tracked_objects_;
bool is_valid_ = false;
CommandEncoderVK(std::weak_ptr<const DeviceHolder> device_holder,
CommandEncoderVK(const std::weak_ptr<const DeviceHolder>& device_holder,
const std::shared_ptr<QueueVK>& queue,
const std::shared_ptr<CommandPoolVK>& pool,
std::shared_ptr<FenceWaiterVK> fence_waiter);

View File

@ -227,7 +227,7 @@ void ContextVK::Setup(Settings settings) {
VALIDATION_LOG << "No valid Vulkan device found.";
return;
}
device_holder->physical_device = std::move(physical_device.value());
device_holder->physical_device = physical_device.value();
}
//----------------------------------------------------------------------------

View File

@ -10,7 +10,7 @@
namespace impeller {
DescriptorPoolVK::DescriptorPoolVK(
std::weak_ptr<const DeviceHolder> device_holder)
const std::weak_ptr<const DeviceHolder>& device_holder)
: device_holder_(device_holder) {
FML_DCHECK(device_holder.lock());
}

View File

@ -27,7 +27,8 @@ namespace impeller {
///
class DescriptorPoolVK {
public:
explicit DescriptorPoolVK(std::weak_ptr<const DeviceHolder> device_holder);
explicit DescriptorPoolVK(
const std::weak_ptr<const DeviceHolder>& device_holder);
~DescriptorPoolVK();

View File

@ -12,7 +12,7 @@
namespace impeller {
FenceWaiterVK::FenceWaiterVK(std::weak_ptr<DeviceHolder> device_holder)
: device_holder_(device_holder) {
: device_holder_(std::move(device_holder)) {
waiter_thread_ = std::make_unique<std::thread>([&]() { Main(); });
is_valid_ = true;
}
@ -81,7 +81,7 @@ void FenceWaiterVK::Main() {
}
std::optional<std::vector<vk::Fence>> FenceWaiterVK::TrimAndCreateWaitSetLocked(
std::shared_ptr<DeviceHolder> device_holder) {
const std::shared_ptr<DeviceHolder>& device_holder) {
if (terminate_) {
return std::nullopt;
}

View File

@ -47,7 +47,7 @@ class FenceWaiterVK {
void Main();
std::optional<std::vector<vk::Fence>> TrimAndCreateWaitSetLocked(
std::shared_ptr<DeviceHolder> device_holder);
const std::shared_ptr<DeviceHolder>& device_holder);
FML_DISALLOW_COPY_AND_ASSIGN(FenceWaiterVK);
};

View File

@ -14,7 +14,7 @@ PipelineVK::PipelineVK(std::weak_ptr<DeviceHolder> device_holder,
vk::UniquePipelineLayout layout,
vk::UniqueDescriptorSetLayout descriptor_set_layout)
: Pipeline(std::move(library), desc),
device_holder_(device_holder),
device_holder_(std::move(device_holder)),
pipeline_(std::move(pipeline)),
render_pass_(std::move(render_pass)),
layout_(std::move(layout)),

View File

@ -55,7 +55,7 @@ static std::string VKShaderNameToShaderKeyName(const std::string& name,
ShaderLibraryVK::ShaderLibraryVK(
std::weak_ptr<DeviceHolder> device_holder,
const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries_data)
: device_holder_(device_holder) {
: device_holder_(std::move(device_holder)) {
TRACE_EVENT0("impeller", "CreateShaderLibrary");
bool success = true;
auto iterator = [&](auto type, //