Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations | Functions
dl_op_records.h File Reference
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_blend_mode.h"
#include "flutter/display_list/dl_op_receiver.h"
#include "flutter/display_list/dl_sampling_options.h"
#include "flutter/display_list/effects/dl_color_source.h"
#include "flutter/fml/macros.h"
#include "flutter/impeller/geometry/path.h"
#include "flutter/impeller/typographer/text_frame.h"
#include "third_party/skia/include/core/SkRSXform.h"

Go to the source code of this file.

Classes

struct  flutter::DispatchContext
 
struct  flutter::DispatchContext::SaveInfo
 
struct  flutter::DLOp
 
struct  flutter::SetStyleOp
 
struct  flutter::SetStrokeWidthOp
 
struct  flutter::SetStrokeMiterOp
 
struct  flutter::SetColorOp
 
struct  flutter::SetBlendModeOp
 
struct  flutter::SetImageColorSourceOp
 
struct  flutter::SetRuntimeEffectColorSourceOp
 
struct  flutter::SetSharedImageFilterOp
 
struct  flutter::SaveOpBase
 
struct  flutter::SaveOp
 
struct  flutter::SaveLayerOpBase
 
struct  flutter::SaveLayerOp
 
struct  flutter::SaveLayerBackdropOp
 
struct  flutter::RestoreOp
 
struct  flutter::TransformClipOpBase
 
struct  flutter::TranslateOp
 
struct  flutter::ScaleOp
 
struct  flutter::RotateOp
 
struct  flutter::SkewOp
 
struct  flutter::Transform2DAffineOp
 
struct  flutter::TransformFullPerspectiveOp
 
struct  flutter::TransformResetOp
 
struct  flutter::DrawOpBase
 
struct  flutter::DrawPaintOp
 
struct  flutter::DrawColorOp
 
struct  flutter::DrawPathOp
 
struct  flutter::DrawArcOp
 
struct  flutter::DrawVerticesOp
 
struct  flutter::DrawImageRectOp
 
struct  flutter::DrawAtlasBaseOp
 
struct  flutter::DrawAtlasOp
 
struct  flutter::DrawAtlasCulledOp
 
struct  flutter::DrawDisplayListOp
 
struct  flutter::DrawTextBlobOp
 
struct  flutter::DrawTextFrameOp
 

Namespaces

namespace  flutter
 

Macros

#define DEFINE_SET_BOOL_OP(name)
 
#define DEFINE_SET_ENUM_OP(name)
 
#define DEFINE_SET_CLEAR_DLATTR_OP(name, sk_name, field)
 
#define DEFINE_CLIP_SHAPE_OP(shapetype, clipop)
 
#define DEFINE_CLIP_PATH_OP(clipop)
 
#define DEFINE_DRAW_1ARG_OP(op_name, arg_type, arg_name)
 
#define DEFINE_DRAW_2ARG_OP(op_name, type1, name1, type2, name2)
 
#define DEFINE_DRAW_POINTS_OP(name, mode)
 
#define DEFINE_DRAW_IMAGE_OP(name, with_attributes)
 
#define DEFINE_DRAW_IMAGE_NINE_OP(name, render_with_attributes)
 
#define DEFINE_DRAW_SHADOW_OP(name, transparent_occluder)
 

Enumerations

enum class  flutter::DisplayListCompare { flutter::kUseBulkCompare , flutter::kNotEqual , flutter::kEqual }
 

Functions

 flutter::DEFINE_DRAW_POINTS_OP (Points, kPoints)
 
 flutter::DEFINE_DRAW_POINTS_OP (Lines, kLines)
 
 flutter::DEFINE_DRAW_POINTS_OP (Polygon, kPolygon)
 

Macro Definition Documentation

◆ DEFINE_CLIP_PATH_OP

