| Flutter Impeller |

Classes | Namespaces | Macros | Functions
geometry_unittests.cc File Reference
`#include <memory>`
`#include "flutter/testing/testing.h"`
`#include "gtest/gtest.h"`
`#include "impeller/entity/contents/content_context.h"`
`#include "impeller/entity/contents/pipelines.h"`
`#include "impeller/entity/geometry/geometry.h"`
`#include "impeller/entity/geometry/stroke_path_geometry.h"`
`#include "impeller/geometry/constants.h"`
`#include "impeller/geometry/geometry_asserts.h"`
`#include "impeller/geometry/path_builder.h"`
`#include "impeller/renderer/testing/mocks.h"`

Go to the source code of this file.

## Classes
class | impeller::ImpellerEntityUnitTestAccessor

## Namespaces
| impeller
| impeller::testing

## Macros
#define | EXPECT_SOLID_VERTICES_NEAR(a, b) EXPECT_PRED2(&::SolidVerticesNear, a, b)
#define | EXPECT_TEXTURE_VERTICES_NEAR(a, b) EXPECT_PRED2(&::TextureVerticesNear, a, b)

## Functions
inline ::testing::AssertionResult | SolidVerticesNear (std::vector< impeller::Point > a, std::vector< impeller::Point > b)
inline ::testing::AssertionResult | TextureVerticesNear (std::vector< impeller::TextureFillVertexShader::PerVertexData > a, std::vector< impeller::TextureFillVertexShader::PerVertexData > b)
| impeller::testing::TEST (EntityGeometryTest, RectGeometryCoversArea)
| impeller::testing::TEST (EntityGeometryTest, FillPathGeometryCoversArea)
| impeller::testing::TEST (EntityGeometryTest, FillPathGeometryCoversAreaNoInnerRect)
| impeller::testing::TEST (EntityGeometryTest, LineGeometryCoverage)
| impeller::testing::TEST (EntityGeometryTest, RoundRectGeometryCoversArea)
| impeller::testing::TEST (EntityGeometryTest, GeometryResultHasReasonableDefaults)
| impeller::testing::TEST (EntityGeometryTest, AlphaCoverageStrokePaths)

## Macro Definition Documentation

## ◆ EXPECT_SOLID_VERTICES_NEAR

#define EXPECT_SOLID_VERTICES_NEAR | ( |  | a,
|  |  | b
| ) |  | EXPECT_PRED2(&::SolidVerticesNear, a, b)

Definition at line 48 of file geometry_unittests.cc.

## ◆ EXPECT_TEXTURE_VERTICES_NEAR

#define EXPECT_TEXTURE_VERTICES_NEAR | ( |  | a,
|  |  | b
| ) |  | EXPECT_PRED2(&::TextureVerticesNear, a, b)

Definition at line 50 of file geometry_unittests.cc.

## Function Documentation

## ◆ SolidVerticesNear()

inline ::testing::AssertionResult SolidVerticesNear | ( | std::vector< impeller::Point > | a,
|  | std::vector< impeller::Point > | b
| ) |  |

Definition at line 17 of file geometry_unittests.cc.

19 {
20 if (a.size() != b.size()) {
21 return ::testing::AssertionFailure() << "Colors length does not match";
22 }
23 for (auto i = 0u; i < b.size(); i++) {
24 if (!PointNear(a[i], b[i])) {
25 return ::testing::AssertionFailure() << "Positions are not equal.";
26 }
27 }
28 return ::testing::AssertionSuccess();
29 }
PointNear
inline ::testing::AssertionResult PointNear(impeller::Point a, impeller::Point b)
Definition: geometry_asserts.h:109
impeller::saturated::b
SI b
Definition: saturated_math.h:87

References impeller::saturated::b, and PointNear().

## ◆ TextureVerticesNear()

inline ::testing::AssertionResult TextureVerticesNear | ( | std::vector< impeller::TextureFillVertexShader::PerVertexData > | a,
|  | std::vector< impeller::TextureFillVertexShader::PerVertexData > | b
| ) |  |

Definition at line 31 of file geometry_unittests.cc.

33 {
34 if (a.size() != b.size()) {
35 return ::testing::AssertionFailure() << "Colors length does not match";
36 }
37 for (auto i = 0u; i < b.size(); i++) {
38 if (!PointNear(a[i].position, b[i].position)) {
39 return ::testing::AssertionFailure() << "Positions are not equal.";
40 }
41 if (!PointNear(a[i].texture_coords, b[i].texture_coords)) {
42 return ::testing::AssertionFailure() << "Texture coords are not equal.";
43 }
44 }
45 return ::testing::AssertionSuccess();
46 }

References impeller::saturated::b, and PointNear().