From 0540f225fd12f6ceab97cbd70165efe10045b167 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 16 May 2022 11:12:42 -0700 Subject: [PATCH] Make blobcat build on windows (flutter/engine#33388) --- .../src/flutter/impeller/blobcat/blobcat_main.cc | 2 +- .../flutter/impeller/geometry/path_component.cc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/impeller/blobcat/blobcat_main.cc b/engine/src/flutter/impeller/blobcat/blobcat_main.cc index 65480a6fe25..f9671a0d406 100644 --- a/engine/src/flutter/impeller/blobcat/blobcat_main.cc +++ b/engine/src/flutter/impeller/blobcat/blobcat_main.cc @@ -33,7 +33,7 @@ bool Main(const fml::CommandLine& command_line) { } auto current_directory = - fml::OpenDirectory(std::filesystem::current_path().native().c_str(), + fml::OpenDirectory(std::filesystem::current_path().string().c_str(), false, fml::FilePermission::kReadWrite); if (!fml::WriteAtomically(current_directory, output.c_str(), *blob)) { std::cerr << "Could not write shader blob to path " << output << std::endl; diff --git a/engine/src/flutter/impeller/geometry/path_component.cc b/engine/src/flutter/impeller/geometry/path_component.cc index b880f700060..f9c208386e4 100644 --- a/engine/src/flutter/impeller/geometry/path_component.cc +++ b/engine/src/flutter/impeller/geometry/path_component.cc @@ -221,8 +221,8 @@ static void CubicPathSmoothenRecursive(const SmoothingApproximation& approx, da1 = ::fabs(::atan2(p4.y - p3.y, p4.x - p3.x) - ::atan2(p3.y - p2.y, p3.x - p2.x)); - if (da1 >= M_PI) { - da1 = 2.0 * M_PI - da1; + if (da1 >= kPi) { + da1 = 2.0 * kPi - da1; } if (da1 < approx.angle_tolerance) { @@ -257,8 +257,8 @@ static void CubicPathSmoothenRecursive(const SmoothingApproximation& approx, da1 = ::fabs(::atan2(p3.y - p2.y, p3.x - p2.x) - ::atan2(p2.y - p1.y, p2.x - p1.x)); - if (da1 >= M_PI) { - da1 = 2.0 * M_PI - da1; + if (da1 >= kPi) { + da1 = 2.0 * kPi - da1; } if (da1 < approx.angle_tolerance) { @@ -298,12 +298,12 @@ static void CubicPathSmoothenRecursive(const SmoothingApproximation& approx, da1 = ::fabs(k - ::atan2(p2.y - p1.y, p2.x - p1.x)); da2 = ::fabs(::atan2(p4.y - p3.y, p4.x - p3.x) - k); - if (da1 >= M_PI) { - da1 = 2.0 * M_PI - da1; + if (da1 >= kPi) { + da1 = 2.0 * kPi - da1; } - if (da2 >= M_PI) { - da2 = 2.0 * M_PI - da2; + if (da2 >= kPi) { + da2 = 2.0 * kPi - da2; } if (da1 + da2 < approx.angle_tolerance) {