Flutter Engine
The Flutter Engine
Classes | Macros | Typedefs | Functions
srcmode.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkFont.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypeface.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Classes

class  SrcModeGM
 

Macros

#define W   SkIntToScalar(80)
 
#define H   SkIntToScalar(60)
 

Typedefs

typedef void(* PaintProc) (SkPaint *)
 
typedef void(* Proc) (SkCanvas *, const SkPaint &, const SkFont &)
 

Functions

static void identity_paintproc (SkPaint *paint)
 
static void gradient_paintproc (SkPaint *paint)
 
static void draw_hair (SkCanvas *canvas, const SkPaint &paint, const SkFont &)
 
static void draw_thick (SkCanvas *canvas, const SkPaint &paint, const SkFont &)
 
static void draw_rect (SkCanvas *canvas, const SkPaint &paint, const SkFont &)
 
static void draw_oval (SkCanvas *canvas, const SkPaint &paint, const SkFont &)
 
static void draw_text (SkCanvas *canvas, const SkPaint &paint, const SkFont &font)
 

Macro Definition Documentation

◆ H

#define H   SkIntToScalar(60)

Definition at line 32 of file srcmode.cpp.

◆ W

#define W   SkIntToScalar(80)

Definition at line 31 of file srcmode.cpp.

Typedef Documentation

◆ PaintProc

typedef void(* PaintProc) (SkPaint *)

Definition at line 34 of file srcmode.cpp.

◆ Proc

typedef void(* Proc) (SkCanvas *, const SkPaint &, const SkFont &)

Definition at line 47 of file srcmode.cpp.

Function Documentation

◆ draw_hair()

static void draw_hair ( SkCanvas canvas,
const SkPaint paint,
const SkFont  
)
static

Definition at line 49 of file srcmode.cpp.

49 {
51 p.setStrokeWidth(0);
52 canvas->drawLine(0, 0, W, H, p);
53}
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700
const Paint & paint
Definition: color_source.cc:38
#define W
Definition: srcmode.cpp:31
Definition: SkMD5.cpp:130

◆ draw_oval()

static void draw_oval ( SkCanvas canvas,
const SkPaint paint,
const SkFont  
)
static

Definition at line 65 of file srcmode.cpp.

65 {
66 canvas->drawOval(SkRect::MakeWH(W, H), paint);
67}
void drawOval(const SkRect &oval, const SkPaint &paint)
Definition: SkCanvas.cpp:1698
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609

◆ draw_rect()

static void draw_rect ( SkCanvas canvas,
const SkPaint paint,
const SkFont  
)
static

Definition at line 61 of file srcmode.cpp.

61 {
62 canvas->drawRect(SkRect::MakeWH(W, H), paint);
63}
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673

◆ draw_text()

static void draw_text ( SkCanvas canvas,
const SkPaint paint,
const SkFont font 
)
static

Definition at line 69 of file srcmode.cpp.

69 {
70 canvas->drawString("Hamburge", 0, H*2/3, font, paint);
71}
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
Definition: SkCanvas.h:1803
font
Font Metadata and Metrics.

◆ draw_thick()

static void draw_thick ( SkCanvas canvas,
const SkPaint paint,
const SkFont  
)
static

Definition at line 55 of file srcmode.cpp.

55 {
57 p.setStrokeWidth(H/5);
58 canvas->drawLine(0, 0, W, H, p);
59}

◆ gradient_paintproc()

static void gradient_paintproc ( SkPaint paint)
static

Definition at line 40 of file srcmode.cpp.

40 {
42 const SkPoint pts[] = { { 0, 0 }, { W, H } };
43 paint->setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, std::size(colors),
45}
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ identity_paintproc()

static void identity_paintproc ( SkPaint paint)
static

Definition at line 36 of file srcmode.cpp.

36 {
37 paint->setShader(nullptr);
38}