24 const int kTileSize = 1 << 10;
28 const int kBitmapLongEdge = 7 * kTileSize;
29 const int kBitmapShortEdge = 1 * kTileSize;
34 const int kBitmapArea = kBitmapLongEdge * kBitmapShortEdge;
35 const size_t kBitmapBytes = kBitmapArea *
sizeof(
SkPMColor);
37 const size_t newMaxResourceBytes = kBitmapBytes + (kBitmapBytes / 2);
38 dContext->setResourceCacheLimit(newMaxResourceBytes);
44 vertical ? kBitmapLongEdge : kBitmapShortEdge,
true);
48 for (
int i = 0;
i < 10; ++
i) {
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
DEF_SIMPLE_GM_BG(bitmaptiled_fractional_horizontal, canvas, 1124, 365, SK_ColorBLACK)
static void draw_tile_bitmap_with_fractional_offset(SkCanvas *canvas, bool vertical, bool manual)
sk_sp< SkImage > asImage() const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void eraseColor(SkColor4f) const
virtual GrRecordingContext * recordingContext() const
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
SK_API void DrawImageRect(SkCanvas *canvas, const SkImage *image, const SkRect &src, const SkRect &dst, const SkSamplingOptions &sampling={}, const SkPaint *paint=nullptr, SkCanvas::SrcRectConstraint constraint=SkCanvas::kFast_SrcRectConstraint)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)