22 fName.
printf(
"hardstop_scale_num_colors_%s_%03d_colors",
51 constexpr int kNumColorChoices = 4;
52 SkColor color_choices[kNumColorChoices] = {
61 for (
int i = 0;
i < fColorCount;
i++) {
62 colors[
i] = color_choices[
i % kNumColorChoices];
69 for (
int i = 2;
i < fColorCount;
i++) {
71 positions[
i] =
i / (fColorCount - 1.0f);
87 for (
int i = 0;
i < loops;
i++) {
93 static const int kSize = 500;
static const int points[]
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
const char * onGetName() override
HardStopGradientBench_ScaleNumColors(SkTileMode tilemode, int count)
SkISize onGetSize() override
void onPreDraw(SkCanvas *canvas) override
void onDraw(int loops, SkCanvas *canvas) override
void drawPaint(const SkPaint &paint)
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)
void setShader(sk_sp< SkShader > shader)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
PODArray< SkColor > colors
static constexpr SkISize Make(int32_t w, int32_t h)
static constexpr SkPoint Make(float x, float y)