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

#include <DrawCommand.h>

Inheritance diagram for DrawAnnotationCommand:
DrawCommand

Public Member Functions

 DrawAnnotationCommand (const SkRect &, const char key[], sk_sp< SkData > value)
 
void execute (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 275 of file DrawCommand.h.

Constructor & Destructor Documentation

◆ DrawAnnotationCommand()

DrawAnnotationCommand::DrawAnnotationCommand ( const SkRect rect,
const char  key[],
sk_sp< SkData value 
)

Definition at line 1167 of file DrawCommand.cpp.

1170 : INHERITED(kDrawAnnotation_OpType), fRect(rect), fKey(key), fValue(std::move(value)) {}
@ kDrawAnnotation_OpType
Definition: DrawCommand.h:66
uint8_t value
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

Member Function Documentation

◆ execute()

void DrawAnnotationCommand::execute ( SkCanvas canvas) const
overridevirtual

Implements DrawCommand.

Definition at line 1172 of file DrawCommand.cpp.

1172 {
1173 canvas->drawAnnotation(fRect, fKey.c_str(), fValue);
1174}
void drawAnnotation(const SkRect &rect, const char key[], SkData *value)
Definition: SkCanvas.cpp:1824
const char * c_str() const
Definition: SkString.h:133

◆ toJSON()

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

Reimplemented from DrawCommand.

Definition at line 1176 of file DrawCommand.cpp.

1176 {
1177 INHERITED::toJSON(writer, urlDataManager);
1178
1180 MakeJsonRect(writer, fRect);
1181 writer.appendString("key", fKey);
1182 if (fValue) {
1183 writer.appendString("value", static_cast<const char*>(fValue->data()), fValue->size());
1184 }
1185
1186 SkString desc;
1187 str_append(&desc, fRect)->appendf(" %s", fKey.c_str());
1189}
#define DEBUGCANVAS_ATTRIBUTE_SHORTDESC
static SkString * str_append(SkString *str, const SkRect &r)
#define DEBUGCANVAS_ATTRIBUTE_COORDS
Definition: DrawCommand.cpp:69
virtual void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const
static void MakeJsonRect(SkJSONWriter &, const SkRect &rect)
const void * data() const
Definition: SkData.h:37
size_t size() const
Definition: SkData.h:30
void appendName(const char *name)
Definition: SkJSONWriter.h:90
void appendString(const char *value, size_t size)
Definition: SkJSONWriter.h:176
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:550

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