#include <stddef.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <numbers>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "components/viz/service/display/bsp_compare_result.h"
#include "components/viz/service/display/draw_polygon.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/transform.h"
namespace viz {
#if !BUILDFLAG(IS_WIN)
void DrawPolygon::RecomputeNormalForTesting() { … }
#endif
static int sign(float v) { … }
bool IsPlanarForTesting(const DrawPolygon& p) { … }
bool IsConvexForTesting(const DrawPolygon& p) { … }
namespace {
#define CREATE_NEW_DRAW_POLYGON(name, points_vector, normal, polygon_id) …
#define CREATE_NEW_DRAW_POLYGON_PTR(name, points_vector, normal, polygon_id) …
#define CREATE_TEST_DRAW_FORWARD_POLYGON(name, points_vector, id) …
#define CREATE_TEST_DRAW_REVERSE_POLYGON(name, points_vector, id) …
#define EXPECT_FLOAT_WITHIN_EPSILON_OF(a, b) …
#define EXPECT_POINT_EQ(point_a, point_b) …
#define EXPECT_NORMAL(poly, n_x, n_y, n_z) …
static void ValidatePoints(const DrawPolygon& polygon,
const std::vector<gfx::Point3F>& points) { … }
static void ValidatePointsWithinDeltaOf(const DrawPolygon& polygon,
const std::vector<gfx::Point3F>& points,
float delta) { … }
TEST(DrawPolygonConstructionTest, NormalNormal) { … }
TEST(DrawPolygonConstructionTest, TestNormal) { … }
TEST(DrawPolygonConstructionTest, ClippedNormal) { … }
TEST(DrawPolygonConstructionTest, SlimTriangleNormal) { … }
TEST(DrawPolygonConstructionTest, ManyVertexNormal) { … }
TEST(DrawPolygonConstructionTest, SimpleNormal) { … }
TEST(DrawPolygonConstructionTest, NormalInvertXY) { … }
TEST(DrawPolygonConstructionTest, NormalInvertXZ) { … }
TEST(DrawPolygonConstructionTest, NormalInvertYZ) { … }
TEST(DrawPolygonConstructionTest, NormalRotate90) { … }
TEST(DrawPolygonConstructionTest, InvertXNormal) { … }
TEST(DrawPolygonConstructionTest, InvertYNormal) { … }
TEST(DrawPolygonConstructionTest, InvertZNormal) { … }
TEST(DrawPolygonSplitTest, NearlyTouchingOrder) { … }
TEST(DrawPolygonSplitTest, NotClearlyInFront) { … }
TEST(DrawPolygonSplitTest, NotTouchingNoSplit) { … }
TEST(DrawPolygonSplitTest, BarelyTouchingNoSplit) { … }
TEST(DrawPolygonSplitTest, SlimClip) { … }
TEST(DrawPolygonSplitTest, BasicSplit) { … }
TEST(DrawPolygonSplitTest, AngledSplit) { … }
TEST(DrawPolygonSplitTest, AlmostCoplanarSplit) { … }
TEST(DrawPolygonSplitTest, DoubleSplit) { … }
TEST(DrawPolygonSplitTest, SplitNoNaNs) { … }
TEST(DrawPolygonSplitTest, SplitNoInfs) { … }
TEST(DrawPolygonTransformTest, TransformNormal) { … }
}
}