mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
AK: Remove rarely used ExtraMathConstants.h
This commit is contained in:
parent
a1f17bd643
commit
5870a1a9a1
7 changed files with 5 additions and 22 deletions
|
@ -1,11 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021, the SerenityOS developers.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define M_TAU 6.28318530717958647692
|
|
||||||
#define M_DEG2RAD 0.01745329251994329576
|
|
||||||
#define M_RAD2DEG 57.2957795130823208767
|
|
|
@ -58,7 +58,6 @@ source_set("AK") {
|
||||||
"Endian.h",
|
"Endian.h",
|
||||||
"EnumBits.h",
|
"EnumBits.h",
|
||||||
"Error.h",
|
"Error.h",
|
||||||
"ExtraMathConstants.h",
|
|
||||||
"FPControl.h",
|
"FPControl.h",
|
||||||
"Find.h",
|
"Find.h",
|
||||||
"FixedArray.h",
|
"FixedArray.h",
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
#include "FastBoxBlur.h"
|
#include "FastBoxBlur.h"
|
||||||
#include "../FilterParams.h"
|
#include "../FilterParams.h"
|
||||||
#include <AK/ExtraMathConstants.h>
|
|
||||||
#include <LibGUI/Label.h>
|
#include <LibGUI/Label.h>
|
||||||
#include <LibGUI/ValueSlider.h>
|
#include <LibGUI/ValueSlider.h>
|
||||||
#include <LibGfx/Filters/FastBoxBlurFilter.h>
|
#include <LibGfx/Filters/FastBoxBlurFilter.h>
|
||||||
|
@ -20,8 +19,8 @@ void FastBoxBlur::apply(Gfx::Bitmap& target_bitmap) const
|
||||||
|
|
||||||
if (m_use_asymmetric_radii) {
|
if (m_use_asymmetric_radii) {
|
||||||
if (m_use_vector) {
|
if (m_use_vector) {
|
||||||
auto radius_x = m_radius * fabs(cos((double)m_angle * M_DEG2RAD));
|
auto radius_x = m_radius * fabs(cos(AK::to_radians(static_cast<double>(m_angle))));
|
||||||
auto radius_y = m_radius * fabs(sin((double)m_angle * M_DEG2RAD));
|
auto radius_y = m_radius * fabs(sin(AK::to_radians(static_cast<double>(m_angle))));
|
||||||
filter.apply_single_pass(radius_x, radius_y);
|
filter.apply_single_pass(radius_x, radius_y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/BuiltinWrappers.h>
|
#include <AK/BuiltinWrappers.h>
|
||||||
#include <AK/ExtraMathConstants.h>
|
|
||||||
#include <AK/FloatingPoint.h>
|
#include <AK/FloatingPoint.h>
|
||||||
#if !ARCH(AARCH64)
|
#if !ARCH(AARCH64)
|
||||||
# include <AK/FPControl.h>
|
# include <AK/FPControl.h>
|
||||||
|
@ -569,7 +568,7 @@ float ldexpf(float x, int exp) NOEXCEPT
|
||||||
|
|
||||||
[[maybe_unused]] static long double ampsin(long double angle) NOEXCEPT
|
[[maybe_unused]] static long double ampsin(long double angle) NOEXCEPT
|
||||||
{
|
{
|
||||||
long double looped_angle = fmodl(M_PI + angle, M_TAU) - M_PI;
|
long double looped_angle = fmodl(M_PI + angle, M_PI * 2) - M_PI;
|
||||||
long double looped_angle_squared = looped_angle * looped_angle;
|
long double looped_angle_squared = looped_angle * looped_angle;
|
||||||
|
|
||||||
long double quadratic_term;
|
long double quadratic_term;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/ExtraMathConstants.h>
|
|
||||||
#include <LibWeb/HTML/Canvas/CanvasPath.h>
|
#include <LibWeb/HTML/Canvas/CanvasPath.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
@ -60,7 +59,7 @@ WebIDL::ExceptionOr<void> CanvasPath::ellipse(float x, float y, float radius_x,
|
||||||
if (radius_y < 0)
|
if (radius_y < 0)
|
||||||
return WebIDL::IndexSizeError::create(m_self->realm(), MUST(String::formatted("The minor-axis radius provided ({}) is negative.", radius_y)));
|
return WebIDL::IndexSizeError::create(m_self->realm(), MUST(String::formatted("The minor-axis radius provided ({}) is negative.", radius_y)));
|
||||||
|
|
||||||
if (constexpr float tau = M_TAU; (!counter_clockwise && (end_angle - start_angle) >= tau)
|
if (constexpr float tau = M_PI * 2; (!counter_clockwise && (end_angle - start_angle) >= tau)
|
||||||
|| (counter_clockwise && (start_angle - end_angle) >= tau)) {
|
|| (counter_clockwise && (start_angle - end_angle) >= tau)) {
|
||||||
start_angle = 0;
|
start_angle = 0;
|
||||||
// FIXME: elliptical_arc_to() incorrectly handles the case where the start/end points are very close.
|
// FIXME: elliptical_arc_to() incorrectly handles the case where the start/end points are very close.
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Debug.h>
|
#include <AK/Debug.h>
|
||||||
#include <AK/ExtraMathConstants.h>
|
|
||||||
#include <AK/QuickSort.h>
|
#include <AK/QuickSort.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibGfx/AffineTransform.h>
|
#include <LibGfx/AffineTransform.h>
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Debug.h>
|
#include <AK/Debug.h>
|
||||||
#include <AK/ExtraMathConstants.h>
|
|
||||||
#include <AK/Optional.h>
|
#include <AK/Optional.h>
|
||||||
#include <LibGfx/Path.h>
|
#include <LibGfx/Path.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
|
@ -162,7 +161,7 @@ Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction> instructions
|
||||||
case PathInstructionType::EllipticalArc: {
|
case PathInstructionType::EllipticalArc: {
|
||||||
double rx = data[0];
|
double rx = data[0];
|
||||||
double ry = data[1];
|
double ry = data[1];
|
||||||
double x_axis_rotation = double { data[2] } * M_DEG2RAD;
|
double x_axis_rotation = AK::to_radians(static_cast<double>(data[2]));
|
||||||
double large_arc_flag = data[3];
|
double large_arc_flag = data[3];
|
||||||
double sweep_flag = data[4];
|
double sweep_flag = data[4];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue