Flutter Engine
The Flutter Engine
DrawCommand.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SKDRAWCOMMAND_H_
9#define SKDRAWCOMMAND_H_
10
13#include "include/core/SkData.h"
17#include "include/core/SkM44.h"
20#include "include/core/SkPath.h"
24#include "include/core/SkRect.h"
36#include "src/base/SkTLazy.h"
38
39#include <cstddef>
40#include <cstdint>
41
43class SkBitmap;
44class SkFlattenable;
45class SkJSONWriter;
46class SkWStream;
47class UrlDataManager;
48enum class SkBlendMode;
49enum class SkClipOp;
50struct SkPoint3;
51struct SkRSXform;
52
54public:
55 enum OpType {
73 kDrawImageRectLayer_OpType, // unique to DebugCanvas
96
98 };
99
100 static const int kOpTypeCount = kLast_OpType + 1;
101
102 static void WritePNG(const SkBitmap& bitmap, SkWStream& out);
103
104 DrawCommand(OpType opType);
105
106 virtual ~DrawCommand() {}
107
108 bool isVisible() const { return fVisible; }
109
110 void setVisible(bool toggle) { fVisible = toggle; }
111
112 virtual void execute(SkCanvas*) const = 0;
113
114 virtual bool render(SkCanvas* canvas) const { return false; }
115
116 virtual void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const;
117
118 static const char* GetCommandString(OpType type);
119
120 // Helper methods for converting things to JSON
121 static void MakeJsonColor(SkJSONWriter&, const SkColor color);
122 static void MakeJsonColor4f(SkJSONWriter&, const SkColor4f& color);
123 static void MakeJsonPoint(SkJSONWriter&, const SkPoint& point);
125 static void MakeJsonPoint3(SkJSONWriter&, const SkPoint3& point);
126 static void MakeJsonRect(SkJSONWriter&, const SkRect& rect);
127 static void MakeJsonIRect(SkJSONWriter&, const SkIRect&);
128 static void MakeJsonMatrix(SkJSONWriter&, const SkMatrix&);
129 static void MakeJsonMatrix44(SkJSONWriter&, const SkM44&);
130 static void MakeJsonPath(SkJSONWriter&, const SkPath& path);
131 static void MakeJsonRegion(SkJSONWriter&, const SkRegion& region);
133 static void MakeJsonPaint(SkJSONWriter&, const SkPaint& paint, UrlDataManager& urlDataManager);
134 static void MakeJsonLattice(SkJSONWriter&, const SkCanvas::Lattice& lattice);
135
136 static void flatten(const SkFlattenable* flattenable,
137 SkJSONWriter& writer,
138 UrlDataManager& urlDataManager);
139 static bool flatten(const SkImage& image, SkJSONWriter& writer, UrlDataManager& urlDataManager);
140 static bool flatten(const SkBitmap& bitmap,
141 SkJSONWriter& writer,
142 UrlDataManager& urlDataManager);
143 OpType getOpType() const { return fOpType; }
144
145private:
146 OpType fOpType;
147 bool fVisible;
148};
149
151public:
153 void execute(SkCanvas* canvas) const override;
154
155private:
156 using INHERITED = DrawCommand;
157};
158
159class ClearCommand : public DrawCommand {
160public:
162 void execute(SkCanvas* canvas) const override;
163 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
164
165private:
166 SkColor fColor;
167
168 using INHERITED = DrawCommand;
169};
170
172public:
173 ClipPathCommand(const SkPath& path, SkClipOp op, bool doAA);
174 void execute(SkCanvas* canvas) const override;
175 bool render(SkCanvas* canvas) const override;
176 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
177
178private:
179 SkPath fPath;
180 SkClipOp fOp;
181 bool fDoAA;
182
183 using INHERITED = DrawCommand;
184};
185
187public:
189 void execute(SkCanvas* canvas) const override;
190 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
191
192private:
193 SkRegion fRegion;
194 SkClipOp fOp;
195
196 using INHERITED = DrawCommand;
197};
198
200public:
201 ClipRectCommand(const SkRect& rect, SkClipOp op, bool doAA);
202 void execute(SkCanvas* canvas) const override;
203 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
204
205private:
206 SkRect fRect;
207 SkClipOp fOp;
208 bool fDoAA;
209
210 using INHERITED = DrawCommand;
211};
212
214public:
215 ClipRRectCommand(const SkRRect& rrect, SkClipOp op, bool doAA);
216 void execute(SkCanvas* canvas) const override;
217 bool render(SkCanvas* canvas) const override;
218 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
219
220private:
221 SkRRect fRRect;
222 SkClipOp fOp;
223 bool fDoAA;
224
225 using INHERITED = DrawCommand;
226};
227
229public:
231 void execute(SkCanvas* canvas) const override;
232 bool render(SkCanvas* canvas) const override;
233 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
234
235private:
236 sk_sp<SkShader> fShader;
237 SkClipOp fOp;
238
239 using INHERITED = DrawCommand;
240};
241
243public:
245 void execute(SkCanvas* canvas) const override;
246
247private:
248 using INHERITED = DrawCommand;
249};
250
252public:
254 void execute(SkCanvas* canvas) const override;
255 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
256
257private:
258 SkMatrix fMatrix;
259
260 using INHERITED = DrawCommand;
261};
262
264public:
266 void execute(SkCanvas* canvas) const override;
267 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
268
269private:
270 SkM44 fMatrix;
271
272 using INHERITED = DrawCommand;
273};
274
276public:
277 DrawAnnotationCommand(const SkRect&, const char key[], sk_sp<SkData> value);
278 void execute(SkCanvas* canvas) const override;
279 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
280
281private:
282 SkRect fRect;
283 SkString fKey;
284 sk_sp<SkData> fValue;
285
286 using INHERITED = DrawCommand;
287};
288
290public:
292 const SkSamplingOptions&, const SkPaint* paint);
293 void execute(SkCanvas* canvas) const override;
294 bool render(SkCanvas* canvas) const override;
295 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
296 uint64_t imageId(UrlDataManager& udb) const;
297
298private:
300 SkScalar fLeft;
301 SkScalar fTop;
302 SkSamplingOptions fSampling;
303 SkTLazy<SkPaint> fPaint;
304
305 using INHERITED = DrawCommand;
306};
307
309public:
311 const SkCanvas::Lattice& lattice,
312 const SkRect& dst,
314 const SkPaint* paint);
315 void execute(SkCanvas* canvas) const override;
316 bool render(SkCanvas* canvas) const override;
317 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
318 uint64_t imageId(UrlDataManager& udb) const;
319
320private:
322 SkCanvas::Lattice fLattice;
323 SkRect fDst;
324 SkFilterMode fFilter;
325 SkTLazy<SkPaint> fPaint;
326
327 using INHERITED = DrawCommand;
328};
329
331public:
333 const SkRect& src,
334 const SkRect& dst,
336 const SkPaint* paint,
337 SkCanvas::SrcRectConstraint constraint);
338 void execute(SkCanvas* canvas) const override;
339 bool render(SkCanvas* canvas) const override;
340 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
341 uint64_t imageId(UrlDataManager& udm) const;
342
343private:
345 SkRect fSrc;
346 SkRect fDst;
347 SkSamplingOptions fSampling;
348 SkTLazy<SkPaint> fPaint;
349 SkCanvas::SrcRectConstraint fConstraint;
350
351 using INHERITED = DrawCommand;
352};
353
354// Command for resolving the deferred SkImage representing an android layer
355// Functions like DrawImageRect except it uses the saved UrlDataManager to resolve the image
356// at the time execute() is called.
358public:
360 const int nodeId,
361 const int frame,
362 const SkRect& src,
363 const SkRect& dst,
365 const SkPaint* paint,
366 SkCanvas::SrcRectConstraint constraint);
367 void execute(SkCanvas* canvas) const override;
368 bool render(SkCanvas* canvas) const override;
369 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
370
371private:
372 DebugLayerManager* fLayerManager;
373 int fNodeId;
374 int fFrame;
375 SkRect fSrc;
376 SkRect fDst;
377 SkSamplingOptions fSampling;
378 SkTLazy<SkPaint> fPaint;
379 SkCanvas::SrcRectConstraint fConstraint;
380
381 using INHERITED = DrawCommand;
382};
383
385public:
386 DrawOvalCommand(const SkRect& oval, const SkPaint& paint);
387 void execute(SkCanvas* canvas) const override;
388 bool render(SkCanvas* canvas) const override;
389 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
390
391private:
392 SkRect fOval;
393 SkPaint fPaint;
394
395 using INHERITED = DrawCommand;
396};
397
399public:
403 bool useCenter,
404 const SkPaint& paint);
405 void execute(SkCanvas* canvas) const override;
406 bool render(SkCanvas* canvas) const override;
407 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
408
409private:
410 SkRect fOval;
411 SkScalar fStartAngle;
412 SkScalar fSweepAngle;
413 bool fUseCenter;
414 SkPaint fPaint;
415
416 using INHERITED = DrawCommand;
417};
418
420public:
422 void execute(SkCanvas* canvas) const override;
423 bool render(SkCanvas* canvas) const override;
424 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
425
426private:
427 SkPaint fPaint;
428
429 using INHERITED = DrawCommand;
430};
431
433public:
435 void execute(SkCanvas* canvas) const override;
436 bool render(SkCanvas* canvas) const override;
437 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
438
439private:
440 SkPaint fPaint;
441
442 using INHERITED = DrawCommand;
443};
444
446public:
447 DrawPathCommand(const SkPath& path, const SkPaint& paint);
448 void execute(SkCanvas* canvas) const override;
449 bool render(SkCanvas* canvas) const override;
450 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
451
452private:
453 SkPath fPath;
454 SkPaint fPaint;
455
456 using INHERITED = DrawCommand;
457};
458
460public:
462
463 void execute(SkCanvas* canvas) const override;
464 bool render(SkCanvas* canvas) const override;
465
466private:
467 sk_sp<const SkPicture> fPicture;
468 SkTLazy<SkMatrix> fMatrix;
469 SkTLazy<SkPaint> fPaint;
470
471 using INHERITED = DrawCommand;
472};
473
475public:
476 EndDrawPictureCommand(bool restore);
477
478 void execute(SkCanvas* canvas) const override;
479
480private:
481 bool fRestore;
482
483 using INHERITED = DrawCommand;
484};
485
487public:
489 size_t count,
490 const SkPoint pts[],
491 const SkPaint& paint);
492 void execute(SkCanvas* canvas) const override;
493 bool render(SkCanvas* canvas) const override;
494 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
495
496private:
499 SkPaint fPaint;
500
501 using INHERITED = DrawCommand;
502};
503
505public:
507 void execute(SkCanvas* canvas) const override;
508 bool render(SkCanvas* canvas) const override;
509 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
510
511private:
512 SkRegion fRegion;
513 SkPaint fPaint;
514
515 using INHERITED = DrawCommand;
516};
517
519public:
521
522 void execute(SkCanvas* canvas) const override;
523 bool render(SkCanvas* canvas) const override;
524 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
525
526private:
527 sk_sp<SkTextBlob> fBlob;
528 SkScalar fXPos;
529 SkScalar fYPos;
530 SkPaint fPaint;
531
532 using INHERITED = DrawCommand;
533};
534
536public:
537 DrawPatchCommand(const SkPoint cubics[12],
538 const SkColor colors[4],
539 const SkPoint texCoords[4],
540 SkBlendMode bmode,
541 const SkPaint& paint);
542 void execute(SkCanvas* canvas) const override;
543 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
544
545private:
546 SkPoint fCubics[12];
547 SkColor* fColorsPtr;
548 SkColor fColors[4];
549 SkPoint* fTexCoordsPtr;
550 SkPoint fTexCoords[4];
551 SkBlendMode fBlendMode;
552 SkPaint fPaint;
553
554 using INHERITED = DrawCommand;
555};
556
558public:
559 DrawRectCommand(const SkRect& rect, const SkPaint& paint);
560 void execute(SkCanvas* canvas) const override;
561 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
562
563private:
564 SkRect fRect;
565 SkPaint fPaint;
566
567 using INHERITED = DrawCommand;
568};
569
571public:
573 void execute(SkCanvas* canvas) const override;
574 bool render(SkCanvas* canvas) const override;
575 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
576
577private:
578 SkRRect fRRect;
579 SkPaint fPaint;
580
581 using INHERITED = DrawCommand;
582};
583
585public:
586 DrawDRRectCommand(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint);
587 void execute(SkCanvas* canvas) const override;
588 bool render(SkCanvas* canvas) const override;
589 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
590
591private:
592 SkRRect fOuter;
593 SkRRect fInner;
594 SkPaint fPaint;
595
596 using INHERITED = DrawCommand;
597};
598
600public:
602
603 void execute(SkCanvas* canvas) const override;
604
605private:
606 sk_sp<SkVertices> fVertices;
607 SkBlendMode fBlendMode;
608 SkPaint fPaint;
609
610 using INHERITED = DrawCommand;
611};
612
614public:
616 const SkRSXform[],
617 const SkRect[],
618 const SkColor[],
619 int,
621 const SkSamplingOptions&,
622 const SkRect*,
623 const SkPaint*);
624
625 void execute(SkCanvas* canvas) const override;
626
627private:
631 SkTDArray<SkColor> fColors;
632 SkBlendMode fBlendMode;
633 SkSamplingOptions fSampling;
634 SkTLazy<SkRect> fCull;
635 SkTLazy<SkPaint> fPaint;
636
637 using INHERITED = DrawCommand;
638};
639
640class SaveCommand : public DrawCommand {
641public:
642 SaveCommand();
643 void execute(SkCanvas* canvas) const override;
644
645private:
646 using INHERITED = DrawCommand;
647};
648
650public:
652 void execute(SkCanvas* canvas) const override;
653 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
654
655private:
656 SkTLazy<SkRect> fBounds;
657 SkTLazy<SkPaint> fPaint;
659 uint32_t fSaveLayerFlags;
660 SkScalar fBackdropScale;
661
662 using INHERITED = DrawCommand;
663};
664
666public:
668 void execute(SkCanvas* canvas) const override;
669 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
670
671private:
672 SkMatrix fMatrix;
673
674 using INHERITED = DrawCommand;
675};
676
678public:
679 SetM44Command(const SkM44& matrix);
680 void execute(SkCanvas* canvas) const override;
681 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
682
683private:
684 SkM44 fMatrix;
685
686 using INHERITED = DrawCommand;
687};
688
690public:
691 DrawShadowCommand(const SkPath& path, const SkDrawShadowRec& rec);
692 void execute(SkCanvas* canvas) const override;
693 bool render(SkCanvas* canvas) const override;
694 void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
695
696private:
697 SkPath fPath;
698 SkDrawShadowRec fShadowRec;
699
700 using INHERITED = DrawCommand;
701};
702
704public:
706 void execute(SkCanvas* canvas) const override;
707
708private:
709 sk_sp<SkDrawable> fDrawable;
710 SkTLazy<SkMatrix> fMatrix;
711
712 using INHERITED = DrawCommand;
713};
714
716public:
718 const SkPoint clip[4],
720 const SkColor4f& color,
722 void execute(SkCanvas* canvas) const override;
723
724private:
725 SkRect fRect;
726 SkPoint fClip[4];
727 int fHasClip;
729 SkColor4f fColor;
730 SkBlendMode fMode;
731
732 using INHERITED = DrawCommand;
733};
734
736public:
738 int count,
739 const SkPoint[],
740 const SkMatrix[],
741 const SkSamplingOptions&,
742 const SkPaint*,
744 void execute(SkCanvas* canvas) const override;
745
746private:
748 int fCount;
750 skia_private::AutoTArray<SkMatrix> fPreViewMatrices;
751 SkSamplingOptions fSampling;
752 SkTLazy<SkPaint> fPaint;
753 SkCanvas::SrcRectConstraint fConstraint;
754
755 using INHERITED = DrawCommand;
756};
757#endif
int count
Definition: FontMgrTest.cpp:50
SkBlendMode
Definition: SkBlendMode.h:38
SkClipOp
Definition: SkClipOp.h:13
uint32_t SkColor
Definition: SkColor.h:37
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
static bool left(const SkPoint &p0, const SkPoint &p1)
SkFilterMode
GLenum type
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
BeginDrawPictureCommand(const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint)
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
ClearCommand(SkColor color)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
ClipPathCommand(const SkPath &path, SkClipOp op, bool doAA)
bool render(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
ClipRRectCommand(const SkRRect &rrect, SkClipOp op, bool doAA)
void execute(SkCanvas *canvas) const override
bool render(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
ClipRectCommand(const SkRect &rect, SkClipOp op, bool doAA)
void execute(SkCanvas *canvas) const override
ClipRegionCommand(const SkRegion &region, SkClipOp op)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
ClipShaderCommand(sk_sp< SkShader >, SkClipOp)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
Concat44Command(const SkM44 &matrix)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
ConcatCommand(const SkMatrix &matrix)
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
DrawAnnotationCommand(const SkRect &, const char key[], sk_sp< SkData > value)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawArcCommand(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
void execute(SkCanvas *canvas) const override
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
DrawAtlasCommand(const SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, SkBlendMode, const SkSamplingOptions &, const SkRect *, const SkPaint *)
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
DrawBehindCommand(const SkPaint &paint)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
static void MakeJsonMatrix44(SkJSONWriter &, const SkM44 &)
OpType getOpType() const
Definition: DrawCommand.h:143
static void MakeJsonPoint3(SkJSONWriter &, const SkPoint3 &point)
static void MakeJsonPoint(SkJSONWriter &, const SkPoint &point)
static void MakeJsonColor(SkJSONWriter &, const SkColor color)
@ kDrawBitmapRect_OpType
Definition: DrawCommand.h:68
@ kDrawTextBlob_OpType
Definition: DrawCommand.h:84
@ kDrawPoints_OpType
Definition: DrawCommand.h:79
@ kDrawImageLattice_OpType
Definition: DrawCommand.h:71
@ kSaveLayer_OpType
Definition: DrawCommand.h:93
@ kDrawEdgeAAImageSet_OpType
Definition: DrawCommand.h:89
@ kDrawPath_OpType
Definition: DrawCommand.h:78
@ kDrawEdgeAAQuad_OpType
Definition: DrawCommand.h:88
@ kClipPath_OpType
Definition: DrawCommand.h:58
@ kClipShader_OpType
Definition: DrawCommand.h:62
@ kDrawPaint_OpType
Definition: DrawCommand.h:76
@ kClipRegion_OpType
Definition: DrawCommand.h:59
@ kClipRRect_OpType
Definition: DrawCommand.h:61
@ kDrawImageRectLayer_OpType
Definition: DrawCommand.h:73
@ kDrawAnnotation_OpType
Definition: DrawCommand.h:66
@ kDrawRect_OpType
Definition: DrawCommand.h:80
@ kDrawRRect_OpType
Definition: DrawCommand.h:81
@ kDrawVertices_OpType
Definition: DrawCommand.h:85
@ kEndDrawPicture_OpType
Definition: DrawCommand.h:90
@ kSetMatrix_OpType
Definition: DrawCommand.h:94
@ kDrawOval_OpType
Definition: DrawCommand.h:74
@ kBeginDrawPicture_OpType
Definition: DrawCommand.h:56
@ kDrawImage_OpType
Definition: DrawCommand.h:70
@ kDrawImageRect_OpType
Definition: DrawCommand.h:72
@ kDrawPatch_OpType
Definition: DrawCommand.h:77
@ kResetClip_OpType
Definition: DrawCommand.h:63
@ kDrawBitmap_OpType
Definition: DrawCommand.h:67
@ kDrawAtlas_OpType
Definition: DrawCommand.h:86
@ kConcat44_OpType
Definition: DrawCommand.h:65
@ kDrawDRRect_OpType
Definition: DrawCommand.h:69
@ kDrawShadow_OpType
Definition: DrawCommand.h:83
@ kDrawDrawable_OpType
Definition: DrawCommand.h:87
@ kClipRect_OpType
Definition: DrawCommand.h:60
@ kDrawRegion_OpType
Definition: DrawCommand.h:82
DrawCommand(OpType opType)
static const int kOpTypeCount
Definition: DrawCommand.h:100
static void MakeJsonPaint(SkJSONWriter &, const SkPaint &paint, UrlDataManager &urlDataManager)
virtual ~DrawCommand()
Definition: DrawCommand.h:106
void setVisible(bool toggle)
Definition: DrawCommand.h:110
virtual void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const
static void MakeJsonRect(SkJSONWriter &, const SkRect &rect)
virtual bool render(SkCanvas *canvas) const
Definition: DrawCommand.h:114
static void flatten(const SkFlattenable *flattenable, SkJSONWriter &writer, UrlDataManager &urlDataManager)
static void MakeJsonSampling(SkJSONWriter &, const SkSamplingOptions &sampling)
static const char * GetCommandString(OpType type)
static void MakeJsonMatrix(SkJSONWriter &, const SkMatrix &)
virtual void execute(SkCanvas *) const =0
static void MakeJsonIRect(SkJSONWriter &, const SkIRect &)
static void MakeJsonRegion(SkJSONWriter &, const SkRegion &region)
static void MakeJsonLattice(SkJSONWriter &, const SkCanvas::Lattice &lattice)
static void MakeJsonColor4f(SkJSONWriter &, const SkColor4f &color)
static void MakeJsonPath(SkJSONWriter &, const SkPath &path)
static void WritePNG(const SkBitmap &bitmap, SkWStream &out)
bool isVisible() const
Definition: DrawCommand.h:108
DrawDRRectCommand(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
void execute(SkCanvas *canvas) const override
bool render(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawDrawableCommand(SkDrawable *, const SkMatrix *)
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
DrawEdgeAAImageSetCommand(const SkCanvas::ImageSetEntry[], int count, const SkPoint[], const SkMatrix[], const SkSamplingOptions &, const SkPaint *, SkCanvas::SrcRectConstraint)
DrawEdgeAAQuadCommand(const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aa, const SkColor4f &color, SkBlendMode mode)
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
bool render(SkCanvas *canvas) const override
uint64_t imageId(UrlDataManager &udb) const
DrawImageCommand(const SkImage *image, SkScalar left, SkScalar top, const SkSamplingOptions &, const SkPaint *paint)
uint64_t imageId(UrlDataManager &udb) const
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawImageLatticeCommand(const SkImage *image, const SkCanvas::Lattice &lattice, const SkRect &dst, SkFilterMode, const SkPaint *paint)
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
bool render(SkCanvas *canvas) const override
DrawImageRectCommand(const SkImage *image, const SkRect &src, const SkRect &dst, const SkSamplingOptions &sampling, const SkPaint *paint, SkCanvas::SrcRectConstraint constraint)
uint64_t imageId(UrlDataManager &udm) const
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
DrawImageRectLayerCommand(DebugLayerManager *layerManager, const int nodeId, const int frame, const SkRect &src, const SkRect &dst, const SkSamplingOptions &sampling, const SkPaint *paint, SkCanvas::SrcRectConstraint constraint)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
DrawOvalCommand(const SkRect &oval, const SkPaint &paint)
bool render(SkCanvas *canvas) const override
DrawPaintCommand(const SkPaint &paint)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawPatchCommand(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode bmode, const SkPaint &paint)
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
bool render(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawPathCommand(const SkPath &path, const SkPaint &paint)
bool render(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
DrawPointsCommand(SkCanvas::PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
DrawRRectCommand(const SkRRect &rrect, const SkPaint &paint)
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawRectCommand(const SkRect &rect, const SkPaint &paint)
bool render(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
DrawRegionCommand(const SkRegion &region, const SkPaint &paint)
bool render(SkCanvas *canvas) const override
DrawShadowCommand(const SkPath &path, const SkDrawShadowRec &rec)
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
DrawTextBlobCommand(sk_sp< SkTextBlob > blob, SkScalar x, SkScalar y, const SkPaint &paint)
bool render(SkCanvas *canvas) const override
DrawVerticesCommand(sk_sp< SkVertices >, SkBlendMode, const SkPaint &)
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
EndDrawPictureCommand(bool restore)
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
void execute(SkCanvas *canvas) const override
SaveLayerCommand(const SkCanvas::SaveLayerRec &)
void execute(SkCanvas *canvas) const override
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
SetM44Command(const SkM44 &matrix)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
SetMatrixCommand(const SkMatrix &matrix)
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager) const override
void execute(SkCanvas *canvas) const override
SrcRectConstraint
Definition: SkCanvas.h:1541
Definition: SkM44.h:150
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
DlColor color
double frame
Definition: examples.cpp:31
float SkScalar
Definition: extension.cpp:12
uint8_t value
double y
double x
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
sk_sp< const SkImage > image
Definition: SkRecords.h:269
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
SkRRect rrect
Definition: SkRecords.h:232
SkRect oval
Definition: SkRecords.h:249
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
SkScalar startAngle
Definition: SkRecords.h:250
SkScalar sweepAngle
Definition: SkRecords.h:251
PODArray< SkColor > colors
Definition: SkRecords.h:276
SkSamplingOptions sampling
Definition: SkRecords.h:337
Definition: bitmap.py:1
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
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
dst
Definition: cp.py:12
Definition: SkRect.h:32