diff --git a/engine/src/flutter/impeller/geometry/color.h b/engine/src/flutter/impeller/geometry/color.h index e16e87c59e..e31a82031b 100644 --- a/engine/src/flutter/impeller/geometry/color.h +++ b/engine/src/flutter/impeller/geometry/color.h @@ -840,10 +840,14 @@ struct Color { static Color Random() { return { + // This method is not used for cryptographic purposes. + // NOLINTBEGIN(clang-analyzer-security.insecureAPI.rand) static_cast((std::rand() % 255) / 255.0f), // static_cast((std::rand() % 255) / 255.0f), // static_cast((std::rand() % 255) / 255.0f), // - 1.0f // + // NOLINTEND(clang-analyzer-security.insecureAPI.rand) + 1.0f // + }; } diff --git a/engine/src/flutter/impeller/geometry/path.cc b/engine/src/flutter/impeller/geometry/path.cc index 3884dc8e21..3f3300b08e 100644 --- a/engine/src/flutter/impeller/geometry/path.cc +++ b/engine/src/flutter/impeller/geometry/path.cc @@ -228,20 +228,20 @@ bool Path::GetContourComponentAtIndex(size_t index, Path::Polyline::Polyline(Path::Polyline::PointBufferPtr point_buffer, Path::Polyline::ReclaimPointBufferCallback reclaim) - : points(std::move(point_buffer)), reclaim_points(std::move(reclaim)) { + : points(std::move(point_buffer)), reclaim_points_(std::move(reclaim)) { FML_DCHECK(points); } Path::Polyline::Polyline(Path::Polyline&& other) { points = std::move(other.points); - reclaim_points = std::move(other.reclaim_points); + reclaim_points_ = std::move(other.reclaim_points_); contours = std::move(other.contours); } Path::Polyline::~Polyline() { - if (reclaim_points) { + if (reclaim_points_) { points->clear(); - reclaim_points(std::move(points)); + reclaim_points_(std::move(points)); } } diff --git a/engine/src/flutter/impeller/geometry/path.h b/engine/src/flutter/impeller/geometry/path.h index 26f0069604..bbdadc2304 100644 --- a/engine/src/flutter/impeller/geometry/path.h +++ b/engine/src/flutter/impeller/geometry/path.h @@ -125,7 +125,7 @@ class Path { size_t contour_index) const; private: - ReclaimPointBufferCallback reclaim_points; + ReclaimPointBufferCallback reclaim_points_; }; Path(); diff --git a/engine/src/flutter/impeller/geometry/path_component.h b/engine/src/flutter/impeller/geometry/path_component.h index c721afd8c0..c47b55cbec 100644 --- a/engine/src/flutter/impeller/geometry/path_component.h +++ b/engine/src/flutter/impeller/geometry/path_component.h @@ -102,7 +102,7 @@ struct CubicPathComponent { CubicPathComponent() {} - CubicPathComponent(const QuadraticPathComponent& q) + explicit CubicPathComponent(const QuadraticPathComponent& q) : p1(q.p1), cp1(q.p1 + (q.cp - q.p1) * (2.0 / 3.0)), cp2(q.p2 + (q.cp - q.p2) * (2.0 / 3.0)), @@ -148,7 +148,7 @@ struct ContourComponent { ContourComponent() {} - ContourComponent(Point p, bool is_closed = false) + explicit ContourComponent(Point p, bool is_closed = false) : destination(p), is_closed(is_closed) {} bool operator==(const ContourComponent& other) const { diff --git a/engine/src/flutter/impeller/geometry/rect.h b/engine/src/flutter/impeller/geometry/rect.h index 60ae26fb60..bcb22edbcd 100644 --- a/engine/src/flutter/impeller/geometry/rect.h +++ b/engine/src/flutter/impeller/geometry/rect.h @@ -9,6 +9,7 @@ #include #include +#include "fml/logging.h" #include "impeller/geometry/matrix.h" #include "impeller/geometry/point.h" #include "impeller/geometry/scalar.h" @@ -216,7 +217,11 @@ struct TRect { /// rectangle. constexpr TRect TransformBounds(const Matrix& transform) const { auto points = GetTransformedPoints(transform); - return TRect::MakePointBounds(points.begin(), points.end()).value(); + auto bounds = TRect::MakePointBounds(points.begin(), points.end()); + if (bounds.has_value()) { + return bounds.value(); + } + FML_UNREACHABLE(); } /// @brief Constructs a Matrix that will map all points in the coordinate