2019-03-15 18:22:51 +00:00
|
|
|
// Copyright 2019 Google LLC.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "tools/fiddle/examples.h"
|
2019-03-15 18:22:51 +00:00
|
|
|
// HASH=77e64d5bae9b1ba037fd99252bb4aa58
|
2019-03-18 20:06:34 +00:00
|
|
|
REG_FIDDLE(Paint_setShader, 256, 64, false, 0) {
|
2019-03-15 18:22:51 +00:00
|
|
|
void draw(SkCanvas* canvas) {
|
|
|
|
SkPaint paint;
|
|
|
|
paint.setColor(SK_ColorBLUE);
|
2019-04-09 17:55:36 +00:00
|
|
|
paint.setShader(SkShaders::Color(SK_ColorRED));
|
2019-03-15 18:22:51 +00:00
|
|
|
canvas->drawRect(SkRect::MakeWH(40, 40), paint);
|
|
|
|
paint.setShader(nullptr);
|
|
|
|
canvas->translate(50, 0);
|
|
|
|
canvas->drawRect(SkRect::MakeWH(40, 40), paint);
|
|
|
|
}
|
|
|
|
} // END FIDDLE
|