#define DEFINE_CLIP_PATH_OP (   clipop)
Value:
struct Clip##clipop##PathOp final : TransformClipOpBase { \
static constexpr auto kType = DisplayListOpType::kClip##clipop##Path; \
\
Clip##clipop##PathOp(const SkPath& path, bool is_aa) \
: is_aa(is_aa), cached_path(path) {} \
\
const bool is_aa; \
const DlOpReceiver::CacheablePath cached_path; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
if (ctx.receiver.PrefersImpellerPaths()) { \
ctx.receiver.clipPath(cached_path, DlCanvas::ClipOp::k##clipop, \
is_aa); \
} else { \
ctx.receiver.clipPath(cached_path.sk_path, \
DlCanvas::ClipOp::k##clipop, is_aa); \
} \
} \
} \
\
DisplayListCompare equals(const Clip##clipop##PathOp* other) const { \
return is_aa == other->is_aa && cached_path == other->cached_path \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};
static bool equals(T *a, T *b)

Definition at line 588 of file dl_op_records.h.

589 : TransformClipOpBase { \
590 static constexpr auto kType = DisplayListOpType::kClip##clipop##Path; \
591 \
592 Clip##clipop##PathOp(const SkPath& path, bool is_aa) \
593 : is_aa(is_aa), cached_path(path) {} \
594 \
595 const bool is_aa; \
596 const DlOpReceiver::CacheablePath cached_path; \
597 \
598 void dispatch(DispatchContext& ctx) const { \
599 if (op_needed(ctx)) { \
600 if (ctx.receiver.PrefersImpellerPaths()) { \
601 ctx.receiver.clipPath(cached_path, DlCanvas::ClipOp::k##clipop, \
602 is_aa); \
603 } else { \
604 ctx.receiver.clipPath(cached_path.sk_path, \
605 DlCanvas::ClipOp::k##clipop, is_aa); \
606 } \
607 } \
608 } \
609 \
610 DisplayListCompare equals(const Clip##clipop##PathOp* other) const { \
611 return is_aa == other->is_aa && cached_path == other->cached_path \
612 ? DisplayListCompare::kEqual \
613 : DisplayListCompare::kNotEqual; \
614 } \
615 };
CanvasPath Path
Definition dart_ui.cc:58

◆ DEFINE_CLIP_SHAPE_OP

#define DEFINE_CLIP_SHAPE_OP (   shapetype,
  clipop 
)
Value:
struct Clip##clipop##shapetype##Op final : TransformClipOpBase { \
static constexpr auto kType = DisplayListOpType::kClip##clipop##shapetype; \
\
Clip##clipop##shapetype##Op(Sk##shapetype shape, bool is_aa) \
: is_aa(is_aa), shape(shape) {} \
\
const bool is_aa; \
const Sk##shapetype shape; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.clip##shapetype(shape, DlCanvas::ClipOp::k##clipop, \
is_aa); \
} \
} \
};

Definition at line 565 of file dl_op_records.h.

566 : TransformClipOpBase { \
567 static constexpr auto kType = DisplayListOpType::kClip##clipop##shapetype; \
568 \
569 Clip##clipop##shapetype##Op(Sk##shapetype shape, bool is_aa) \
570 : is_aa(is_aa), shape(shape) {} \
571 \
572 const bool is_aa; \
573 const Sk##shapetype shape; \
574 \
575 void dispatch(DispatchContext& ctx) const { \
576 if (op_needed(ctx)) { \
577 ctx.receiver.clip##shapetype(shape, DlCanvas::ClipOp::k##clipop, \
578 is_aa); \
579 } \
580 } \
581 };

◆ DEFINE_DRAW_1ARG_OP

#define DEFINE_DRAW_1ARG_OP (   op_name,
  arg_type,
  arg_name 
)
Value:
struct Draw##op_name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::kDraw##op_name; \
\
explicit Draw##op_name##Op(arg_type arg_name) : arg_name(arg_name) {} \
\
const arg_type arg_name; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.draw##op_name(arg_name); \
} \
} \
};
static void Draw(SkCanvas *canvas, const SkRect &rect)

