blob: c863bf75f8a7964dbc6d56d516bd31952beb2d3c [file]
// Copyright 2019 Google LLC
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "tools/fiddle/examples.h"
REG_FIDDLE(Paint_setShader, 256, 64, false, 0) {
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setColor(SK_ColorBLUE);
paint.setShader(SkShaders::Color(SK_ColorRED));
canvas->drawRect(SkRect::MakeWH(40, 40), paint);
paint.setShader(nullptr);
canvas->translate(50, 0);
canvas->drawRect(SkRect::MakeWH(40, 40), paint);
}
} // END FIDDLE