Hal Canary | 83c2f70 | 2019-03-07 14:53:03 -0500 | [diff] [blame] | 1 | // Copyright 2019 Google LLC. |
| 2 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 3 | #include "fiddle/examples.h" |
| 4 | // HASH=ac2fe555e2196e15863ea4ce74db3d54 |
| 5 | REG_FIDDLE(BlendMode_020, 256, 256, false, 3) { |
| 6 | void draw(SkCanvas* canvas) { |
| 7 | canvas->drawImage(image, 0, 0); |
| 8 | const SkColor colors[] = { 0xFFFFFFFF, 0x00000000 }; |
| 9 | SkPaint paint; |
| 10 | paint.setBlendMode(SkBlendMode::kHardLight); |
| 11 | paint.setShader(SkGradientShader::MakeRadial({ 128, 128}, 100, colors, |
| 12 | nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode)); |
| 13 | canvas->clipRect({0, 128, 256, 256}); |
| 14 | canvas->drawPaint(paint); |
| 15 | } |
| 16 | } // END FIDDLE |