chromium/third_party/blink/renderer/platform/geometry/float_rounded_rect.cc

/*
 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above
 *    copyright notice, this list of conditions and the following
 *    disclaimer.
 * 2. Redistributions in binary form must reproduce the above
 *    copyright notice, this list of conditions and the following
 *    disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/platform/geometry/float_rounded_rect.h"

#include <algorithm>
#include <cmath>

#include "third_party/blink/renderer/platform/geometry/infinite_int_rect.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "ui/gfx/geometry/insets_f.h"
#include "ui/gfx/geometry/quad_f.h"

namespace blink {

FloatRoundedRect::FloatRoundedRect(float x, float y, float width, float height)
    :{}

FloatRoundedRect::FloatRoundedRect(const gfx::RectF& rect, const Radii& radii)
    :{}

FloatRoundedRect::FloatRoundedRect(const gfx::Rect& rect, const Radii& radii)
    :{}

FloatRoundedRect::FloatRoundedRect(const gfx::RectF& rect,
                                   const gfx::SizeF& top_left,
                                   const gfx::SizeF& top_right,
                                   const gfx::SizeF& bottom_left,
                                   const gfx::SizeF& bottom_right)
    :{}

FloatRoundedRect::FloatRoundedRect(const gfx::RRectF& r)
    :{}

void FloatRoundedRect::Radii::SetMinimumRadius(float minimum_radius) {}

std::optional<float> FloatRoundedRect::Radii::UniformRadius() const {}

void FloatRoundedRect::Radii::Scale(float factor) {}

void FloatRoundedRect::Radii::Outset(const gfx::OutsetsF& outsets) {}

// From: https://drafts.csswg.org/css-backgrounds-3/#corner-shaping
// ... in order to create a sharper corner when the border radius is small (and
// thus ensure continuity between round and sharp corners), when the border
// radius is less than the margin, the margin is multiplied by the proportion
// 1 + (r-1)^3, where r is the ratio of the border radius to the margin, in
// calculating the corner radii of the margin box shape.
// And https://drafts.csswg.org/css-backgrounds-3/#shadow-shape:
// ... For example, if the border radius is 10px and the spread distance is
// 20px (r = .5), the corner radius of the shadow shape will be
// 10px + 20px × (1 + (.5 - 1)^3) = 27.5px rather than 30px. This adjustment
// is applied independently to the radii in each dimension.
static void OutsetCornerForMarginOrShadow(gfx::SizeF& corner,
                                          float width_outset,
                                          float height_outset) {}

void FloatRoundedRect::Radii::OutsetForMarginOrShadow(
    const gfx::OutsetsF& outsets) {}

void FloatRoundedRect::Radii::OutsetForShapeMargin(float outset) {}

static inline float CornerRectIntercept(float y,
                                        const gfx::RectF& corner_rect) {}

bool FloatRoundedRect::XInterceptsAtY(float y,
                                      float& min_x_intercept,
                                      float& max_x_intercept) const {}

void FloatRoundedRect::Outset(const gfx::OutsetsF& outsets) {}

void FloatRoundedRect::OutsetForMarginOrShadow(const gfx::OutsetsF& outsets) {}

void FloatRoundedRect::OutsetForShapeMargin(float outset) {}

bool FloatRoundedRect::IntersectsQuad(const gfx::QuadF& quad) const {}

void FloatRoundedRect::ConstrainRadii() {}

bool FloatRoundedRect::IsRenderable() const {}

std::ostream& operator<<(std::ostream& ostream, const FloatRoundedRect& rect) {}

std::ostream& operator<<(std::ostream& ostream,
                         const FloatRoundedRect::Radii& radii) {}

String FloatRoundedRect::Radii::ToString() const {}

String FloatRoundedRect::ToString() const {}

}  // namespace blink