Definition at line 663 of file dl_op_records.h.

664 : DrawOpBase { \
665 static constexpr auto kType = DisplayListOpType::kDraw##op_name; \
666 \
667 explicit Draw##op_name##Op(arg_type arg_name) : arg_name(arg_name) {} \
668 \
669 const arg_type arg_name; \
670 \
671 void dispatch(DispatchContext& ctx) const { \
672 if (op_needed(ctx)) { \
673 ctx.receiver.draw##op_name(arg_name); \
674 } \
675 } \
676 };

◆ DEFINE_DRAW_2ARG_OP

#define DEFINE_DRAW_2ARG_OP (   op_name,
  type1,
  name1,
  type2,
  name2 
)
Value:
struct Draw##op_name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::kDraw##op_name; \
\
Draw##op_name##Op(type1 name1, type2 name2) \
: name1(name1), name2(name2) {} \
\
const type1 name1; \
const type2 name2; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.draw##op_name(name1, name2); \
} \
} \
};

Definition at line 713 of file dl_op_records.h.

714 : DrawOpBase { \
715 static constexpr auto kType = DisplayListOpType::kDraw##op_name; \
716 \
717 Draw##op_name##Op(type1 name1, type2 name2) \
718 : name1(name1), name2(name2) {} \
719 \
720 const type1 name1; \
721 const type2 name2; \
722 \
723 void dispatch(DispatchContext& ctx) const { \
724 if (op_needed(ctx)) { \
725 ctx.receiver.draw##op_name(name1, name2); \
726 } \
727 } \
728 };

◆ DEFINE_DRAW_IMAGE_NINE_OP

#define DEFINE_DRAW_IMAGE_NINE_OP (   name,
  render_with_attributes 
)
Value:
struct name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::k##name; \
\
name##Op(const sk_sp<DlImage>& image, \
const SkIRect& center, \
const SkRect& dst, \
DlFilterMode mode) \
: center(center), dst(dst), mode(mode), image(std::move(image)) {} \
\
const SkIRect center; \
const SkRect dst; \
const DlFilterMode mode; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.drawImageNine(image, center, dst, mode, \
render_with_attributes); \
} \
} \
\
DisplayListCompare equals(const name##Op* other) const { \
return (center == other->center && dst == other->dst && \
mode == other->mode && image->Equals(other->image)) \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};
static SkScalar center(float pos0, float pos1)
sk_sp< SkImage > image
Definition examples.cpp:29
const char * name
Definition fuchsia.cc:50

Definition at line 877 of file dl_op_records.h.

878 : DrawOpBase { \
879 static constexpr auto kType = DisplayListOpType::k##name; \
880 \
881 name##Op(const sk_sp<DlImage>& image, \
882 const SkIRect& center, \
883 const SkRect& dst, \
884 DlFilterMode mode) \
885 : center(center), dst(dst), mode(mode), image(std::move(image)) {} \
886 \
887 const SkIRect center; \
888 const SkRect dst; \
889 const DlFilterMode mode; \
890 const sk_sp<DlImage> image; \
891 \
892 void dispatch(DispatchContext& ctx) const { \
893 if (op_needed(ctx)) { \
894 ctx.receiver.drawImageNine(image, center, dst, mode, \
895 render_with_attributes); \
896 } \
897 } \
898 \
899 DisplayListCompare equals(const name##Op* other) const { \
900 return (center == other->center && dst == other->dst && \
901 mode == other->mode && image->Equals(other->image)) \
902 ? DisplayListCompare::kEqual \
903 : DisplayListCompare::kNotEqual; \
904 } \
905 };
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

◆ DEFINE_DRAW_IMAGE_OP

