diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 6eda042193958..72bc68cac3399 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -40794,6 +40794,8 @@ ORIGIN: ../../../flutter/impeller/tessellator/c/tessellator.h + ../../../flutter ORIGIN: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/tessellator/tessellator.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/tessellator/tessellator.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/tessellator/tessellator_libtess.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/tessellator/tessellator_libtess.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/toolkit/android/choreographer.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/toolkit/android/choreographer.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/toolkit/android/hardware_buffer.cc + ../../../flutter/LICENSE @@ -43676,6 +43678,8 @@ FILE: ../../../flutter/impeller/tessellator/c/tessellator.h FILE: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart FILE: ../../../flutter/impeller/tessellator/tessellator.cc FILE: ../../../flutter/impeller/tessellator/tessellator.h +FILE: ../../../flutter/impeller/tessellator/tessellator_libtess.cc +FILE: ../../../flutter/impeller/tessellator/tessellator_libtess.h FILE: ../../../flutter/impeller/toolkit/android/choreographer.cc FILE: ../../../flutter/impeller/toolkit/android/choreographer.h FILE: ../../../flutter/impeller/toolkit/android/hardware_buffer.cc diff --git a/impeller/geometry/BUILD.gn b/impeller/geometry/BUILD.gn index a2ea1defebea0..769770217fb05 100644 --- a/impeller/geometry/BUILD.gn +++ b/impeller/geometry/BUILD.gn @@ -87,7 +87,7 @@ executable("geometry_benchmarks") { deps = [ ":geometry", "../entity", - "../tessellator", + "../tessellator:tessellator_libtess", "//flutter/benchmarking", ] } diff --git a/impeller/geometry/geometry_benchmarks.cc b/impeller/geometry/geometry_benchmarks.cc index 1574e99ed4272..c3ab47f86e6d7 100644 --- a/impeller/geometry/geometry_benchmarks.cc +++ b/impeller/geometry/geometry_benchmarks.cc @@ -10,6 +10,7 @@ #include "impeller/geometry/path.h" #include "impeller/geometry/path_builder.h" #include "impeller/tessellator/tessellator.h" +#include "impeller/tessellator/tessellator_libtess.h" namespace impeller { @@ -37,7 +38,7 @@ Path CreateQuadratic(bool closed); Path CreateRRect(); } // namespace -static Tessellator tess; +static TessellatorLibtess tess; template static void BM_Polyline(benchmark::State& state, Args&&... args) { diff --git a/impeller/renderer/BUILD.gn b/impeller/renderer/BUILD.gn index 2cf663bc4db1d..368c037eca845 100644 --- a/impeller/renderer/BUILD.gn +++ b/impeller/renderer/BUILD.gn @@ -135,6 +135,7 @@ impeller_component("renderer_unittests") { ":renderer", "../fixtures", "../playground:playground_test", + "../tessellator:tessellator_libtess", "//flutter/testing:testing_lib", ] diff --git a/impeller/renderer/renderer_unittests.cc b/impeller/renderer/renderer_unittests.cc index 0024e42c9d861..f26d2283c2f4d 100644 --- a/impeller/renderer/renderer_unittests.cc +++ b/impeller/renderer/renderer_unittests.cc @@ -24,13 +24,10 @@ #include "impeller/fixtures/sepia.frag.h" #include "impeller/fixtures/sepia.vert.h" #include "impeller/fixtures/swizzle.frag.h" -#include "impeller/fixtures/test_texture.frag.h" -#include "impeller/fixtures/test_texture.vert.h" #include "impeller/fixtures/texture.frag.h" #include "impeller/fixtures/texture.vert.h" #include "impeller/geometry/path_builder.h" #include "impeller/playground/playground_test.h" -#include "impeller/renderer/command.h" #include "impeller/renderer/command_buffer.h" #include "impeller/renderer/pipeline_builder.h" #include "impeller/renderer/pipeline_library.h" @@ -38,7 +35,7 @@ #include "impeller/renderer/render_target.h" #include "impeller/renderer/renderer.h" #include "impeller/renderer/vertex_buffer_builder.h" -#include "impeller/tessellator/tessellator.h" +#include "impeller/tessellator/tessellator_libtess.h" #include "third_party/imgui/imgui.h" // TODO(zanderso): https://github.com/flutter/flutter/issues/127701 @@ -394,7 +391,7 @@ TEST_P(RendererTest, CanRenderInstanced) { VertexBufferBuilder builder; ASSERT_EQ(Tessellator::Result::kSuccess, - Tessellator{}.Tessellate( + TessellatorLibtess{}.Tessellate( PathBuilder{} .AddRect(Rect::MakeXYWH(10, 10, 100, 100)) .TakePath(FillType::kOdd), diff --git a/impeller/tessellator/BUILD.gn b/impeller/tessellator/BUILD.gn index bc56fb770f069..1ad6a208c3d69 100644 --- a/impeller/tessellator/BUILD.gn +++ b/impeller/tessellator/BUILD.gn @@ -15,6 +15,21 @@ impeller_component("tessellator") { deps = [ "../core", "//flutter/fml", + ] +} + +impeller_component("tessellator_libtess") { + sources = [ + "tessellator_libtess.cc", + "tessellator_libtess.h", + ] + + public_deps = [ "../geometry" ] + + deps = [ + ":tessellator", + "../core", + "//flutter/fml", "//third_party/libtess2", ] } @@ -30,11 +45,11 @@ impeller_component("tessellator_shared") { sources = [ "c/tessellator.cc", "c/tessellator.h", - "tessellator.cc", - "tessellator.h", ] deps = [ + ":tessellator", + ":tessellator_libtess", "../core", "../geometry", "//flutter/fml", @@ -50,7 +65,7 @@ impeller_component("tessellator_unittests") { testonly = true sources = [ "tessellator_unittests.cc" ] deps = [ - ":tessellator", + ":tessellator_libtess", "../geometry:geometry_asserts", "//flutter/testing", ] diff --git a/impeller/tessellator/c/tessellator.cc b/impeller/tessellator/c/tessellator.cc index f5300dcba1dee..9b4d6ea20b454 100644 --- a/impeller/tessellator/c/tessellator.cc +++ b/impeller/tessellator/c/tessellator.cc @@ -6,6 +6,8 @@ #include +#include "impeller/tessellator/tessellator_libtess.h" + namespace impeller { PathBuilder* CreatePathBuilder() { return new PathBuilder(); @@ -42,7 +44,7 @@ struct Vertices* Tessellate(PathBuilder* builder, Scalar tolerance) { auto path = builder->CopyPath(static_cast(fill_type)); std::vector points; - if (Tessellator{}.Tessellate( + if (TessellatorLibtess{}.Tessellate( path, tolerance, [&points](const float* vertices, size_t vertices_count, const uint16_t* indices, size_t indices_count) { diff --git a/impeller/tessellator/c/tessellator.h b/impeller/tessellator/c/tessellator.h index ef5bfc950f107..c8e19b0e4f248 100644 --- a/impeller/tessellator/c/tessellator.h +++ b/impeller/tessellator/c/tessellator.h @@ -8,7 +8,6 @@ #include #include "impeller/geometry/path_builder.h" -#include "impeller/tessellator/tessellator.h" #ifdef _WIN32 #define IMPELLER_API __declspec(dllexport) diff --git a/impeller/tessellator/tessellator.cc b/impeller/tessellator/tessellator.cc index afbf01da90f83..cfc26a7adf0da 100644 --- a/impeller/tessellator/tessellator.cc +++ b/impeller/tessellator/tessellator.cc @@ -4,166 +4,15 @@ #include "impeller/tessellator/tessellator.h" -#include "third_party/libtess2/Include/tesselator.h" - namespace impeller { -static void* HeapAlloc(void* userData, unsigned int size) { - return malloc(size); -} - -static void* HeapRealloc(void* userData, void* ptr, unsigned int size) { - return realloc(ptr, size); -} - -static void HeapFree(void* userData, void* ptr) { - free(ptr); -} - -// Note: these units are "number of entities" for bucket size and not in KB. -static const TESSalloc kAlloc = { - HeapAlloc, HeapRealloc, HeapFree, 0, /* =userData */ - 16, /* =meshEdgeBucketSize */ - 16, /* =meshVertexBucketSize */ - 16, /* =meshFaceBucketSize */ - 16, /* =dictNodeBucketSize */ - 16, /* =regionBucketSize */ - 0 /* =extraVertices */ -}; - Tessellator::Tessellator() - : point_buffer_(std::make_unique>()), - c_tessellator_(nullptr, &DestroyTessellator) { + : point_buffer_(std::make_unique>()) { point_buffer_->reserve(2048); - TESSalloc alloc = kAlloc; - { - // libTess2 copies the TESSalloc despite the non-const argument. - CTessellator tessellator(::tessNewTess(&alloc), &DestroyTessellator); - c_tessellator_ = std::move(tessellator); - } } Tessellator::~Tessellator() = default; -static int ToTessWindingRule(FillType fill_type) { - switch (fill_type) { - case FillType::kOdd: - return TESS_WINDING_ODD; - case FillType::kNonZero: - return TESS_WINDING_NONZERO; - } - return TESS_WINDING_ODD; -} - -Tessellator::Result Tessellator::Tessellate(const Path& path, - Scalar tolerance, - const BuilderCallback& callback) { - if (!callback) { - return Result::kInputError; - } - - point_buffer_->clear(); - auto polyline = - path.CreatePolyline(tolerance, std::move(point_buffer_), - [this](Path::Polyline::PointBufferPtr point_buffer) { - point_buffer_ = std::move(point_buffer); - }); - - auto fill_type = path.GetFillType(); - - if (polyline.points->empty()) { - return Result::kInputError; - } - - auto tessellator = c_tessellator_.get(); - if (!tessellator) { - return Result::kTessellationError; - } - - constexpr int kVertexSize = 2; - constexpr int kPolygonSize = 3; - - //---------------------------------------------------------------------------- - /// Feed contour information to the tessellator. - /// - static_assert(sizeof(Point) == 2 * sizeof(float)); - for (size_t contour_i = 0; contour_i < polyline.contours.size(); - contour_i++) { - size_t start_point_index, end_point_index; - std::tie(start_point_index, end_point_index) = - polyline.GetContourPointBounds(contour_i); - - ::tessAddContour(tessellator, // the C tessellator - kVertexSize, // - polyline.points->data() + start_point_index, // - sizeof(Point), // - end_point_index - start_point_index // - ); - } - - //---------------------------------------------------------------------------- - /// Let's tessellate. - /// - auto result = ::tessTesselate(tessellator, // tessellator - ToTessWindingRule(fill_type), // winding - TESS_POLYGONS, // element type - kPolygonSize, // polygon size - kVertexSize, // vertex size - nullptr // normal (null is automatic) - ); - - if (result != 1) { - return Result::kTessellationError; - } - - int element_item_count = tessGetElementCount(tessellator) * kPolygonSize; - - // We default to using a 16bit index buffer, but in cases where we generate - // more tessellated data than this can contain we need to fall back to - // dropping the index buffer entirely. Instead code could instead switch to - // a uint32 index buffer, but this is done for simplicity with the other - // fast path above. - if (element_item_count < USHRT_MAX) { - int vertex_item_count = tessGetVertexCount(tessellator); - auto vertices = tessGetVertices(tessellator); - auto elements = tessGetElements(tessellator); - - // libtess uses an int index internally due to usage of -1 as a sentinel - // value. - std::vector indices(element_item_count); - for (int i = 0; i < element_item_count; i++) { - indices[i] = static_cast(elements[i]); - } - if (!callback(vertices, vertex_item_count, indices.data(), - element_item_count)) { - return Result::kInputError; - } - } else { - std::vector points; - std::vector data; - - int vertex_item_count = tessGetVertexCount(tessellator) * kVertexSize; - auto vertices = tessGetVertices(tessellator); - points.reserve(vertex_item_count); - for (int i = 0; i < vertex_item_count; i += 2) { - points.emplace_back(vertices[i], vertices[i + 1]); - } - - int element_item_count = tessGetElementCount(tessellator) * kPolygonSize; - auto elements = tessGetElements(tessellator); - data.reserve(element_item_count); - for (int i = 0; i < element_item_count; i++) { - data.emplace_back(points[elements[i]].x); - data.emplace_back(points[elements[i]].y); - } - if (!callback(data.data(), element_item_count, nullptr, 0u)) { - return Result::kInputError; - } - } - - return Result::kSuccess; -} - Path::Polyline Tessellator::CreateTempPolyline(const Path& path, Scalar tolerance) { FML_DCHECK(point_buffer_); @@ -239,12 +88,6 @@ std::vector Tessellator::TessellateConvex(const Path& path, return output; } -void DestroyTessellator(TESStesselator* tessellator) { - if (tessellator != nullptr) { - ::tessDeleteTess(tessellator); - } -} - static constexpr int kPrecomputedDivisionCount = 1024; static int kPrecomputedDivisions[kPrecomputedDivisionCount] = { // clang-format off diff --git a/impeller/tessellator/tessellator.h b/impeller/tessellator/tessellator.h index 6251e814aa764..8b801192d816b 100644 --- a/impeller/tessellator/tessellator.h +++ b/impeller/tessellator/tessellator.h @@ -14,19 +14,15 @@ #include "impeller/geometry/point.h" #include "impeller/geometry/trig.h" -struct TESStesselator; - namespace impeller { -void DestroyTessellator(TESStesselator* tessellator); - -using CTessellator = - std::unique_ptr; - //------------------------------------------------------------------------------ /// @brief A utility that generates triangles of the specified fill type /// given a polyline. This happens on the CPU. /// +/// Also contains functionality for optimized generation of circles +/// and ellipses. +/// /// This object is not thread safe, and its methods must not be /// called from multiple threads. /// @@ -171,33 +167,7 @@ class Tessellator { Tessellator(); - ~Tessellator(); - - /// @brief A callback that returns the results of the tessellation. - /// - /// The index buffer may not be populated, in which case [indices] will - /// be nullptr and indices_count will be 0. - using BuilderCallback = std::function; - - //---------------------------------------------------------------------------- - /// @brief Generates filled triangles from the path. A callback is - /// invoked once for the entire tessellation. - /// - /// @param[in] path The path to tessellate. - /// @param[in] tolerance The tolerance value for conversion of the path to - /// a polyline. This value is often derived from the - /// Matrix::GetMaxBasisLength of the CTM applied to the - /// path for rendering. - /// @param[in] callback The callback, return false to indicate failure. - /// - /// @return The result status of the tessellation. - /// - Tessellator::Result Tessellate(const Path& path, - Scalar tolerance, - const BuilderCallback& callback); + virtual ~Tessellator(); //---------------------------------------------------------------------------- /// @brief Given a convex path, create a triangle fan structure. @@ -296,11 +266,11 @@ class Tessellator { const Rect& bounds, const Size& radii); - private: + protected: /// Used for polyline generation. std::unique_ptr> point_buffer_; - CTessellator c_tessellator_; + private: // Data for variouos Circle/EllipseGenerator classes, cached per // Tessellator instance which is usually the foreground life of an app // if not longer. diff --git a/impeller/tessellator/tessellator_libtess.cc b/impeller/tessellator/tessellator_libtess.cc new file mode 100644 index 0000000000000..38efb79305d1c --- /dev/null +++ b/impeller/tessellator/tessellator_libtess.cc @@ -0,0 +1,172 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "impeller/tessellator/tessellator_libtess.h" + +#include "third_party/libtess2/Include/tesselator.h" + +namespace impeller { + +static void* HeapAlloc(void* userData, unsigned int size) { + return malloc(size); +} + +static void* HeapRealloc(void* userData, void* ptr, unsigned int size) { + return realloc(ptr, size); +} + +static void HeapFree(void* userData, void* ptr) { + free(ptr); +} + +// Note: these units are "number of entities" for bucket size and not in KB. +static const TESSalloc kAlloc = { + HeapAlloc, HeapRealloc, HeapFree, 0, /* =userData */ + 16, /* =meshEdgeBucketSize */ + 16, /* =meshVertexBucketSize */ + 16, /* =meshFaceBucketSize */ + 16, /* =dictNodeBucketSize */ + 16, /* =regionBucketSize */ + 0 /* =extraVertices */ +}; + +TessellatorLibtess::TessellatorLibtess() + : Tessellator(), c_tessellator_(nullptr, &DestroyTessellator) { + TESSalloc alloc = kAlloc; + { + // libTess2 copies the TESSalloc despite the non-const argument. + CTessellator tessellator(::tessNewTess(&alloc), &DestroyTessellator); + c_tessellator_ = std::move(tessellator); + } +} + +TessellatorLibtess::~TessellatorLibtess() = default; + +static int ToTessWindingRule(FillType fill_type) { + switch (fill_type) { + case FillType::kOdd: + return TESS_WINDING_ODD; + case FillType::kNonZero: + return TESS_WINDING_NONZERO; + } + return TESS_WINDING_ODD; +} + +TessellatorLibtess::Result TessellatorLibtess::Tessellate( + const Path& path, + Scalar tolerance, + const BuilderCallback& callback) { + if (!callback) { + return Result::kInputError; + } + + point_buffer_->clear(); + auto polyline = + path.CreatePolyline(tolerance, std::move(point_buffer_), + [this](Path::Polyline::PointBufferPtr point_buffer) { + point_buffer_ = std::move(point_buffer); + }); + + auto fill_type = path.GetFillType(); + + if (polyline.points->empty()) { + return Result::kInputError; + } + + auto tessellator = c_tessellator_.get(); + if (!tessellator) { + return Result::kTessellationError; + } + + constexpr int kVertexSize = 2; + constexpr int kPolygonSize = 3; + + //---------------------------------------------------------------------------- + /// Feed contour information to the tessellator. + /// + static_assert(sizeof(Point) == 2 * sizeof(float)); + for (size_t contour_i = 0; contour_i < polyline.contours.size(); + contour_i++) { + size_t start_point_index, end_point_index; + std::tie(start_point_index, end_point_index) = + polyline.GetContourPointBounds(contour_i); + + ::tessAddContour(tessellator, // the C tessellator + kVertexSize, // + polyline.points->data() + start_point_index, // + sizeof(Point), // + end_point_index - start_point_index // + ); + } + + //---------------------------------------------------------------------------- + /// Let's tessellate. + /// + auto result = ::tessTesselate(tessellator, // tessellator + ToTessWindingRule(fill_type), // winding + TESS_POLYGONS, // element type + kPolygonSize, // polygon size + kVertexSize, // vertex size + nullptr // normal (null is automatic) + ); + + if (result != 1) { + return Result::kTessellationError; + } + + int element_item_count = tessGetElementCount(tessellator) * kPolygonSize; + + // We default to using a 16bit index buffer, but in cases where we generate + // more tessellated data than this can contain we need to fall back to + // dropping the index buffer entirely. Instead code could instead switch to + // a uint32 index buffer, but this is done for simplicity with the other + // fast path above. + if (element_item_count < USHRT_MAX) { + int vertex_item_count = tessGetVertexCount(tessellator); + auto vertices = tessGetVertices(tessellator); + auto elements = tessGetElements(tessellator); + + // libtess uses an int index internally due to usage of -1 as a sentinel + // value. + std::vector indices(element_item_count); + for (int i = 0; i < element_item_count; i++) { + indices[i] = static_cast(elements[i]); + } + if (!callback(vertices, vertex_item_count, indices.data(), + element_item_count)) { + return Result::kInputError; + } + } else { + std::vector points; + std::vector data; + + int vertex_item_count = tessGetVertexCount(tessellator) * kVertexSize; + auto vertices = tessGetVertices(tessellator); + points.reserve(vertex_item_count); + for (int i = 0; i < vertex_item_count; i += 2) { + points.emplace_back(vertices[i], vertices[i + 1]); + } + + int element_item_count = tessGetElementCount(tessellator) * kPolygonSize; + auto elements = tessGetElements(tessellator); + data.reserve(element_item_count); + for (int i = 0; i < element_item_count; i++) { + data.emplace_back(points[elements[i]].x); + data.emplace_back(points[elements[i]].y); + } + if (!callback(data.data(), element_item_count, nullptr, 0u)) { + return Result::kInputError; + } + } + + return Result::kSuccess; +} + +void DestroyTessellator(TESStesselator* tessellator) { + if (tessellator != nullptr) { + ::tessDeleteTess(tessellator); + } +} + +} // namespace impeller diff --git a/impeller/tessellator/tessellator_libtess.h b/impeller/tessellator/tessellator_libtess.h new file mode 100644 index 0000000000000..ff8ecf1391fb5 --- /dev/null +++ b/impeller/tessellator/tessellator_libtess.h @@ -0,0 +1,72 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_IMPELLER_TESSELLATOR_TESSELLATOR_LIBTESS_H_ +#define FLUTTER_IMPELLER_TESSELLATOR_TESSELLATOR_LIBTESS_H_ + +#include +#include + +#include "impeller/geometry/path.h" +#include "impeller/tessellator/tessellator.h" + +struct TESStesselator; + +namespace impeller { + +void DestroyTessellator(TESStesselator* tessellator); + +using CTessellator = + std::unique_ptr; + +//------------------------------------------------------------------------------ +/// @brief An extended tessellator that offers arbitrary/concave +/// tessellation via the libtess2 library. +/// +/// This object is not thread safe, and its methods must not be +/// called from multiple threads. +/// +class TessellatorLibtess : public Tessellator { + public: + TessellatorLibtess(); + + ~TessellatorLibtess(); + + /// @brief A callback that returns the results of the tessellation. + /// + /// The index buffer may not be populated, in which case [indices] will + /// be nullptr and indices_count will be 0. + using BuilderCallback = std::function; + + //---------------------------------------------------------------------------- + /// @brief Generates filled triangles from the path. A callback is + /// invoked once for the entire tessellation. + /// + /// @param[in] path The path to tessellate. + /// @param[in] tolerance The tolerance value for conversion of the path to + /// a polyline. This value is often derived from the + /// Matrix::GetMaxBasisLength of the CTM applied to the + /// path for rendering. + /// @param[in] callback The callback, return false to indicate failure. + /// + /// @return The result status of the tessellation. + /// + Tessellator::Result Tessellate(const Path& path, + Scalar tolerance, + const BuilderCallback& callback); + + private: + CTessellator c_tessellator_; + + TessellatorLibtess(const TessellatorLibtess&) = delete; + + TessellatorLibtess& operator=(const TessellatorLibtess&) = delete; +}; + +} // namespace impeller + +#endif // FLUTTER_IMPELLER_TESSELLATOR_TESSELLATOR_LIBTESS_H_ diff --git a/impeller/tessellator/tessellator_unittests.cc b/impeller/tessellator/tessellator_unittests.cc index 2c54d4282db01..571308eff828e 100644 --- a/impeller/tessellator/tessellator_unittests.cc +++ b/impeller/tessellator/tessellator_unittests.cc @@ -8,7 +8,7 @@ #include "impeller/geometry/geometry_asserts.h" #include "impeller/geometry/path.h" #include "impeller/geometry/path_builder.h" -#include "impeller/tessellator/tessellator.h" +#include "impeller/tessellator/tessellator_libtess.h" namespace impeller { namespace testing { @@ -16,7 +16,7 @@ namespace testing { TEST(TessellatorTest, TessellatorBuilderReturnsCorrectResultStatus) { // Zero points. { - Tessellator t; + TessellatorLibtess t; auto path = PathBuilder{}.TakePath(FillType::kOdd); Tessellator::Result result = t.Tessellate( path, 1.0f, @@ -28,7 +28,7 @@ TEST(TessellatorTest, TessellatorBuilderReturnsCorrectResultStatus) { // One point. { - Tessellator t; + TessellatorLibtess t; auto path = PathBuilder{}.LineTo({0, 0}).TakePath(FillType::kOdd); Tessellator::Result result = t.Tessellate( path, 1.0f, @@ -40,7 +40,7 @@ TEST(TessellatorTest, TessellatorBuilderReturnsCorrectResultStatus) { // Two points. { - Tessellator t; + TessellatorLibtess t; auto path = PathBuilder{}.AddLine({0, 0}, {0, 1}).TakePath(FillType::kOdd); Tessellator::Result result = t.Tessellate( path, 1.0f, @@ -52,7 +52,7 @@ TEST(TessellatorTest, TessellatorBuilderReturnsCorrectResultStatus) { // Many points. { - Tessellator t; + TessellatorLibtess t; PathBuilder builder; for (int i = 0; i < 1000; i++) { auto coord = i * 1.0f; @@ -69,7 +69,7 @@ TEST(TessellatorTest, TessellatorBuilderReturnsCorrectResultStatus) { // Closure fails. { - Tessellator t; + TessellatorLibtess t; auto path = PathBuilder{}.AddLine({0, 0}, {0, 1}).TakePath(FillType::kOdd); Tessellator::Result result = t.Tessellate( path, 1.0f,