[Impeller] Clang tidy even more (#48102)
Also removes alot of includes of fml macros, which I know is always safe to remove.
diff --git a/impeller/aiks/image.h b/impeller/aiks/image.h
index 093d74a..4011137 100644
--- a/impeller/aiks/image.h
+++ b/impeller/aiks/image.h
@@ -13,7 +13,7 @@
class Image {
public:
- Image(std::shared_ptr<Texture> texture);
+ explicit Image(std::shared_ptr<Texture> texture);
~Image();
diff --git a/impeller/archivist/archive.cc b/impeller/archivist/archive.cc
index 022b30d..1179da2 100644
--- a/impeller/archivist/archive.cc
+++ b/impeller/archivist/archive.cc
@@ -4,13 +4,10 @@
#include "impeller/archivist/archive.h"
-#include <iterator>
-
#include "flutter/fml/logging.h"
#include "impeller/archivist/archive_class_registration.h"
#include "impeller/archivist/archive_database.h"
#include "impeller/archivist/archive_location.h"
-#include "impeller/base/validation.h"
namespace impeller {
diff --git a/impeller/archivist/archive.h b/impeller/archivist/archive.h
index a232bf4..33c3f66 100644
--- a/impeller/archivist/archive.h
+++ b/impeller/archivist/archive.h
@@ -9,9 +9,7 @@
#include <optional>
#include <string>
#include <type_traits>
-#include <vector>
-#include "flutter/fml/macros.h"
#include "impeller/archivist/archivable.h"
namespace impeller {
@@ -21,7 +19,7 @@
class Archive {
public:
- Archive(const std::string& path);
+ explicit Archive(const std::string& path);
~Archive();
@@ -45,7 +43,7 @@
template <class T,
class = std::enable_if_t<std::is_base_of<Archivable, T>::value>>
- [[nodiscard]] size_t Read(UnarchiveStep stepper) {
+ [[nodiscard]] size_t Read(const UnarchiveStep& stepper) {
const ArchiveDef& def = T::kArchiveDefinition;
return UnarchiveInstances(def, stepper);
}
diff --git a/impeller/archivist/archive_database.h b/impeller/archivist/archive_database.h
index 5769631..e8376fc 100644
--- a/impeller/archivist/archive_database.h
+++ b/impeller/archivist/archive_database.h
@@ -8,7 +8,6 @@
#include <memory>
#include <string>
-#include "flutter/fml/macros.h"
#include "impeller/archivist/archive_transaction.h"
namespace impeller {
@@ -22,7 +21,7 @@
///
class ArchiveDatabase {
public:
- ArchiveDatabase(const std::string& filename);
+ explicit ArchiveDatabase(const std::string& filename);
~ArchiveDatabase();
diff --git a/impeller/archivist/archive_location.h b/impeller/archivist/archive_location.h
index 3caf3f1..6b77327 100644
--- a/impeller/archivist/archive_location.h
+++ b/impeller/archivist/archive_location.h
@@ -7,7 +7,6 @@
#include <optional>
#include <type_traits>
-#include "flutter/fml/macros.h"
#include "impeller/archivist/archivable.h"
#include "impeller/archivist/archive.h"
#include "impeller/base/allocation.h"
diff --git a/impeller/archivist/archive_statement.h b/impeller/archivist/archive_statement.h
index 69c746c..a5de60f 100644
--- a/impeller/archivist/archive_statement.h
+++ b/impeller/archivist/archive_statement.h
@@ -7,7 +7,6 @@
#include <memory>
#include <type_traits>
-#include "flutter/fml/macros.h"
#include "impeller/base/allocation.h"
namespace impeller {
diff --git a/impeller/archivist/archive_transaction.h b/impeller/archivist/archive_transaction.h
index 8e4d995..671074c 100644
--- a/impeller/archivist/archive_transaction.h
+++ b/impeller/archivist/archive_transaction.h
@@ -5,8 +5,6 @@
#include <cstdint>
-#include "flutter/fml/macros.h"
-
namespace impeller {
class ArchiveStatement;
diff --git a/impeller/archivist/archive_vector.h b/impeller/archivist/archive_vector.h
index e99e39d..2db657a 100644
--- a/impeller/archivist/archive_vector.h
+++ b/impeller/archivist/archive_vector.h
@@ -4,7 +4,6 @@
#pragma once
-#include "flutter/fml/macros.h"
#include "impeller/archivist/archive.h"
namespace impeller {
@@ -28,7 +27,7 @@
ArchiveVector();
- ArchiveVector(std::vector<int64_t> keys);
+ explicit ArchiveVector(std::vector<int64_t> keys);
ArchiveVector(const ArchiveVector&) = delete;
diff --git a/impeller/base/validation.h b/impeller/base/validation.h
index eb8bd8a..1e7671a 100644
--- a/impeller/base/validation.h
+++ b/impeller/base/validation.h
@@ -12,8 +12,6 @@
#include <sstream>
-#include "flutter/fml/macros.h"
-
namespace impeller {
class ValidationLog {
diff --git a/impeller/compiler/compiler_backend.h b/impeller/compiler/compiler_backend.h
index e06ec4c..ea27801 100644
--- a/impeller/compiler/compiler_backend.h
+++ b/impeller/compiler/compiler_backend.h
@@ -47,7 +47,7 @@
spirv_cross::Compiler* GetCompiler();
- operator bool() const;
+ explicit operator bool() const;
enum class ExtendedResourceIndex {
kPrimary,
diff --git a/impeller/compiler/includer.h b/impeller/compiler/includer.h
index baeddb4..a3af915 100644
--- a/impeller/compiler/includer.h
+++ b/impeller/compiler/includer.h
@@ -6,7 +6,6 @@
#include <string>
-#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
#include "impeller/compiler/include_dir.h"
#include "shaderc/shaderc.hpp"
diff --git a/impeller/compiler/logger.h b/impeller/compiler/logger.h
index 0c478b7..d96de57 100644
--- a/impeller/compiler/logger.h
+++ b/impeller/compiler/logger.h
@@ -8,14 +8,13 @@
#include <string>
#include "flutter/fml/logging.h"
-#include "flutter/fml/macros.h"
namespace impeller {
namespace compiler {
class AutoLogger {
public:
- AutoLogger(std::stringstream& logger) : logger_(logger) {}
+ explicit AutoLogger(std::stringstream& logger) : logger_(logger) {}
~AutoLogger() {
logger_ << std::endl;
diff --git a/impeller/compiler/source_options.h b/impeller/compiler/source_options.h
index 8a740c6..5c99832 100644
--- a/impeller/compiler/source_options.h
+++ b/impeller/compiler/source_options.h
@@ -9,7 +9,6 @@
#include <string>
#include <vector>
-#include "flutter/fml/macros.h"
#include "flutter/fml/unique_fd.h"
#include "impeller/compiler/include_dir.h"
#include "impeller/compiler/types.h"
diff --git a/impeller/compiler/spirv_compiler.h b/impeller/compiler/spirv_compiler.h
index 6935f4a..c688cd2 100644
--- a/impeller/compiler/spirv_compiler.h
+++ b/impeller/compiler/spirv_compiler.h
@@ -7,7 +7,6 @@
#include <cstdint>
#include <vector>
-#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
#include "impeller/compiler/includer.h"
#include "impeller/compiler/source_options.h"
diff --git a/impeller/compiler/spirv_sksl.h b/impeller/compiler/spirv_sksl.h
index 7df5a76..8e4879d 100644
--- a/impeller/compiler/spirv_sksl.h
+++ b/impeller/compiler/spirv_sksl.h
@@ -10,7 +10,6 @@
#include <variant>
#include "flutter/fml/logging.h"
-#include "flutter/fml/macros.h"
#include "spirv_glsl.hpp"
namespace impeller {
diff --git a/impeller/compiler/switches.h b/impeller/compiler/switches.h
index c191135..c159f1a 100644
--- a/impeller/compiler/switches.h
+++ b/impeller/compiler/switches.h
@@ -9,9 +9,7 @@
#include <memory>
#include "flutter/fml/command_line.h"
-#include "flutter/fml/macros.h"
#include "flutter/fml/unique_fd.h"
-#include "impeller/compiler/compiler.h"
#include "impeller/compiler/include_dir.h"
#include "impeller/compiler/types.h"
diff --git a/impeller/compiler/utilities.h b/impeller/compiler/utilities.h
index 4c11078..d1d2743 100644
--- a/impeller/compiler/utilities.h
+++ b/impeller/compiler/utilities.h
@@ -8,8 +8,6 @@
#include <string>
#include <string_view>
-#include "flutter/fml/macros.h"
-
namespace impeller {
namespace compiler {
diff --git a/impeller/core/allocator.h b/impeller/core/allocator.h
index d43696b..5c4c02b 100644
--- a/impeller/core/allocator.h
+++ b/impeller/core/allocator.h
@@ -4,9 +4,6 @@
#pragma once
-#include <string>
-
-#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
#include "impeller/core/device_buffer_descriptor.h"
#include "impeller/core/texture.h"
diff --git a/impeller/core/buffer_view.h b/impeller/core/buffer_view.h
index 12c888b..1a272a8 100644
--- a/impeller/core/buffer_view.h
+++ b/impeller/core/buffer_view.h
@@ -4,7 +4,6 @@
#pragma once
-#include "flutter/fml/macros.h"
#include "impeller/core/buffer.h"
#include "impeller/core/range.h"
diff --git a/impeller/core/device_buffer.h b/impeller/core/device_buffer.h
index 9b1f594..ac0d454 100644
--- a/impeller/core/device_buffer.h
+++ b/impeller/core/device_buffer.h
@@ -7,7 +7,6 @@
#include <memory>
#include <string>
-#include "flutter/fml/macros.h"
#include "impeller/core/allocator.h"
#include "impeller/core/buffer.h"
#include "impeller/core/buffer_view.h"
diff --git a/impeller/core/formats.h b/impeller/core/formats.h
index 0e8d0d7..fbf1a36 100644
--- a/impeller/core/formats.h
+++ b/impeller/core/formats.h
@@ -12,7 +12,6 @@
#include "flutter/fml/hash_combine.h"
#include "flutter/fml/logging.h"
-#include "flutter/fml/macros.h"
#include "impeller/geometry/color.h"
#include "impeller/geometry/rect.h"
#include "impeller/geometry/scalar.h"
diff --git a/impeller/core/host_buffer.h b/impeller/core/host_buffer.h
index 9913b8f..74997eb 100644
--- a/impeller/core/host_buffer.h
+++ b/impeller/core/host_buffer.h
@@ -9,7 +9,6 @@
#include <string>
#include <type_traits>
-#include "flutter/fml/macros.h"
#include "impeller/base/allocation.h"
#include "impeller/core/buffer.h"
#include "impeller/core/buffer_view.h"
diff --git a/impeller/core/resource_binder.h b/impeller/core/resource_binder.h
index a88e756..1afe75b 100644
--- a/impeller/core/resource_binder.h
+++ b/impeller/core/resource_binder.h
@@ -10,7 +10,6 @@
#include <string>
#include "flutter/fml/logging.h"
-#include "flutter/fml/macros.h"
#include "impeller/core/buffer_view.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler.h"
diff --git a/impeller/core/sampler.h b/impeller/core/sampler.h
index 8337997..5792aaa 100644
--- a/impeller/core/sampler.h
+++ b/impeller/core/sampler.h
@@ -4,7 +4,6 @@
#pragma once
-#include "flutter/fml/macros.h"
#include "impeller/core/sampler_descriptor.h"
namespace impeller {
diff --git a/impeller/core/sampler_descriptor.h b/impeller/core/sampler_descriptor.h
index b9292cf..197e373 100644
--- a/impeller/core/sampler_descriptor.h
+++ b/impeller/core/sampler_descriptor.h
@@ -6,7 +6,6 @@
#include <unordered_map>
-#include "flutter/fml/macros.h"
#include "impeller/base/comparable.h"
#include "impeller/core/formats.h"
diff --git a/impeller/core/texture_descriptor.h b/impeller/core/texture_descriptor.h
index aa1b574..e168895 100644
--- a/impeller/core/texture_descriptor.h
+++ b/impeller/core/texture_descriptor.h
@@ -4,11 +4,8 @@
#pragma once
-#include <optional>
-
#include "impeller/core/formats.h"
#include "impeller/geometry/size.h"
-#include "impeller/image/decompressed_image.h"
namespace impeller {
diff --git a/impeller/core/vertex_buffer.h b/impeller/core/vertex_buffer.h
index 1c62fc8..5ef934f 100644
--- a/impeller/core/vertex_buffer.h
+++ b/impeller/core/vertex_buffer.h
@@ -17,7 +17,7 @@
size_t vertex_count = 0u;
IndexType index_type = IndexType::kUnknown;
- constexpr operator bool() const {
+ constexpr explicit operator bool() const {
return static_cast<bool>(vertex_buffer) &&
(index_type == IndexType::kNone || static_cast<bool>(index_buffer));
}
diff --git a/impeller/display_list/dl_dispatcher.h b/impeller/display_list/dl_dispatcher.h
index 9e604dd..10ed7fc 100644
--- a/impeller/display_list/dl_dispatcher.h
+++ b/impeller/display_list/dl_dispatcher.h
@@ -5,7 +5,6 @@
#pragma once
#include "flutter/display_list/dl_op_receiver.h"
-#include "flutter/fml/macros.h"
#include "impeller/aiks/canvas_type.h"
#include "impeller/aiks/paint.h"
diff --git a/impeller/display_list/dl_image_impeller.h b/impeller/display_list/dl_image_impeller.h
index 7f590b6..8f9e514 100644
--- a/impeller/display_list/dl_image_impeller.h
+++ b/impeller/display_list/dl_image_impeller.h
@@ -5,7 +5,6 @@
#pragma once
#include "flutter/display_list/image/dl_image.h"
-#include "flutter/fml/macros.h"
#include "impeller/core/texture.h"
namespace impeller {
diff --git a/impeller/display_list/dl_playground.h b/impeller/display_list/dl_playground.h
index 476b77b..7b47c36 100644
--- a/impeller/display_list/dl_playground.h
+++ b/impeller/display_list/dl_playground.h
@@ -6,7 +6,6 @@
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_builder.h"
-#include "flutter/fml/macros.h"
#include "impeller/playground/playground_test.h"
#include "third_party/skia/include/core/SkFont.h"
diff --git a/impeller/display_list/nine_patch_converter.h b/impeller/display_list/nine_patch_converter.h
index 45caf71..44afe97 100644
--- a/impeller/display_list/nine_patch_converter.h
+++ b/impeller/display_list/nine_patch_converter.h
@@ -6,12 +6,10 @@
#include <memory>
-#include "flutter/fml/macros.h"
#include "impeller/aiks/canvas_type.h"
#include "impeller/aiks/image.h"
#include "impeller/aiks/paint.h"
#include "impeller/core/sampler_descriptor.h"
-#include "impeller/geometry/path.h"
namespace impeller {
diff --git a/impeller/renderer/backend/metal/formats_mtl.h b/impeller/renderer/backend/metal/formats_mtl.h
index 06738ea..95212ce 100644
--- a/impeller/renderer/backend/metal/formats_mtl.h
+++ b/impeller/renderer/backend/metal/formats_mtl.h
@@ -8,6 +8,7 @@
#include <optional>
+#include "flutter/fml/build_config.h"
#include "flutter/fml/macros.h"
#include "impeller/base/validation.h"
#include "impeller/core/formats.h"
diff --git a/impeller/scene/node.cc b/impeller/scene/node.cc
index 8f1da38..77c090f 100644
--- a/impeller/scene/node.cc
+++ b/impeller/scene/node.cc
@@ -14,6 +14,7 @@
#include "impeller/base/thread.h"
#include "impeller/base/validation.h"
#include "impeller/geometry/matrix.h"
+#include "impeller/image/decompressed_image.h"
#include "impeller/scene/animation/animation_player.h"
#include "impeller/scene/importer/conversions.h"
#include "impeller/scene/importer/scene_flatbuffers.h"