31 ImageCycle(
int imageCnt,
int repeatCnt) : fImageCnt(imageCnt), fRepeatCnt(repeatCnt) {
32 fName.
appendf(
"image_cycle_image_cnt_%d_repeat_cnt_%d", fImageCnt, fRepeatCnt);
44 fImages = std::make_unique<sk_sp<SkImage>[]>(fImageCnt);
45 for (
int i = 0;
i < fImageCnt; ++
i) {
48 surf->getCanvas()->clear(
color);
52 surf->getCanvas()->drawRect(
54 fImages[
i] = surf->makeImageSnapshot();
62 paint.setAntiAlias(
true);
66 static const int imagesPerRow =
69 for (
int l = 0; l < loops; ++l) {
70 for (
int r = 0; r < fRepeatCnt; ++r) {
71 for (
int i = 0;
i < fImageCnt; ++
i) {
87 inline static constexpr SkISize kImageSize{4, 4};
88 inline static constexpr SkISize kDeviceSize{64, 64};
90 std::unique_ptr<sk_sp<SkImage>[]> fImages;
DEF_BENCH(return new ImageCycle(5, 10))
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define SkScalarCeilToInt(x)
#define SkScalarFloorToInt(x)
void onDraw(int loops, SkCanvas *canvas) override
void onPerCanvasPostDraw(SkCanvas *) override
void onPerCanvasPreDraw(SkCanvas *canvas) override
bool isSuitableFor(Backend backend) override
ImageCycle(int imageCnt, int repeatCnt)
const char * onGetName() override
SkSurface * getSurface() const
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
const char * c_str() const
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
const myers::Point & get(const myers::Segment &)
void FlushAndSubmit(SkSurface *surface)
SkSamplingOptions(SkFilterMode::kLinear))
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)