Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] clang-tidy fixes #42503

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion impeller/renderer/backend/gles/render_pass_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions impeller/renderer/backend/vulkan/command_encoder_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/command_encoder_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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);
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/context_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

//----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/descriptor_pool_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
3 changes: 2 additions & 1 deletion impeller/renderer/backend/vulkan/descriptor_pool_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions impeller/renderer/backend/vulkan/fence_waiter_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/fence_waiter_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/pipeline_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/shader_library_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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, //
Expand Down