39 const SkPoint pt = { wScalar / 2, hScalar / 2 };
41 const SkScalar radius = 4 * std::max(wScalar, hScalar);
60 for (
int i = 0; i < 4; ++i) {
68 rect.inset(wScalar / 8, hScalar / 8);
71 return surface->makeImageSnapshot();
82 fName.
set(
"drawminibitmaprect");
94 if (
nullptr == fImage) {
101 constexpr int kPadX = 30;
102 constexpr int kPadY = 40;
110 paint.setAntiAlias(fAA);
111 for (
int w = 1;
w <= kMaxSrcRectSize;
w *= 3) {
112 for (
int h = 1;
h <= kMaxSrcRectSize;
h *= 3) {
117 switch (random.
nextU() % 3) {
135 if ((dstRect.
width() + 2 * kPadX) * rowCount >
gSize) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
static int SkNextLog2(uint32_t value)
SkString getName() const override
SkISize getISize() override
DrawMiniBitmapRectGM(bool antiAlias)
void onDraw(SkCanvas *canvas) override
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
@ kFast_SrcRectConstraint
sample outside bounds; faster
void rotate(SkScalar degrees)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
static const SkMatrix & I()
void set(const SkString &src)
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
constexpr int gSurfaceSize
static sk_sp< SkImage > makebm(int w, int h)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkRect Make(const SkISize &size)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)