55 return 0xFF000000 | (old + 0x00010307);
57 return (0x00FFFFFF & (old + 0x00010307)) | 0x80000000;
66 for (
size_t i = 0;
i <
lower.size();
i++) {
76 , fPerspective(perspective)
87 paint.setAntiAlias(fAA);
88 paint.setBlendMode(fMode);
94 static const SkScalar kRectW = 25.1f;
95 static const SkScalar kRectH = 25.9f;
99 SkPoint pts[2] = { {0.0f, 0.0f}, {kRectW, kRectH} };
107 rotate.setRotate(30.f, kRectW / 2, kRectH / 2);
119 canvas->
concat(perspective);
122 for (
int i = 0;
i < loops; ++
i) {
147 fName =
"rotated_rects";
156 switch (fColorType) {
158 fName.
append(
"_same_opaque");
161 fName.
append(
"_same_transparent");
164 fName.
append(
"_changing_opaque");
167 fName.
append(
"_changing_transparent");
170 fName.
append(
"_alternating_transparent_and_opaque");
173 fName.
append(
"_shader_opaque");
188#define DEF_FOR_COLOR_TYPES(aa, blend) \
189 DEF_BENCH(return new RotRectBench(aa, kConstantOpaque_ColorType, blend);) \
190 DEF_BENCH(return new RotRectBench(aa, kConstantTransparent_ColorType, blend);) \
191 DEF_BENCH(return new RotRectBench(aa, kChangingOpaque_ColorType, blend);) \
192 DEF_BENCH(return new RotRectBench(aa, kChangingTransparent_ColorType, blend);) \
193 DEF_BENCH(return new RotRectBench(aa, kAlternatingOpaqueAndTransparent_ColorType, blend);) \
194 DEF_BENCH(return new RotRectBench(aa, kShaderOpaque_ColorType, blend);)
195#define DEF_FOR_AA_MODES(blend) \
196 DEF_FOR_COLOR_TYPES(true, blend) \
197 DEF_FOR_COLOR_TYPES(false, blend)
206#define DEF_FOR_PERSP_MODES(aa) \
207 DEF_BENCH(return new RotRectBench(aa, kConstantOpaque_ColorType, SkBlendMode::kSrcOver, true);)\
208 DEF_BENCH(return new RotRectBench(aa, kShaderOpaque_ColorType, SkBlendMode::kSrcOver, true);)
static int step(int x, SkScalar min, SkScalar max)
static SkString to_lower(const char *str)
@ kAlternatingOpaqueAndTransparent_ColorType
@ kChangingTransparent_ColorType
@ kConstantTransparent_ColorType
@ kConstantOpaque_ColorType
@ kChangingOpaque_ColorType
@ kShaderOpaque_ColorType
#define DEF_FOR_PERSP_MODES(aa)
#define DEF_FOR_AA_MODES(blend)
static SkColor start_color(ColorType ct)
static SkColor advance_color(SkColor old, ColorType ct, int step)
#define SK_ABORT(message,...)
SK_API const char * SkBlendMode_Name(SkBlendMode blendMode)
@ kSrcOver
r = s + (1-sa)*d
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorWHITE
static bool rotate(const SkDCubic &cubic, int zero, int index, SkDCubic &rotPath)
const char * onGetName() override
void onDraw(int loops, SkCanvas *canvas) override
RotRectBench(bool aa, ColorType ct, SkBlendMode mode, bool perspective=false)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void concat(const SkMatrix &matrix)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
SkMatrix & setSkewX(SkScalar v)
SkMatrix & setPerspX(SkScalar v)
SkMatrix & setPerspY(SkScalar v)
void append(const char text[])
const char * c_str() const
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
PODArray< SkColor > colors
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
constexpr int32_t width() const
constexpr int32_t height() const
static constexpr SkRect MakeWH(float w, float h)