Flutter Engine
The Flutter Engine
Classes | Functions | Variables
pictureshadertile.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.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/SkTileMode.h"
#include "include/core/SkTypes.h"

Go to the source code of this file.

Classes

class  PictureShaderTileGM
 

Functions

static void draw_scene (SkCanvas *canvas, SkScalar pictureSize)
 

Variables

constexpr SkScalar kPictureSize = SK_Scalar1
 
constexpr SkScalar kFillSize = 100
 
constexpr unsigned kRowSize = 6
 
struct {
   SkScalar   x
 
   SkScalar   y
 
   SkScalar   w
 
   SkScalar   h
 
   SkScalar   offsetX
 
   SkScalar   offsetY
 
tiles []
 

Function Documentation

◆ draw_scene()

static void draw_scene ( SkCanvas canvas,
SkScalar  pictureSize 
)
static

Definition at line 70 of file pictureshadertile.cpp.

70 {
71 canvas->clear(SK_ColorWHITE);
72
75 paint.setAntiAlias(true);
76
77 paint.setColor(SK_ColorGREEN);
78 canvas->drawCircle(pictureSize / 4, pictureSize / 4, pictureSize / 4, paint);
79 paint.setColor(SK_ColorBLUE);
80 canvas->drawRect(SkRect::MakeXYWH(pictureSize / 2, pictureSize / 2,
81 pictureSize / 2, pictureSize / 2), paint);
82
83 paint.setColor(SK_ColorRED);
84 canvas->drawLine(pictureSize / 2, pictureSize * 1 / 3,
85 pictureSize / 2, pictureSize * 2 / 3, paint);
86 canvas->drawLine(pictureSize * 1 / 3, pictureSize / 2,
87 pictureSize * 2 / 3, pictureSize / 2, paint);
88
89 paint.setColor(SK_ColorBLACK);
91 canvas->drawRect(SkRect::MakeWH(pictureSize, pictureSize), paint);
92}
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700
void clear(SkColor color)
Definition: SkCanvas.h:1199
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
const Paint & paint
Definition: color_source.cc:38
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609

Variable Documentation

◆ h

Definition at line 30 of file pictureshadertile.cpp.

◆ kFillSize

constexpr SkScalar kFillSize = 100
constexpr

Definition at line 26 of file pictureshadertile.cpp.

◆ kPictureSize

constexpr SkScalar kPictureSize = SK_Scalar1
constexpr

Definition at line 25 of file pictureshadertile.cpp.

◆ kRowSize

constexpr unsigned kRowSize = 6
constexpr

Definition at line 27 of file pictureshadertile.cpp.

◆ offsetX

SkScalar offsetX

Definition at line 31 of file pictureshadertile.cpp.

◆ offsetY

SkScalar offsetY

Definition at line 31 of file pictureshadertile.cpp.

◆ 

constexpr struct { ... } tiles[]

◆ w

Definition at line 30 of file pictureshadertile.cpp.

◆ x

Definition at line 30 of file pictureshadertile.cpp.

◆ y

Definition at line 30 of file pictureshadertile.cpp.