Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
DrawPointsCommand Class Reference

#include <DrawCommand.h>

Inheritance diagram for DrawPointsCommand:
DrawCommand

Public Member Functions

 DrawPointsCommand (SkCanvas::PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
 
void execute (SkCanvas *canvas) const override
 
bool render (SkCanvas *canvas) const override
 
void toJSON (SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
 
- Public Member Functions inherited from DrawCommand
 DrawCommand (OpType opType)
 
virtual ~DrawCommand ()
 
bool isVisible () const
 
void setVisible (bool toggle)
 
virtual void execute (SkCanvas *) const =0
 
virtual bool render (SkCanvas *canvas) const
 
virtual void toJSON (SkJSONWriter &writer, UrlDataManager &urlDataManager) const
 
OpType getOpType () const
 

Additional Inherited Members

- Public Types inherited from DrawCommand
enum  OpType {
  kBeginDrawPicture_OpType , kClear_OpType , kClipPath_OpType , kClipRegion_OpType ,
  kClipRect_OpType , kClipRRect_OpType , kClipShader_OpType , kResetClip_OpType ,
  kConcat_OpType , kConcat44_OpType , kDrawAnnotation_OpType , kDrawBitmap_OpType ,
  kDrawBitmapRect_OpType , kDrawDRRect_OpType , kDrawImage_OpType , kDrawImageLattice_OpType ,
  kDrawImageRect_OpType , kDrawImageRectLayer_OpType , kDrawOval_OpType , kDrawArc_OpType ,
  kDrawPaint_OpType , kDrawPatch_OpType , kDrawPath_OpType , kDrawPoints_OpType ,
  kDrawRect_OpType , kDrawRRect_OpType , kDrawRegion_OpType , kDrawShadow_OpType ,
  kDrawTextBlob_OpType , kDrawVertices_OpType , kDrawAtlas_OpType , kDrawDrawable_OpType ,
  kDrawEdgeAAQuad_OpType , kDrawEdgeAAImageSet_OpType , kEndDrawPicture_OpType , kRestore_OpType ,
  kSave_OpType , kSaveLayer_OpType , kSetMatrix_OpType , kSetM44_OpType ,
  kLast_OpType = kSetM44_OpType
}
 
- Static Public Member Functions inherited from DrawCommand
static void WritePNG (const SkBitmap &bitmap, SkWStream &out)
 
static const char * GetCommandString (OpType type)
 
static void MakeJsonColor (SkJSONWriter &, const SkColor color)
 
static void MakeJsonColor4f (SkJSONWriter &, const SkColor4f &color)
 
static void MakeJsonPoint (SkJSONWriter &, const SkPoint &point)
 
static void MakeJsonPoint (SkJSONWriter &, SkScalar x, SkScalar y)
 
static void MakeJsonPoint3 (SkJSONWriter &, const SkPoint3 &point)
 
static void MakeJsonRect (SkJSONWriter &, const SkRect &rect)
 
static void MakeJsonIRect (SkJSONWriter &, const SkIRect &)
 
static void MakeJsonMatrix (SkJSONWriter &, const SkMatrix &)
 
static void MakeJsonMatrix44 (SkJSONWriter &, const SkM44 &)
 
static void MakeJsonPath (SkJSONWriter &, const SkPath &path)
 
static void MakeJsonRegion (SkJSONWriter &, const SkRegion &region)
 
static void MakeJsonSampling (SkJSONWriter &, const SkSamplingOptions &sampling)
 
static void MakeJsonPaint (SkJSONWriter &, const SkPaint &paint, UrlDataManager &urlDataManager)
 
static void MakeJsonLattice (SkJSONWriter &, const SkCanvas::Lattice &lattice)
 
static void flatten (const SkFlattenable *flattenable, SkJSONWriter &writer, UrlDataManager &urlDataManager)
 
static bool flatten (const SkImage &image, SkJSONWriter &writer, UrlDataManager &urlDataManager)
 
static bool flatten (const SkBitmap &bitmap, SkJSONWriter &writer, UrlDataManager &urlDataManager)
 
- Static Public Attributes inherited from DrawCommand
static const int kOpTypeCount = kLast_OpType + 1
 

Detailed Description

Definition at line 486 of file DrawCommand.h.

Constructor & Destructor Documentation

◆ DrawPointsCommand()

DrawPointsCommand::DrawPointsCommand ( SkCanvas::PointMode  mode,
size_t  count,
const SkPoint  pts[],
const SkPaint paint 
)

Definition at line 1619 of file DrawCommand.cpp.

1623 : INHERITED(kDrawPoints_OpType), fMode(mode), fPts(pts, count), fPaint(paint) {}
int count
Definition: FontMgrTest.cpp:50
@ kDrawPoints_OpType
Definition: DrawCommand.h:79
const Paint & paint
Definition: color_source.cc:38
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 mode
Definition: switches.h:228

Member Function Documentation

◆ execute()

void DrawPointsCommand::execute ( SkCanvas canvas) const
overridevirtual

Implements DrawCommand.

Definition at line 1625 of file DrawCommand.cpp.

1625 {
1626 canvas->drawPoints(fMode, fPts.size(), fPts.begin(), fPaint);
1627}
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
Definition: SkCanvas.cpp:1710
int size() const
Definition: SkTDArray.h:138
T * begin()
Definition: SkTDArray.h:150

◆ render()

bool DrawPointsCommand::render ( SkCanvas canvas) const
overridevirtual

Reimplemented from DrawCommand.

Definition at line 1629 of file DrawCommand.cpp.

1629 {
1630 canvas->clear(0xFFFFFFFF);
1631 canvas->save();
1632
1633 SkRect bounds;
1634
1635 bounds.setEmpty();
1636 for (int i = 0; i < fPts.size(); ++i) {
1638 }
1639
1640 xlate_and_scale_to_bounds(canvas, bounds);
1641
1642 SkPaint p;
1643 p.setColor(SK_ColorBLACK);
1644 p.setStyle(SkPaint::kStroke_Style);
1645
1646 canvas->drawPoints(fMode, fPts.size(), fPts.begin(), p);
1647 canvas->restore();
1648
1649 return true;
1650}
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
void restore()
Definition: SkCanvas.cpp:461
void clear(SkColor color)
Definition: SkCanvas.h:1199
int save()
Definition: SkCanvas.cpp:447
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
static void GrowToInclude(SkRect *r, const SkPoint &pt)
Definition: SkRectPriv.h:47
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ toJSON()

void DrawPointsCommand::toJSON ( SkJSONWriter writer,
UrlDataManager urlDataManager 
) const
overridevirtual

Reimplemented from DrawCommand.

Definition at line 1652 of file DrawCommand.cpp.

1652 {
1653 INHERITED::toJSON(writer, urlDataManager);
1656 for (int i = 0; i < fPts.size(); i++) {
1657 MakeJsonPoint(writer, fPts[i]);
1658 }
1659 writer.endArray(); // points
1661 MakeJsonPaint(writer, fPaint, urlDataManager);
1662}
static const char * pointmode_name(SkCanvas::PointMode mode)
#define DEBUGCANVAS_ATTRIBUTE_PAINT
Definition: DrawCommand.cpp:73
#define DEBUGCANVAS_ATTRIBUTE_POINTS
Definition: DrawCommand.cpp:77
#define DEBUGCANVAS_ATTRIBUTE_MODE
Definition: DrawCommand.cpp:76
static void MakeJsonPoint(SkJSONWriter &, const SkPoint &point)
static void MakeJsonPaint(SkJSONWriter &, const SkPaint &paint, UrlDataManager &urlDataManager)
virtual void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const
void beginArray(const char *name=nullptr, bool multiline=true)
Definition: SkJSONWriter.h:146
void appendName(const char *name)
Definition: SkJSONWriter.h:90
void appendCString(const char *value)
Definition: SkJSONWriter.h:224
void endArray()
Definition: SkJSONWriter.h:158

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