Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DrawShadowCommand Class Reference

#include <DrawCommand.h>

Inheritance diagram for DrawShadowCommand:
DrawCommand

Public Member Functions

 DrawShadowCommand (const SkPath &path, const SkDrawShadowRec &rec)
 
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)
 
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 689 of file DrawCommand.h.

Constructor & Destructor Documentation

◆ DrawShadowCommand()

DrawShadowCommand::DrawShadowCommand ( const SkPath path,
const SkDrawShadowRec rec 
)

Definition at line 1873 of file DrawCommand.cpp.

1874 : INHERITED(kDrawShadow_OpType) {
1875 fPath = path;
1876 fShadowRec = rec;
1877}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

Member Function Documentation

◆ execute()

void DrawShadowCommand::execute ( SkCanvas canvas) const
overridevirtual

Implements DrawCommand.

Definition at line 1879 of file DrawCommand.cpp.

1879 {
1880 canvas->private_draw_shadow_rec(fPath, fShadowRec);
1881}
void private_draw_shadow_rec(const SkPath &, const SkDrawShadowRec &)

◆ render()

bool DrawShadowCommand::render ( SkCanvas canvas) const
overridevirtual

Reimplemented from DrawCommand.

Definition at line 1883 of file DrawCommand.cpp.

1883 {
1884 render_shadow(canvas, fPath, fShadowRec);
1885 return true;
1886}

◆ toJSON()

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

Reimplemented from DrawCommand.

Definition at line 1888 of file DrawCommand.cpp.

1888 {
1889 INHERITED::toJSON(writer, urlDataManager);
1890
1891 bool geometricOnly = SkToBool(fShadowRec.fFlags & SkShadowFlags::kGeometricOnly_ShadowFlag);
1892 bool transparentOccluder =
1894
1896 MakeJsonPath(writer, fPath);
1898 MakeJsonPoint3(writer, fShadowRec.fZPlaneParams);
1900 MakeJsonPoint3(writer, fShadowRec.fLightPos);
1903 MakeJsonColor(writer, fShadowRec.fAmbientColor);
1905 MakeJsonColor(writer, fShadowRec.fSpotColor);
1906 store_bool(writer, DEBUGCANVAS_SHADOWFLAG_TRANSPARENT_OCC, transparentOccluder, false);
1907 store_bool(writer, DEBUGCANVAS_SHADOWFLAG_GEOMETRIC_ONLY, geometricOnly, false);
1908}
#define DEBUGCANVAS_SHADOWFLAG_TRANSPARENT_OCC
static void store_bool(SkJSONWriter &writer, const char *key, bool value, bool defaultValue)
#define DEBUGCANVAS_ATTRIBUTE_LIGHTPOSITION
#define DEBUGCANVAS_ATTRIBUTE_LIGHTRADIUS
#define DEBUGCANVAS_ATTRIBUTE_ZPLANE
#define DEBUGCANVAS_ATTRIBUTE_PATH
#define DEBUGCANVAS_ATTRIBUTE_SPOTCOLOR
#define DEBUGCANVAS_SHADOWFLAG_GEOMETRIC_ONLY
#define DEBUGCANVAS_ATTRIBUTE_AMBIENTCOLOR
@ kGeometricOnly_ShadowFlag
@ kTransparentOccluder_ShadowFlag
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
static void MakeJsonPoint3(SkJSONWriter &, const SkPoint3 &point)
static void MakeJsonColor(SkJSONWriter &, const SkColor color)
virtual void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const
static void MakeJsonPath(SkJSONWriter &, const SkPath &path)
void appendFloat(float value)
void appendName(const char *name)

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