1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 4cb93a386Sopenharmony_ci// HASH=ac93f30dff13f8a8bb31398de370863b 5cb93a386Sopenharmony_ciREG_FIDDLE(Soft_Light, 256, 256, false, 3) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci const SkColor colors[] = { 0xFFFFFFFF, 0x3FFFFFFF }; 8cb93a386Sopenharmony_ci SkPaint paint; 9cb93a386Sopenharmony_ci paint.setBlendMode(SkBlendMode::kSoftLight); 10cb93a386Sopenharmony_ci paint.setShader(SkGradientShader::MakeRadial({ 128, 128}, 100, colors, 11cb93a386Sopenharmony_ci nullptr, SK_ARRAY_COUNT(colors), SkTileMode::kClamp)); 12cb93a386Sopenharmony_ci canvas->drawImage(image, 0, 0); 13cb93a386Sopenharmony_ci canvas->drawCircle(128, 128, 100, paint); 14cb93a386Sopenharmony_ci} 15cb93a386Sopenharmony_ci} // END FIDDLE 16