Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
MSKPPlayer::PicCmd Struct Reference
Inheritance diagram for MSKPPlayer::PicCmd:
MSKPPlayer::Cmd

Public Member Functions

bool isFullRedraw (SkCanvas *canvas) const override
 
void draw (SkCanvas *canvas, const LayerMap &, LayerStateMap *) const override
 
- Public Member Functions inherited from MSKPPlayer::Cmd
virtual ~Cmd ()=default
 
virtual bool isFullRedraw (SkCanvas *) const =0
 
virtual void draw (SkCanvas *canvas, const LayerMap &, LayerStateMap *) const =0
 
virtual int layerID () const
 

Public Attributes

sk_sp< SkPicturefContent
 
SkIRect fClipRect = SkIRect::MakeEmpty()
 

Detailed Description

Definition at line 38 of file MSKPPlayer.cpp.

Member Function Documentation

◆ draw()

void MSKPPlayer::PicCmd::draw ( SkCanvas canvas,
const LayerMap &  ,
LayerStateMap *   
) const
inlineoverridevirtual

Implements MSKPPlayer::Cmd.

Definition at line 49 of file MSKPPlayer.cpp.

49 {
50 if (!fClipRect.isEmpty()) {
51 canvas->save();
52 canvas->clipIRect(fClipRect);
53 }
54 canvas->drawPicture(fContent.get());
55 if (!fClipRect.isEmpty()) {
56 canvas->restore();
57 }
58 }
void restore()
Definition: SkCanvas.cpp:461
void clipIRect(const SkIRect &irect, SkClipOp op=SkClipOp::kIntersect)
Definition: SkCanvas.h:991
int save()
Definition: SkCanvas.cpp:447
void drawPicture(const SkPicture *picture)
Definition: SkCanvas.h:1961
T * get() const
Definition: SkRefCnt.h:303
sk_sp< SkPicture > fContent
Definition: MSKPPlayer.cpp:39
bool isEmpty() const
Definition: SkRect.h:202

◆ isFullRedraw()

bool MSKPPlayer::PicCmd::isFullRedraw ( SkCanvas canvas) const
inlineoverridevirtual

Implements MSKPPlayer::Cmd.

Definition at line 42 of file MSKPPlayer.cpp.

42 {
43 if (fClipRect.isEmpty()) {
44 return false;
45 }
47 }
virtual SkISize getBaseLayerSize() const
Definition: SkCanvas.cpp:369
static constexpr SkIRect MakeSize(const SkISize &size)
Definition: SkRect.h:66
bool contains(int32_t x, int32_t y) const
Definition: SkRect.h:463

Member Data Documentation

◆ fClipRect

SkIRect MSKPPlayer::PicCmd::fClipRect = SkIRect::MakeEmpty()

Definition at line 40 of file MSKPPlayer.cpp.

◆ fContent

sk_sp<SkPicture> MSKPPlayer::PicCmd::fContent

Definition at line 39 of file MSKPPlayer.cpp.


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