#include "src/gpu/TiledTextureUtils.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkSize.h"
#include "src/base/SkSafeMath.h"
#include "src/core/SkCanvasPriv.h"
#include "src/core/SkDevice.h"
#include "src/core/SkImagePriv.h"
#include "src/core/SkSamplingPriv.h"
#include "src/image/SkImage_Base.h"
namespace {
static const int kBmpSmallTileSize = …;
size_t get_tile_count(const SkIRect& srcRect, int tileSize) { … }
int determine_tile_size(const SkIRect& src, int maxTileSize) { … }
SkIRect determine_clipped_src_rect(SkIRect clippedSrcIRect,
const SkMatrix& viewMatrix,
const SkMatrix& srcToDstRect,
const SkISize& imageDimensions,
const SkRect* srcRectPtr) { … }
int draw_tiled_bitmap(SkCanvas* canvas,
const SkBitmap& bitmap,
int tileSize,
const SkMatrix& srcToDst,
const SkRect& srcRect,
const SkIRect& clippedSrcIRect,
const SkPaint* paint,
SkCanvas::QuadAAFlags origAAFlags,
SkCanvas::SrcRectConstraint constraint,
SkSamplingOptions sampling) { … }
}
namespace skgpu {
bool TiledTextureUtils::ShouldTileImage(SkIRect conservativeClipBounds,
const SkISize& imageSize,
const SkMatrix& ctm,
const SkMatrix& srcToDst,
const SkRect* src,
int maxTileSize,
size_t cacheSize,
int* tileSize,
SkIRect* clippedSubset) { … }
TiledTextureUtils::ImageDrawMode TiledTextureUtils::OptimizeSampleArea(const SkISize& imageSize,
const SkRect& origSrcRect,
const SkRect& origDstRect,
const SkPoint dstClip[4],
SkRect* outSrcRect,
SkRect* outDstRect,
SkMatrix* outSrcToDst) { … }
bool TiledTextureUtils::CanDisableMipmap(const SkMatrix& viewM, const SkMatrix& localM) { … }
void TiledTextureUtils::ClampedOutsetWithOffset(SkIRect* iRect, int outset, SkPoint* offset,
const SkIRect& clamp) { … }
std::tuple<bool, size_t> TiledTextureUtils::DrawAsTiledImageRect(
SkCanvas* canvas,
const SkImage* image,
const SkRect& srcRect,
const SkRect& dstRect,
SkCanvas::QuadAAFlags aaFlags,
const SkSamplingOptions& origSampling,
const SkPaint* paint,
SkCanvas::SrcRectConstraint constraint,
size_t cacheSize,
size_t maxTextureSize) { … }
}