#define DEFINE_DRAW_IMAGE_OP (   name,
  with_attributes 
)
Value:
struct name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::k##name; \
\
name##Op(const sk_sp<DlImage>& image, \
const SkPoint& point, \
DlImageSampling sampling) \
: point(point), sampling(sampling), image(std::move(image)) {} \
\
const SkPoint point; \
const DlImageSampling sampling; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
ctx.receiver.drawImage(image, point, sampling, with_attributes); \
} \
} \
\
DisplayListCompare equals(const name##Op* other) const { \
return (point == other->point && sampling == other->sampling && \
image->Equals(other->image)) \
? DisplayListCompare::kEqual \
: DisplayListCompare::kNotEqual; \
} \
};

Definition at line 804 of file dl_op_records.h.

805 : DrawOpBase { \
806 static constexpr auto kType = DisplayListOpType::k##name; \
807 \
808 name##Op(const sk_sp<DlImage>& image, \
809 const SkPoint& point, \
810 DlImageSampling sampling) \
811 : point(point), sampling(sampling), image(std::move(image)) {} \
812 \
813 const SkPoint point; \
815 const sk_sp<DlImage> image; \
816 \
817 void dispatch(DispatchContext& ctx) const { \
818 if (op_needed(ctx)) { \
819 ctx.receiver.drawImage(image, point, sampling, with_attributes); \
820 } \
821 } \
822 \
823 DisplayListCompare equals(const name##Op* other) const { \
824 return (point == other->point && sampling == other->sampling && \
825 image->Equals(other->image)) \
826 ? DisplayListCompare::kEqual \
827 : DisplayListCompare::kNotEqual; \
828 } \
829 };
SkSamplingOptions sampling
Definition SkRecords.h:337

◆ DEFINE_DRAW_POINTS_OP

#define DEFINE_DRAW_POINTS_OP (   name,
  mode 
)
Value:
struct Draw##name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::kDraw##name; \
\
explicit Draw##name##Op(uint32_t count) : count(count) {} \
\
const uint32_t count; \
\
void dispatch(DispatchContext& ctx) const { \
if (op_needed(ctx)) { \
const SkPoint* pts = reinterpret_cast<const SkPoint*>(this + 1); \
ctx.receiver.drawPoints(DlCanvas::PointMode::mode, count, pts); \
} \
} \
};
int count

Definition at line 759 of file dl_op_records.h.

760 : DrawOpBase { \
761 static constexpr auto kType = DisplayListOpType::kDraw##name; \
762 \
763 explicit Draw##name##Op(uint32_t count) : count(count) {} \
764 \
765 const uint32_t count; \
766 \
767 void dispatch(DispatchContext& ctx) const { \
768 if (op_needed(ctx)) { \
769 const SkPoint* pts = reinterpret_cast<const SkPoint*>(this + 1); \
770 ctx.receiver.drawPoints(DlCanvas::PointMode::mode, count, pts); \
771 } \
772 } \
773 };

◆ DEFINE_DRAW_SHADOW_OP

#define DEFINE_DRAW_SHADOW_OP (   name,
  transparent_occluder 
)

Definition at line 1106 of file dl_op_records.h.

1107 : DrawOpBase { \
1108 static constexpr auto kType = DisplayListOpType::kDraw##name; \
1109 \
1110 Draw##name##Op(const SkPath& path, \
1111 DlColor color, \
1112 SkScalar elevation, \
1113 SkScalar dpr) \
1114 : color(color), elevation(elevation), dpr(dpr), cached_path(path) {} \
1115 \
1116 const DlColor color; \
1117 const SkScalar elevation; \
1118 const SkScalar dpr; \
1119 const DlOpReceiver::CacheablePath cached_path; \
1120 \
1121 void dispatch(DispatchContext& ctx) const { \
1122 if (op_needed(ctx)) { \
1123 if (ctx.receiver.PrefersImpellerPaths()) { \
1124 ctx.receiver.drawShadow(cached_path, color, elevation, \
1125 transparent_occluder, dpr); \
1126 } else { \
1127 ctx.receiver.drawShadow(cached_path.sk_path, color, elevation, \
1128 transparent_occluder, dpr); \
1129 } \
1130 } \
1131 } \
1132 \
1133 DisplayListCompare equals(const Draw##name##Op* other) const { \
1134 return color == other->color && elevation == other->elevation && \
1135 dpr == other->dpr && cached_path == other->cached_path \
1136 ? DisplayListCompare::kEqual \
1137 : DisplayListCompare::kNotEqual; \
1138 } \
1139 };
SkColor4f color
float SkScalar
Definition extension.cpp:12

