Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skiagm::RectRenderer Class Reference
Inheritance diagram for skiagm::RectRenderer:
skiagm::ShapeRenderer SkRefCntBase

Public Member Functions

SkString name () override
 
sk_sp< ShapeRenderertoHairline () override
 
void draw (SkCanvas *canvas, SkPaint *paint, SkScalar tx, SkScalar ty, SkScalar angle) override
 
- Public Member Functions inherited from skiagm::ShapeRenderer
virtual void draw (SkCanvas *canvas, SkPaint *paint, SkScalar tx, SkScalar ty, SkScalar angle)=0
 
virtual SkString name ()=0
 
virtual sk_sp< ShapeRenderertoHairline ()=0
 
void applyLocalTransform (SkCanvas *canvas, SkScalar tx, SkScalar ty, SkScalar angle)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< ShapeRendererMake ()
 

Additional Inherited Members

- Static Public Attributes inherited from skiagm::ShapeRenderer
static constexpr SkScalar kTileWidth = 20.f
 
static constexpr SkScalar kTileHeight = 20.f
 

Detailed Description

Definition at line 44 of file ThinAASlide.cpp.

Member Function Documentation

◆ draw()

void skiagm::RectRenderer::draw ( SkCanvas canvas,
SkPaint paint,
SkScalar  tx,
SkScalar  ty,
SkScalar  angle 
)
inlineoverridevirtual

Implements skiagm::ShapeRenderer.

Definition at line 57 of file ThinAASlide.cpp.

57 {
58 SkScalar width = paint->getStrokeWidth();
59 paint->setStyle(SkPaint::kFill_Style);
60
61 this->applyLocalTransform(canvas, tx, ty, angle);
62 canvas->drawRect(SkRect::MakeLTRB(kTileWidth / 2.f - width / 2.f, 2.f,
63 kTileWidth / 2.f + width / 2.f, kTileHeight - 2.f),
64 *paint);
65 }
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
static constexpr SkScalar kTileHeight
Definition: ThinAASlide.cpp:25
static constexpr SkScalar kTileWidth
Definition: ThinAASlide.cpp:24
void applyLocalTransform(SkCanvas *canvas, SkScalar tx, SkScalar ty, SkScalar angle)
Definition: ThinAASlide.cpp:38
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
int32_t width
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

◆ Make()

static sk_sp< ShapeRenderer > skiagm::RectRenderer::Make ( )
inlinestatic

Definition at line 46 of file ThinAASlide.cpp.

46 {
47 return sk_sp<ShapeRenderer>(new RectRenderer());
48 }

◆ name()

SkString skiagm::RectRenderer::name ( )
inlineoverridevirtual

Implements skiagm::ShapeRenderer.

Definition at line 50 of file ThinAASlide.cpp.

50{ return SkString("rect"); }

◆ toHairline()

sk_sp< ShapeRenderer > skiagm::RectRenderer::toHairline ( )
inlineoverridevirtual

Implements skiagm::ShapeRenderer.

Definition at line 52 of file ThinAASlide.cpp.

52 {
53 // Not really available but can't return nullptr
54 return Make();
55 }
static sk_sp< ShapeRenderer > Make()
Definition: ThinAASlide.cpp:46

The documentation for this class was generated from the following file: