37 double min = +INFINITY,
39 for (
int y = 0;
y <
H;
y++)
40 for (
int x = 0;
x < W;
x++) {
41 auto start = std::chrono::steady_clock::now();
46 auto elapsed = std::chrono::steady_clock::now() -
start;
48 cost[
y][
x] = elapsed.count();
57 for (
int y = 0;
y <
H;
y++)
58 for (
int x = 0;
x <
W;
x++) {
71 for (
int y = 0;
y <
H;
y++)
72 for (
int x = 0;
x <
W;
x++) {
73 auto start = std::chrono::steady_clock::now();
74 offscreen->getCanvas()->drawImageRect(fImg,
80 auto elapsed = std::chrono::steady_clock::now() -
start;
82 cost[
y][
x] = elapsed.count();
86 for (
int y = 0;
y <
H;
y++)
87 for (
int x = 0;
x <
W;
x++) {
95 inline static constexpr int W = 24,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void scale(SkScalar sx, SkScalar sy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
sk_sp< SkImage > makeImageSnapshot()
void load(SkScalar w, SkScalar h) override
void draw(SkCanvas *canvas) override
static float max(float r, float g, float b)
static float min(float r, float g, float b)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SkSamplingOptions(SkFilterMode::kLinear))
SkImageInfo makeWH(int newWidth, int newHeight) const
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)