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

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

#include "include/core/SkRRect.h"

#include "include/core/SkMatrix.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkFloatingPoint.h"
#include "src/base/SkBuffer.h"
#include "src/core/SkRRectPriv.h"
#include "src/core/SkRectPriv.h"
#include "src/core/SkScaleToSides.h"
#include "src/core/SkStringUtils.h"

#include <algorithm>
#include <cstring>
#include <iterator>

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

void SkRRect::setOval(const SkRect& oval) {}

void SkRRect::setRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad) {}

static bool clamp_to_zero(SkVector radii[4]) {}

static bool radii_are_nine_patch(const SkVector radii[4]) {}

void SkRRect::setNinePatch(const SkRect& rect, SkScalar leftRad, SkScalar topRad,
                           SkScalar rightRad, SkScalar bottomRad) {}

// These parameters intentionally double. Apropos crbug.com/463920, if one of the
// radii is huge while the other is small, single precision math can completely
// miss the fact that a scale is required.
static double compute_min_scale(double rad1, double rad2, double limit, double curMin) {}

void SkRRect::setRectRadii(const SkRect& rect, const SkVector radii[4]) {}

bool SkRRect::initializeRect(const SkRect& rect) {}

// If we can't distinguish one of the radii relative to the other, force it to zero so it
// doesn't confuse us later. See crbug.com/850350
//
static void flush_to_zero(SkScalar& a, SkScalar& b) {}

bool SkRRect::scaleRadii() {}

// This method determines if a point known to be inside the RRect's bounds is
// inside all the corners.
bool SkRRect::checkCornerContainment(SkScalar x, SkScalar y) const {}

bool SkRRectPriv::IsNearlySimpleCircular(const SkRRect& rr, SkScalar tolerance) {}

bool SkRRectPriv::AllCornersCircular(const SkRRect& rr, SkScalar tolerance) {}

bool SkRRect::contains(const SkRect& rect) const {}

// There is a simplified version of this method in setRectXY
void SkRRect::computeType() {}

bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const {}

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

void SkRRect::inset(SkScalar dx, SkScalar dy, SkRRect* dst) const {}

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

size_t SkRRect::writeToMemory(void* buffer) const {}

void SkRRectPriv::WriteToBuffer(const SkRRect& rr, SkWBuffer* buffer) {}

size_t SkRRect::readFromMemory(const void* buffer, size_t length) {}

bool SkRRectPriv::ReadFromBuffer(SkRBuffer* buffer, SkRRect* rr) {}

SkString SkRRect::dumpToString(bool asHex) const {}

void SkRRect::dump(bool asHex) const {}

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

/**
 *  We need all combinations of predicates to be true to have a "safe" radius value.
 */
static bool are_radius_check_predicates_valid(SkScalar rad, SkScalar min, SkScalar max) {}

bool SkRRect::isValid() const {}

bool SkRRect::AreRectAndRadiiValid(const SkRect& rect, const SkVector radii[4]) {}
///////////////////////////////////////////////////////////////////////////////

SkRect SkRRectPriv::InnerBounds(const SkRRect& rr) {}

SkRRect SkRRectPriv::ConservativeIntersect(const SkRRect& a, const SkRRect& b) {}