1 /* 2 * Copyright 2017 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "gm.h" 9 #include "SkGradientShader.h" 10 11 // All we're looking for here is that we see a smooth gradient. 12 DEF_SIMPLE_GM(radial_gradient_precision, canvas, 200, 200) { 13 SkPoint center = {100000, 100000}; 14 SkScalar radius = 40; 15 SkColor colors[] = {SK_ColorBLACK, SK_ColorWHITE}; 16 17 SkPaint p; 18 p.setShader(SkGradientShader::MakeRadial(center, radius, 19 colors, nullptr, SK_ARRAY_COUNT(colors), 20 SkShader::kRepeat_TileMode)); 21 canvas->drawPaint(p); 22 } 23