chromium/third_party/skia/src/core/SkEdgeClipper.cpp

/*
 * Copyright 2009 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/core/SkEdgeClipper.h"

#include "include/core/SkRect.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkMacros.h"
#include "src/core/SkGeometry.h"
#include "src/core/SkLineClipper.h"
#include "src/core/SkPathPriv.h"

#include <algorithm>
#include <cstring>

static bool quick_reject(const SkRect& bounds, const SkRect& clip) {}

static inline void clamp_le(SkScalar& value, SkScalar max) {}

static inline void clamp_ge(SkScalar& value, SkScalar min) {}

/*  src[] must be monotonic in Y. This routine copies src into dst, and sorts
 it to be increasing in Y. If it had to reverse the order of the points,
 it returns true, otherwise it returns false
 */
static bool sort_increasing_Y(SkPoint dst[], const SkPoint src[], int count) {}

bool SkEdgeClipper::clipLine(SkPoint p0, SkPoint p1, const SkRect& clip) {}

///////////////////////////////////////////////////////////////////////////////

static bool chopMonoQuadAt(SkScalar c0, SkScalar c1, SkScalar c2,
                           SkScalar target, SkScalar* t) {}

static bool chopMonoQuadAtY(SkPoint pts[3], SkScalar y, SkScalar* t) {}

static bool chopMonoQuadAtX(SkPoint pts[3], SkScalar x, SkScalar* t) {}

// Modify pts[] in place so that it is clipped in Y to the clip rect
static void chop_quad_in_Y(SkPoint pts[3], const SkRect& clip) {}

// srcPts[] must be monotonic in X and Y
void SkEdgeClipper::clipMonoQuad(const SkPoint srcPts[3], const SkRect& clip) {}

bool SkEdgeClipper::clipQuad(const SkPoint srcPts[3], const SkRect& clip) {}

///////////////////////////////////////////////////////////////////////////////

static SkScalar mono_cubic_closestT(const SkScalar src[], SkScalar x) {}

static void chop_mono_cubic_at_y(SkPoint src[4], SkScalar y, SkPoint dst[7]) {}

// Modify pts[] in place so that it is clipped in Y to the clip rect
static void chop_cubic_in_Y(SkPoint pts[4], const SkRect& clip) {}

static void chop_mono_cubic_at_x(SkPoint src[4], SkScalar x, SkPoint dst[7]) {}

// srcPts[] must be monotonic in X and Y
void SkEdgeClipper::clipMonoCubic(const SkPoint src[4], const SkRect& clip) {}

static SkRect compute_cubic_bounds(const SkPoint pts[4]) {}

static bool too_big_for_reliable_float_math(const SkRect& r) {}

bool SkEdgeClipper::clipCubic(const SkPoint srcPts[4], const SkRect& clip) {}

///////////////////////////////////////////////////////////////////////////////

void SkEdgeClipper::appendLine(SkPoint p0, SkPoint p1) {}

void SkEdgeClipper::appendVLine(SkScalar x, SkScalar y0, SkScalar y1, bool reverse) {}

void SkEdgeClipper::appendQuad(const SkPoint pts[3], bool reverse) {}

void SkEdgeClipper::appendCubic(const SkPoint pts[4], bool reverse) {}

SkPath::Verb SkEdgeClipper::next(SkPoint pts[]) {}

///////////////////////////////////////////////////////////////////////////////

#ifdef SK_DEBUG
static void assert_monotonic(const SkScalar coord[], int count) {}

void sk_assert_monotonic_y(const SkPoint pts[], int count) {}

void sk_assert_monotonic_x(const SkPoint pts[], int count) {}
#endif

void SkEdgeClipper::ClipPath(const SkPath& path, const SkRect& clip, bool canCullToTheRight,
                             void (*consume)(SkEdgeClipper*, bool newCtr, void* ctx), void* ctx) {}