Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
wangs_formula_unittests.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "gtest/gtest.h"
6
7
#include "
flutter/impeller/geometry/wangs_formula.h
"
8
9
namespace
impeller
{
10
namespace
testing {
11
12
TEST
(WangsFormulaTest, Cubic) {
13
Point
p0{300, 0};
14
Point
p1
{0, 0};
15
Point
p2
{0, 0};
16
Point
p3{0, 300};
17
Scalar
result =
ComputeCubicSubdivisions
(1.0, p0,
p1
,
p2
, p3);
18
EXPECT_FLOAT_EQ(result, 30.f);
19
}
20
21
TEST
(WangsFormulaTest, Quadratic) {
22
Point
p0{15, 0};
23
Point
p1
{0, 0};
24
Point
p2
{0, 20};
25
Scalar
result =
ComputeQuadradicSubdivisions
(1.0, p0,
p1
,
p2
);
26
EXPECT_FLOAT_EQ(result, 5.f);
27
}
28
29
}
// namespace testing
30
}
// namespace impeller
flutter::Point
Definition
geometry.h:15
flutter::TEST
TEST(FrameTimingsRecorderTest, RecordVsync)
Definition
frame_timings_recorder_unittests.cc:22
impeller
Definition
texture.h:16
impeller::Scalar
float Scalar
Definition
scalar.h:19
impeller::ComputeQuadradicSubdivisions
Scalar ComputeQuadradicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2)
Definition
wangs_formula.cc:31
impeller::ComputeCubicSubdivisions
Scalar ComputeCubicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2, Point p3)
Definition
wangs_formula.cc:18
p2
Point p2
Definition
round_superellipse_param.cc:317
p1
Point p1
Definition
round_superellipse_param.cc:313
wangs_formula.h
impeller
geometry
wangs_formula_unittests.cc
Generated on Wed Feb 11 2026 05:19:11 for Flutter Engine Uber Docs by
1.9.8