Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
crbug_1073670.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/effects/SkGradientShader.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (crbug_1073670, canvas, 250, 250)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( crbug_1073670  ,
canvas  ,
250  ,
250   
)

Definition at line 16 of file crbug_1073670.cpp.

16 {
17 SkPoint pts[] = {{0, 0}, {0, 250}};
18 SkColor colors[] = {0xFFFF0000, 0xFF0000FF};
19 auto sh = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkTileMode::kClamp);
20 SkPaint p;
21 p.setShader(sh);
22
24 f.setSize(325);
26
27 canvas->drawString("Gradient", 10, 250, f, p);
28}
uint32_t SkColor
Definition SkColor.h:37
@ kAntiAlias
may have transparent pixels on glyph edges
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
PODArray< SkColor > colors
Definition SkRecords.h:276
SkFont DefaultPortableFont()