#include "cc/base/tiling_data.h"
#include <algorithm>
#include "base/check_op.h"
#include "base/notreached.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/vector2d.h"
namespace cc {
namespace {
const IndexRect kNonPositiveQuadrantIndexRect(-1, -1, -1, -1);
}
static int ComputeNumTiles(int max_texture_size,
int total_size,
int border_texels) { … }
TilingData::TilingData() : … { … }
TilingData::TilingData(const gfx::Size& max_texture_size,
const gfx::Rect& tiling_rect,
int border_texels)
: … { … }
void TilingData::SetTilingRect(const gfx::Rect& tiling_rect) { … }
void TilingData::SetMaxTextureSize(const gfx::Size& max_texture_size) { … }
int TilingData::TileXIndexFromSrcCoord(int src_position) const { … }
int TilingData::TileYIndexFromSrcCoord(int src_position) const { … }
int TilingData::FirstBorderTileXIndexFromSrcCoord(int src_position) const { … }
int TilingData::FirstBorderTileYIndexFromSrcCoord(int src_position) const { … }
int TilingData::LastBorderTileXIndexFromSrcCoord(int src_position) const { … }
int TilingData::LastBorderTileYIndexFromSrcCoord(int src_position) const { … }
IndexRect TilingData::TileAroundIndexRect(const gfx::Rect& center_rect) const { … }
gfx::Rect TilingData::ExpandRectToTileBounds(const gfx::Rect& rect) const { … }
gfx::Rect TilingData::TileBounds(int i, int j) const { … }
gfx::Rect TilingData::TileBoundsWithBorder(int i, int j) const { … }
int TilingData::TilePositionX(int x_index) const { … }
int TilingData::TilePositionY(int y_index) const { … }
int TilingData::TileSizeX(int x_index) const { … }
int TilingData::TileSizeY(int y_index) const { … }
gfx::RectF TilingData::TexelExtent(int i, int j) const { … }
gfx::Vector2d TilingData::TextureOffset(int x_index, int y_index) const { … }
void TilingData::RecomputeNumTiles() { … }
TilingData::BaseIterator::BaseIterator() : … { … }
TilingData::Iterator::Iterator() : … { … }
TilingData::Iterator::Iterator(const TilingData* tiling_data,
const gfx::Rect& consider_rect,
bool include_borders)
: … { … }
TilingData::Iterator& TilingData::Iterator::operator++() { … }
TilingData::BaseDifferenceIterator::BaseDifferenceIterator()
: … { … }
TilingData::BaseDifferenceIterator::BaseDifferenceIterator(
const TilingData* tiling_data,
const gfx::Rect& consider_rect,
const gfx::Rect& ignore_rect)
: … { … }
bool TilingData::BaseDifferenceIterator::HasConsiderRect() const { … }
TilingData::DifferenceIterator::DifferenceIterator() = default;
TilingData::DifferenceIterator::DifferenceIterator(
const TilingData* tiling_data,
const gfx::Rect& consider_rect,
const gfx::Rect& ignore_rect)
: … { … }
TilingData::DifferenceIterator& TilingData::DifferenceIterator::operator++() { … }
TilingData::SpiralDifferenceIterator::SpiralDifferenceIterator() { … }
TilingData::SpiralDifferenceIterator::SpiralDifferenceIterator(
const TilingData* tiling_data,
const gfx::Rect& consider_rect,
const gfx::Rect& ignore_rect,
const gfx::Rect& center_rect)
: … { … }
TilingData::SpiralDifferenceIterator& TilingData::SpiralDifferenceIterator::
operator++() { … }
TilingData::ReverseSpiralDifferenceIterator::ReverseSpiralDifferenceIterator() { … }
TilingData::ReverseSpiralDifferenceIterator::ReverseSpiralDifferenceIterator(
const TilingData* tiling_data,
const gfx::Rect& consider_rect,
const gfx::Rect& ignore_rect,
const gfx::Rect& center_rect)
: … { … }
TilingData::ReverseSpiralDifferenceIterator&
TilingData::ReverseSpiralDifferenceIterator::
operator++() { … }
}