36 static constexpr int W = 64*2;
37 static constexpr int H = 48*2;
38 static constexpr int ROW = 20;
39 static constexpr int COL = 20;
40 static constexpr int PTS = (ROW + 1) * (COL + 1);
41 static constexpr int IDX = ROW * COL * 6;
49 static void load_2_tris(uint16_t idx[],
int x,
int y,
int rb) {
51 idx[0] = n; idx[1] = n + 1; idx[2] = rb + n + 1;
52 idx[3] = n; idx[4] = rb + n + 1; idx[5] = n + rb;
55 void onDelayedSetup()
override {
75 for (
int y = 0;
y <= ROW;
y++) {
77 for (
int x = 0;
x <= COL; ++
x) {
82 if (
x < COL &&
y < ROW) {
83 load_2_tris(idx,
x,
y, COL + 1);
84 for (
int i = 0;
i < 6;
i++) {
101 for (
int i = 0;
i < PTS; ++
i) {
102 fColors[
i] = rand.
nextU() | (0xFF << 24);
107 fName.append(
"_textures");
110 fName.append(
"_colors");
113 fName.append(
"_persp");
116 fName.append(
"_bilerp");
125 paint.setShader(fShader);
135 for (
int i = 0;
i < loops;
i++) {
153#include
"include/core/SkRSXform.h"
154#include
"src/base/SkRandom.h"
155#include
"tools/Resources.h"
167 static constexpr int W = 640;
168 static constexpr int H = 480;
169 static constexpr int N = 10*1000;
178 fName.printf(
"drawAtlas");
180 fName.append(
"_colors");
183 fName.append(
"_rotated");
186 fName.append(
"_persp");
204 scos = 0.866025403784439f;
209 for (
int i = 0;
i <
N; ++
i) {
211 rand.
nextF() * (imageH - 8), 8, 8);
212 fColors[
i] = rand.
nextU() | 0xFF000000;
217 const SkRect* cullRect =
nullptr;
218 const SkPaint* paintPtr =
nullptr;
226 for (
int i = 0;
i < loops;
i++) {
static void tiny_persp_effect(SkCanvas *canvas)
void onDelayedSetup() override
const char * onGetName() override
AtlasBench(unsigned flags)
void onDraw(int loops, SkCanvas *canvas) override
virtual void setupPaint(SkPaint *paint)
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
void concat(const SkMatrix &matrix)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
const char * onGetName() override
VertBench(unsigned flags)
void onDraw(int loops, SkCanvas *canvas) override
FlutterSemanticsFlag flags
PODArray< SkColor > colors
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
SkSamplingOptions(SkFilterMode::kLinear))
void set(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)