chromium/third_party/skia/src/gpu/ganesh/geometry/GrAATriangulator.cpp

/*
 * Copyright 2020 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/gpu/ganesh/geometry/GrAATriangulator.h"

#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
#include "include/core/SkPathTypes.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkMath.h"
#include "src/gpu/BufferWriter.h"
#include "src/gpu/ganesh/GrEagerVertexAllocator.h"

#include <cstddef>
#include <queue>
#include <unordered_map>
#include <utility>
#include <vector>

#if TRIANGULATOR_LOGGING
#define TESS_LOG
#define DUMP_MESH
#else
#define TESS_LOG(...)
#define DUMP_MESH(MESH)
#endif

constexpr static float kCosMiterAngle =; // Corresponds to an angle of ~14 degrees.

EdgeType;
Vertex;
VertexList;
Line;
Edge;
EdgeList;
Poly;
Comparator;
SSEdge;
EventList;
Event;
EventComparator;

struct SSVertex {};

struct GrAATriangulator::SSEdge {};

SSVertexMap;
SSEdgeList;
EventPQ;

struct GrAATriangulator::EventList : EventPQ {};

void GrAATriangulator::makeEvent(SSEdge* e, EventList* events) const {}

void GrAATriangulator::makeEvent(SSEdge* edge, Vertex* v, SSEdge* other, Vertex* dest,
                                 EventList* events, const Comparator& c) const {}

void GrAATriangulator::connectPartners(VertexList* mesh, const Comparator& c) {}

static void dump_skel(const SSEdgeList& ssEdges) {}

void GrAATriangulator::removeNonBoundaryEdges(const VertexList& mesh) const {}

// Note: this is the normal to the edge, but not necessarily unit length.
static void get_edge_normal(const Edge* e, SkVector* normal) {}

// Stage 5c: detect and remove "pointy" vertices whose edge normals point in opposite directions
// and whose adjacent vertices are less than a quarter pixel from an edge. These are guaranteed to
// invert on stroking.

void GrAATriangulator::simplifyBoundary(EdgeList* boundary, const Comparator& c) {}

void GrAATriangulator::connectSSEdge(Vertex* v, Vertex* dest, const Comparator& c) {}

void GrAATriangulator::Event::apply(VertexList* mesh, const Comparator& c, EventList* events,
                                    GrAATriangulator* triangulator) {}

static bool is_overlap_edge(Edge* e) {}

// This is a stripped-down version of tessellate() which computes edges which
// join two filled regions, which represent overlap regions, and collapses them.
bool GrAATriangulator::collapseOverlapRegions(VertexList* mesh, const Comparator& c,
                                              EventComparator comp) {}

static bool inversion(Vertex* prev, Vertex* next, Edge* origEdge, const Comparator& c) {}

// Stage 5d: Displace edges by half a pixel inward and outward along their normals. Intersect to
// find new vertices, and set zero alpha on the exterior and one alpha on the interior. Build a
// new antialiased mesh from those vertices.

void GrAATriangulator::strokeBoundary(EdgeList* boundary, VertexList* innerMesh,
                                      const Comparator& c) {}

void GrAATriangulator::extractBoundary(EdgeList* boundary, Edge* e) const {}

// Stage 5b: Extract boundaries from mesh, simplify and stroke them into a new mesh.

void GrAATriangulator::extractBoundaries(const VertexList& inMesh, VertexList* innerVertices,
                                         const Comparator& c) {}

std::tuple<Poly*, bool> GrAATriangulator::tessellate(const VertexList& mesh, const Comparator& c) {}

int GrAATriangulator::polysToAATriangles(Poly* polys,
                                         GrEagerVertexAllocator* vertexAllocator) const {}

#endif // SK_ENABLE_OPTIMIZE_SIZE