chromium/third_party/blink/renderer/core/paint/nine_piece_image_grid.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/paint/nine_piece_image_grid.h"

#include "third_party/blink/renderer/core/layout/geometry/box_strut.h"
#include "third_party/blink/renderer/platform/geometry/length_functions.h"
#include "ui/gfx/geometry/outsets.h"

namespace blink {

namespace {

LayoutUnit ComputeEdgeWidth(const BorderImageLength& border_slice,
                            int border_side,
                            float image_side,
                            int box_extent) {}

float ComputeEdgeSlice(const Length& slice, float slice_scale, float maximum) {}

// "Round" the edge widths, adhering to the following restrictions:
//
//  1) Perform rounding in the same way as for borders, thus preferring
//     symmetry.
//
//  2) If edges are abutting, then distribute the space (i.e the single pixel)
//     to the edge with the highest coverage - giving the starting edge
//     precedence if tied.
//
gfx::Outsets SnapEdgeWidths(const PhysicalBoxStrut& edge_widths,
                            const gfx::Size& snapped_box_size) {}

}  // namespace

NinePieceImageGrid::NinePieceImageGrid(const NinePieceImage& nine_piece_image,
                                       const gfx::SizeF& image_size,
                                       const gfx::Vector2dF& slice_scale,
                                       float zoom,
                                       const gfx::Rect& border_image_area,
                                       const gfx::Outsets& border_widths,
                                       PhysicalBoxSides sides_to_include)
    :{}

// Given a rectangle, construct a subrectangle using offset, width and height.
// Negative offsets are relative to the extent of the given rectangle.
static gfx::RectF Subrect(const gfx::RectF& rect,
                          float offset_x,
                          float offset_y,
                          float width,
                          float height) {}

static gfx::RectF Subrect(const gfx::Rect& rect,
                          float offset_x,
                          float offset_y,
                          float width,
                          float height) {}

static gfx::RectF Subrect(const gfx::SizeF& size,
                          float offset_x,
                          float offset_y,
                          float width,
                          float height) {}

static inline void SetCornerPiece(
    NinePieceImageGrid::NinePieceDrawInfo& draw_info,
    bool is_drawable,
    const gfx::RectF& source,
    const gfx::RectF& destination) {}

void NinePieceImageGrid::SetDrawInfoCorner(NinePieceDrawInfo& draw_info,
                                           NinePiece piece) const {}

static inline void SetHorizontalEdge(
    NinePieceImageGrid::NinePieceDrawInfo& draw_info,
    const NinePieceImageGrid::Edge& edge,
    const gfx::RectF& source,
    const gfx::RectF& destination,
    ENinePieceImageRule tile_rule) {}

static inline void SetVerticalEdge(
    NinePieceImageGrid::NinePieceDrawInfo& draw_info,
    const NinePieceImageGrid::Edge& edge,
    const gfx::RectF& source,
    const gfx::RectF& destination,
    ENinePieceImageRule tile_rule) {}

void NinePieceImageGrid::SetDrawInfoEdge(NinePieceDrawInfo& draw_info,
                                         NinePiece piece) const {}

void NinePieceImageGrid::SetDrawInfoMiddle(NinePieceDrawInfo& draw_info) const {}

NinePieceImageGrid::NinePieceDrawInfo NinePieceImageGrid::GetNinePieceDrawInfo(
    NinePiece piece) const {}

}  // namespace blink