◆ DEFINE_SET_BOOL_OP

#define DEFINE_SET_BOOL_OP (   name)
Value:
struct Set##name##Op final : DLOp { \
static constexpr auto kType = DisplayListOpType::kSet##name; \
\
explicit Set##name##Op(bool value) : value(value) {} \
\
const bool value; \
\
void dispatch(DispatchContext& ctx) const { \
ctx.receiver.set##name(value); \
} \
};
uint8_t value

Definition at line 111 of file dl_op_records.h.

112 : DLOp { \
113 static constexpr auto kType = DisplayListOpType::kSet##name; \
114 \
115 explicit Set##name##Op(bool value) : value(value) {} \
116 \
117 const bool value; \
118 \
119 void dispatch(DispatchContext& ctx) const { \
120 ctx.receiver.set##name(value); \
121 } \
122 };

◆ DEFINE_SET_CLEAR_DLATTR_OP

#define DEFINE_SET_CLEAR_DLATTR_OP (   name,
  sk_name,
  field 
)
Value:
struct Clear##name##Op final : DLOp { \
static constexpr auto kType = DisplayListOpType::kClear##name; \
\
Clear##name##Op() {} \
\
void dispatch(DispatchContext& ctx) const { \
ctx.receiver.set##name(nullptr); \
} \
}; \
struct SetPod##name##Op final : DLOp { \
static constexpr auto kType = DisplayListOpType::kSetPod##name; \
\
SetPod##name##Op() {} \
\
void dispatch(DispatchContext& ctx) const { \
const Dl##name* filter = reinterpret_cast<const Dl##name*>(this + 1); \
ctx.receiver.set##name(filter); \
} \
};

Definition at line 210 of file dl_op_records.h.

211 : DLOp { \
212 static constexpr auto kType = DisplayListOpType::kClear##name; \
213 \
214 Clear##name##Op() {} \
215 \
216 void dispatch(DispatchContext& ctx) const { \
217 ctx.receiver.set##name(nullptr); \
218 } \
219 }; \
220 struct SetPod##name##Op final : DLOp { \
221 static constexpr auto kType = DisplayListOpType::kSetPod##name; \
222 \
223 SetPod##name##Op() {} \
224 \
225 void dispatch(DispatchContext& ctx) const { \
226 const Dl##name* filter = reinterpret_cast<const Dl##name*>(this + 1); \
227 ctx.receiver.set##name(filter); \
228 } \
229 };

◆ DEFINE_SET_ENUM_OP

#define DEFINE_SET_ENUM_OP (   name)
Value:
struct SetStroke##name##Op final : DLOp { \
static constexpr auto kType = DisplayListOpType::kSetStroke##name; \
\
explicit SetStroke##name##Op(DlStroke##name value) : value(value) {} \
\
const DlStroke##name value; \
\
void dispatch(DispatchContext& ctx) const { \
ctx.receiver.setStroke##name(value); \
} \
};

Definition at line 128 of file dl_op_records.h.

129 : DLOp { \
130 static constexpr auto kType = DisplayListOpType::kSetStroke##name; \
131 \
132 explicit SetStroke##name##Op(DlStroke##name value) : value(value) {} \
133 \
134 const DlStroke##name value; \
135 \
136 void dispatch(DispatchContext& ctx) const { \
137 ctx.receiver.setStroke##name(value); \
138 } \
139 };