16#define FILTER_WIDTH_SMALL 32
17#define FILTER_HEIGHT_SMALL 32
18#define FILTER_WIDTH_LARGE 256
19#define FILTER_HEIGHT_LARGE 256
39 paint.setColor(0xFF884422);
44 fImage = surf->makeImageSnapshot();
52 canvas->
clear(0x00000000);
57 for (
int y = 0;
y <
h;
y += 16) {
58 for (
int x = 0;
x <
w;
x += 16) {
79 inline bool isSmall()
const {
return fIsSmall; }
95 return this->
isSmall() ?
"displacement_zero_small" :
"displacement_zero_large";
103 0.0f, std::move(displ),
nullptr));
105 for (
int i = 0;
i < loops;
i++) {
120 return isSmall() ?
"displacement_alpha_small" :
"displacement_alpha_large";
128 16.0f, std::move(displ),
nullptr));
129 for (
int i = 0;
i < loops;
i++) {
144 return isSmall() ?
"displacement_full_small" :
"displacement_full_large";
152 32.0f, std::move(displ),
nullptr));
153 for (
int i = 0;
i < loops; ++
i) {
#define FILTER_WIDTH_SMALL
#define FILTER_WIDTH_LARGE
#define FILTER_HEIGHT_SMALL
#define FILTER_HEIGHT_LARGE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void onDraw(int loops, SkCanvas *canvas) override
DisplacementAlphaBench(bool small)
const char * onGetName() override
DisplacementBaseBench(bool small)
sk_sp< SkImage > fCheckerboard
void drawClippedBitmap(SkCanvas *canvas, int x, int y, const SkPaint &paint)
void onDelayedSetup() override
const char * onGetName() override
void onDraw(int loops, SkCanvas *canvas) override
DisplacementFullBench(bool small)
void onDraw(int loops, SkCanvas *canvas) override
const char * onGetName() override
DisplacementZeroBench(bool small)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void clipIRect(const SkIRect &irect, SkClipOp op=SkClipOp::kIntersect)
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkImageFilter > DisplacementMap(SkColorChannel xChannelSelector, SkColorChannel yChannelSelector, SkScalar scale, sk_sp< SkImageFilter > displacement, sk_sp< SkImageFilter > color, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
void setColor(SkColor color)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
font
Font Metadata and Metrics.
SkSamplingOptions(SkFilterMode::kLinear))
constexpr SkIRect makeOffset(int32_t dx, int32_t dy) const
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)