Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Friends | List of all members
flutter::DisplayListBuilder Class Referencefinal

#include <dl_builder.h>

Inheritance diagram for flutter::DisplayListBuilder:
flutter::DlCanvas SkRefCnt flutter::DlOpReceiver flutter::DisplayListOpFlags SkRefCntBase

Public Member Functions

 DisplayListBuilder (bool prepare_rtree)
 
 DisplayListBuilder (const SkRect &cull_rect=kMaxCullRect, bool prepare_rtree=false)
 
 ~DisplayListBuilder ()
 
SkISize GetBaseLayerSize () const override
 
SkImageInfo GetImageInfo () const override
 
void Save () override
 
void SaveLayer (const SkRect *bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr) override
 
void Restore () override
 
int GetSaveCount () const override
 
void RestoreToCount (int restore_count) override
 
void Translate (SkScalar tx, SkScalar ty) override
 
void Scale (SkScalar sx, SkScalar sy) override
 
void Rotate (SkScalar degrees) override
 
void Skew (SkScalar sx, SkScalar sy) override
 
void Transform2DAffine (SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
 
void TransformFullPerspective (SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
 
void TransformReset () override
 
void Transform (const SkMatrix *matrix) override
 
void Transform (const SkM44 *matrix44) override
 
void SetTransform (const SkMatrix *matrix) override
 
void SetTransform (const SkM44 *matrix44) override
 
SkM44 GetTransformFullPerspective () const override
 
SkMatrix GetTransform () const override
 
void ClipRect (const SkRect &rect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false) override
 
void ClipRRect (const SkRRect &rrect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false) override
 
void ClipPath (const SkPath &path, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false) override
 
SkRect GetDestinationClipBounds () const override
 
SkRect GetLocalClipBounds () const override
 
bool QuickReject (const SkRect &bounds) const override
 
void DrawPaint (const DlPaint &paint) override
 
void DrawColor (DlColor color, DlBlendMode mode) override
 
void DrawLine (const SkPoint &p0, const SkPoint &p1, const DlPaint &paint) override
 
void DrawRect (const SkRect &rect, const DlPaint &paint) override
 
void DrawOval (const SkRect &bounds, const DlPaint &paint) override
 
void DrawCircle (const SkPoint &center, SkScalar radius, const DlPaint &paint) override
 
void DrawRRect (const SkRRect &rrect, const DlPaint &paint) override
 
void DrawDRRect (const SkRRect &outer, const SkRRect &inner, const DlPaint &paint) override
 
void DrawPath (const SkPath &path, const DlPaint &paint) override
 
void DrawArc (const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter, const DlPaint &paint) override
 
void DrawPoints (PointMode mode, uint32_t count, const SkPoint pts[], const DlPaint &paint) override
 
void DrawVertices (const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint) override
 
void DrawImage (const sk_sp< DlImage > &image, const SkPoint point, DlImageSampling sampling, const DlPaint *paint=nullptr) override
 
void DrawImageRect (const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
 
void DrawImageNine (const sk_sp< DlImage > &image, const SkIRect &center, const SkRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr) override
 
void DrawAtlas (const sk_sp< DlImage > &atlas, const SkRSXform xform[], const SkRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const SkRect *cullRect, const DlPaint *paint=nullptr) override
 
void DrawDisplayList (const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1) override
 
void DrawTextBlob (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const DlPaint &paint) override
 
void drawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y) override
 
void DrawTextFrame (const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y, const DlPaint &paint) override
 
void DrawShadow (const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
 
void Flush () override
 
sk_sp< DisplayListBuild ()
 
virtual void Transform (const SkMatrix *matrix)=0
 
virtual void Transform (const SkM44 *matrix44)=0
 
void Transform (const SkMatrix &matrix)
 
void Transform (const SkM44 &matrix44)
 
virtual void DrawVertices (const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint)=0
 
void DrawVertices (const std::shared_ptr< const DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint)
 
virtual void DrawImageRect (const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)=0
 
virtual void DrawImageRect (const sk_sp< DlImage > &image, const SkIRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)
 
void DrawImageRect (const sk_sp< DlImage > &image, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)
 
- Public Member Functions inherited from flutter::DlCanvas
virtual ~DlCanvas ()=default
 
void Transform (const SkMatrix &matrix)
 
void Transform (const SkM44 &matrix44)
 
virtual void SetTransform (const SkMatrix &matrix)
 
virtual void SetTransform (const SkM44 &matrix44)
 
void Clear (DlColor color)
 
void DrawVertices (const std::shared_ptr< const DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint)
 
void DrawImageRect (const sk_sp< DlImage > &image, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Attributes

static constexpr SkRect kMaxCullRect
 
- Static Public Attributes inherited from flutter::DlCanvas
static constexpr SkScalar kShadowLightHeight = 600
 
static constexpr SkScalar kShadowLightRadius = 800
 

Private Member Functions

void setAntiAlias (bool aa) override
 
void setInvertColors (bool invert) override
 
void setStrokeCap (DlStrokeCap cap) override
 
void setStrokeJoin (DlStrokeJoin join) override
 
void setDrawStyle (DlDrawStyle style) override
 
void setStrokeWidth (float width) override
 
void setStrokeMiter (float limit) override
 
void setColor (DlColor color) override
 
void setBlendMode (DlBlendMode mode) override
 
void setColorSource (const DlColorSource *source) override
 
void setImageFilter (const DlImageFilter *filter) override
 
void setColorFilter (const DlColorFilter *filter) override
 
void setPathEffect (const DlPathEffect *effect) override
 
void setMaskFilter (const DlMaskFilter *filter) override
 
void save () override
 
void saveLayer (const SkRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop) override
 
void restore () override
 
void translate (SkScalar tx, SkScalar ty) override
 
void scale (SkScalar sx, SkScalar sy) override
 
void rotate (SkScalar degrees) override
 
void skew (SkScalar sx, SkScalar sy) override
 
void transform2DAffine (SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
 
void transformFullPerspective (SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
 
void transformReset () override
 
void clipRect (const SkRect &rect, ClipOp clip_op, bool is_aa) override
 
void clipRRect (const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
 
void clipPath (const SkPath &path, ClipOp clip_op, bool is_aa) override
 
void drawPaint () override
 
void drawColor (DlColor color, DlBlendMode mode) override
 
void drawLine (const SkPoint &p0, const SkPoint &p1) override
 
void drawRect (const SkRect &rect) override
 
void drawOval (const SkRect &bounds) override
 
void drawCircle (const SkPoint &center, SkScalar radius) override
 
void drawRRect (const SkRRect &rrect) override
 
void drawDRRect (const SkRRect &outer, const SkRRect &inner) override
 
void drawPath (const SkPath &path) override
 
void drawArc (const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter) override
 
void drawPoints (PointMode mode, uint32_t count, const SkPoint pts[]) override
 
void drawVertices (const DlVertices *vertices, DlBlendMode mode) override
 
void drawImage (const sk_sp< DlImage > image, const SkPoint point, DlImageSampling sampling, bool render_with_attributes) override
 
void drawImageRect (const sk_sp< DlImage > image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
 
void drawImageNine (const sk_sp< DlImage > image, const SkIRect &center, const SkRect &dst, DlFilterMode filter, bool render_with_attributes) override
 
void drawAtlas (const sk_sp< DlImage > atlas, const SkRSXform xform[], const SkRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const SkRect *cullRect, bool render_with_attributes) override
 
void drawDisplayList (const sk_sp< DisplayList > display_list, SkScalar opacity) override
 
void drawTextBlob (const sk_sp< SkTextBlob > blob, SkScalar x, SkScalar y) override
 
void drawShadow (const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
 

Friends

DlOpReceiverDisplayListBuilderBenchmarkAccessor (DisplayListBuilder &builder)
 
DlOpReceiverDisplayListBuilderTestingAccessor (DisplayListBuilder &builder)
 
DlPaint DisplayListBuilderTestingAttributes (DisplayListBuilder &builder)
 

Additional Inherited Members

- Public Types inherited from flutter::DlCanvas
enum class  ClipOp { kDifference , kIntersect }
 
enum class  PointMode { kPoints , kLines , kPolygon }
 
enum class  SrcRectConstraint { kStrict , kFast }
 
- Static Public Member Functions inherited from flutter::DlCanvas
static SkRect ComputeShadowBounds (const SkPath &path, float elevation, SkScalar dpr, const SkMatrix &ctm)
 

Detailed Description

Definition at line 27 of file dl_builder.h.

Constructor & Destructor Documentation

◆ DisplayListBuilder() [1/2]

flutter::DisplayListBuilder::DisplayListBuilder ( bool  prepare_rtree)
inlineexplicit

Definition at line 35 of file dl_builder.h.

36 : DisplayListBuilder(kMaxCullRect, prepare_rtree) {}
static constexpr SkRect kMaxCullRect
Definition dl_builder.h:32
DisplayListBuilder(bool prepare_rtree)
Definition dl_builder.h:35

◆ DisplayListBuilder() [2/2]

flutter::DisplayListBuilder::DisplayListBuilder ( const SkRect cull_rect = kMaxCullRect,
bool  prepare_rtree = false 
)
explicit

Definition at line 102 of file dl_builder.cc.

104 : tracker_(cull_rect, SkMatrix::I()) {
105 if (prepare_rtree) {
106 accumulator_ = std::make_unique<RTreeBoundsAccumulator>();
107 } else {
108 accumulator_ = std::make_unique<RectBoundsAccumulator>();
109 }
110
111 layer_stack_.emplace_back();
112 current_layer_ = &layer_stack_.back();
113}
static const SkMatrix & I()

◆ ~DisplayListBuilder()

flutter::DisplayListBuilder::~DisplayListBuilder ( )

Definition at line 115 of file dl_builder.cc.

115 {
116 uint8_t* ptr = storage_.get();
117 if (ptr) {
118 DisplayList::DisposeOps(ptr, ptr + used_);
119 }
120}

Member Function Documentation

◆ Build()

sk_sp< DisplayList > flutter::DisplayListBuilder::Build ( )

Definition at line 67 of file dl_builder.cc.

67 {
68 while (layer_stack_.size() > 1) {
69 restore();
70 }
71
72 size_t bytes = used_;
73 int count = render_op_count_;
74 size_t nested_bytes = nested_bytes_;
75 int nested_count = nested_op_count_;
76 uint32_t total_depth = depth_;
77 bool compatible = current_layer_->is_group_opacity_compatible();
78 bool is_safe = is_ui_thread_safe_;
79 bool affects_transparency = current_layer_->affects_transparent_layer();
80
81 sk_sp<DlRTree> rtree = this->rtree();
82 SkRect bounds = rtree ? rtree->bounds() : this->bounds();
83
84 used_ = allocated_ = render_op_count_ = op_index_ = 0;
85 nested_bytes_ = nested_op_count_ = 0;
86 depth_ = 0;
87 is_ui_thread_safe_ = true;
88 storage_.realloc(bytes);
89 layer_stack_.pop_back();
90 layer_stack_.emplace_back();
91 current_layer_ = &layer_stack_.back();
92 tracker_.reset();
93 layer_tracker_.reset();
94 current_ = DlPaint();
95
96 return sk_sp<DisplayList>(
97 new DisplayList(std::move(storage_), bytes, count, nested_bytes,
98 nested_count, total_depth, bounds, compatible, is_safe,
99 affects_transparency, std::move(rtree)));
100}
int count
static bool compatible(const MTLRenderPassAttachmentDescriptor *first, const MTLRenderPassAttachmentDescriptor *second, const GrMtlPipelineState *pipelineState)
void realloc(size_t count)

◆ clipPath()

void flutter::DisplayListBuilder::clipPath ( const SkPath path,
ClipOp  clip_op,
bool  is_aa 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 404 of file dl_builder.h.

404 {
405 ClipPath(path, clip_op, is_aa);
406 }
void ClipPath(const SkPath &path, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false) override
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

◆ ClipPath()

void flutter::DisplayListBuilder::ClipPath ( const SkPath path,
ClipOp  clip_op = ClipOp::kIntersect,
bool  is_aa = false 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 899 of file dl_builder.cc.

901 {
902 if (!path.isInverseFillType()) {
903 SkRect rect;
904 if (path.isRect(&rect)) {
905 this->clipRect(rect, clip_op, is_aa);
906 return;
907 }
909 if (path.isOval(&rect)) {
910 rrect.setOval(rect);
911 this->clipRRect(rrect, clip_op, is_aa);
912 return;
913 }
914 if (path.isRRect(&rrect)) {
915 this->clipRRect(rrect, clip_op, is_aa);
916 return;
917 }
918 }
919 tracker_.clipPath(path, clip_op, is_aa);
920 if (current_layer_->is_nop_ || tracker_.is_cull_rect_empty()) {
921 current_layer_->is_nop_ = true;
922 return;
923 }
924 checkForDeferredSave();
925 switch (clip_op) {
926 case ClipOp::kIntersect:
927 Push<ClipIntersectPathOp>(0, path, is_aa);
928 break;
929 case ClipOp::kDifference:
930 Push<ClipDifferencePathOp>(0, path, is_aa);
931 break;
932 }
933}
void setOval(const SkRect &oval)
Definition SkRRect.cpp:30
void clipRRect(const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
Definition dl_builder.h:400
void clipRect(const SkRect &rect, ClipOp clip_op, bool is_aa) override
Definition dl_builder.h:396
void clipPath(const SkPath &path, ClipOp op, bool is_aa)
SkRRect rrect
Definition SkRecords.h:232
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350

◆ clipRect()

void flutter::DisplayListBuilder::clipRect ( const SkRect rect,
ClipOp  clip_op,
bool  is_aa 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 396 of file dl_builder.h.

396 {
397 ClipRect(rect, clip_op, is_aa);
398 }

◆ ClipRect()

void flutter::DisplayListBuilder::ClipRect ( const SkRect rect,
ClipOp  clip_op = ClipOp::kIntersect,
bool  is_aa = false 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 856 of file dl_builder.cc.

858 {
859 if (!rect.isFinite()) {
860 return;
861 }
862 tracker_.clipRect(rect, clip_op, is_aa);
863 if (current_layer_->is_nop_ || tracker_.is_cull_rect_empty()) {
864 current_layer_->is_nop_ = true;
865 return;
866 }
867 checkForDeferredSave();
868 switch (clip_op) {
869 case ClipOp::kIntersect:
870 Push<ClipIntersectRectOp>(0, rect, is_aa);
871 break;
872 case ClipOp::kDifference:
873 Push<ClipDifferenceRectOp>(0, rect, is_aa);
874 break;
875 }
876}
void clipRect(const DlRect &rect, ClipOp op, bool is_aa)

◆ clipRRect()

void flutter::DisplayListBuilder::clipRRect ( const SkRRect rrect,
ClipOp  clip_op,
bool  is_aa 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 400 of file dl_builder.h.

400 {
401 ClipRRect(rrect, clip_op, is_aa);
402 }
void ClipRRect(const SkRRect &rrect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false) override

◆ ClipRRect()

void flutter::DisplayListBuilder::ClipRRect ( const SkRRect rrect,
ClipOp  clip_op = ClipOp::kIntersect,
bool  is_aa = false 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 877 of file dl_builder.cc.

879 {
880 if (rrect.isRect()) {
881 clipRect(rrect.rect(), clip_op, is_aa);
882 } else {
883 tracker_.clipRRect(rrect, clip_op, is_aa);
884 if (current_layer_->is_nop_ || tracker_.is_cull_rect_empty()) {
885 current_layer_->is_nop_ = true;
886 return;
887 }
888 checkForDeferredSave();
889 switch (clip_op) {
890 case ClipOp::kIntersect:
891 Push<ClipIntersectRRectOp>(0, rrect, is_aa);
892 break;
893 case ClipOp::kDifference:
894 Push<ClipDifferenceRRectOp>(0, rrect, is_aa);
895 break;
896 }
897 }
898}
const SkRect & rect() const
Definition SkRRect.h:264
bool isRect() const
Definition SkRRect.h:84
void clipRRect(const SkRRect &rrect, ClipOp op, bool is_aa)

◆ drawArc()

void flutter::DisplayListBuilder::drawArc ( const SkRect bounds,
SkScalar  start,
SkScalar  sweep,
bool  useCenter 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1080 of file dl_builder.cc.

1083 {
1084 DisplayListAttributeFlags flags = //
1085 useCenter //
1088 OpResult result = PaintResult(current_, flags);
1089 // This could be tighter if we compute where the start and end
1090 // angles are and then also consider the quadrants swept and
1091 // the center if specified.
1092 if (result != OpResult::kNoEffect && AccumulateOpBounds(bounds, flags)) {
1093 Push<DrawArcOp>(0, bounds, start, sweep, useCenter);
1094 if (useCenter) {
1095 CheckLayerOpacityHairlineCompatibility();
1096 } else {
1097 CheckLayerOpacityCompatibility();
1098 }
1099 UpdateLayerResult(result);
1100 }
1101}
static constexpr DisplayListAttributeFlags kDrawArcWithCenterFlags
static constexpr DisplayListAttributeFlags kDrawArcNoCenterFlags
FlutterSemanticsFlag flags
GAsyncResult * result

◆ DrawArc()

void flutter::DisplayListBuilder::DrawArc ( const SkRect bounds,
SkScalar  start,
SkScalar  sweep,
bool  useCenter,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1102 of file dl_builder.cc.

1106 {
1107 SetAttributesFromPaint(
1109 drawArc(bounds, start, sweep, useCenter);
1110}
void drawArc(const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter) override
const Paint & paint

◆ DrawAtlas()

void flutter::DisplayListBuilder::DrawAtlas ( const sk_sp< DlImage > &  atlas,
const SkRSXform  xform[],
const SkRect  tex[],
const DlColor  colors[],
int  count,
DlBlendMode  mode,
DlImageSampling  sampling,
const SkRect cullRect,
const DlPaint paint = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1359 of file dl_builder.cc.

1367 {
1368 if (paint != nullptr) {
1369 SetAttributesFromPaint(*paint,
1371 drawAtlas(atlas, xform, tex, colors, count, mode, sampling, cull_rect,
1372 true);
1373 } else {
1374 drawAtlas(atlas, xform, tex, colors, count, mode, sampling, cull_rect,
1375 false);
1376 }
1377}
void drawAtlas(const sk_sp< DlImage > atlas, const SkRSXform xform[], const SkRect tex[], const DlColor colors[], int count, DlBlendMode mode, DlImageSampling sampling, const SkRect *cullRect, bool render_with_attributes) override
static constexpr DisplayListAttributeFlags kDrawAtlasWithPaintFlags
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

◆ drawAtlas()

void flutter::DisplayListBuilder::drawAtlas ( const sk_sp< DlImage atlas,
const SkRSXform  xform[],
const SkRect  tex[],
const DlColor  colors[],
int  count,
DlBlendMode  mode,
DlImageSampling  sampling,
const SkRect cullRect,
bool  render_with_attributes 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1298 of file dl_builder.cc.

1306 {
1307 DisplayListAttributeFlags flags = render_with_attributes //
1310 OpResult result = PaintResult(current_, flags);
1311 if (result == OpResult::kNoEffect) {
1312 return;
1313 }
1314 SkPoint quad[4];
1315 RectBoundsAccumulator atlasBounds;
1316 for (int i = 0; i < count; i++) {
1317 const SkRect& src = tex[i];
1318 xform[i].toQuad(src.width(), src.height(), quad);
1319 for (int j = 0; j < 4; j++) {
1320 atlasBounds.accumulate(quad[j]);
1321 }
1322 }
1323 if (atlasBounds.is_empty() ||
1324 !AccumulateOpBounds(atlasBounds.bounds(), flags)) {
1325 return;
1326 }
1327
1328 int bytes = count * (sizeof(SkRSXform) + sizeof(SkRect));
1329 void* data_ptr;
1330 if (colors != nullptr) {
1331 bytes += count * sizeof(DlColor);
1332 if (cull_rect != nullptr) {
1333 data_ptr =
1334 Push<DrawAtlasCulledOp>(bytes, atlas, count, mode, sampling, true,
1335 *cull_rect, render_with_attributes);
1336 } else {
1337 data_ptr = Push<DrawAtlasOp>(bytes, atlas, count, mode, sampling, true,
1338 render_with_attributes);
1339 }
1340 CopyV(data_ptr, xform, count, tex, count, colors, count);
1341 } else {
1342 if (cull_rect != nullptr) {
1343 data_ptr =
1344 Push<DrawAtlasCulledOp>(bytes, atlas, count, mode, sampling, false,
1345 *cull_rect, render_with_attributes);
1346 } else {
1347 data_ptr = Push<DrawAtlasOp>(bytes, atlas, count, mode, sampling, false,
1348 render_with_attributes);
1349 }
1350 CopyV(data_ptr, xform, count, tex, count);
1351 }
1352 // drawAtlas treats each image as a separate operation so we cannot rely
1353 // on it to distribute the opacity without overlap without checking all
1354 // of the transforms and texture rectangles.
1355 UpdateLayerOpacityCompatibility(false);
1356 UpdateLayerResult(result);
1357 is_ui_thread_safe_ = is_ui_thread_safe_ && atlas->isUIThreadSafe();
1358}
static constexpr DisplayListAttributeFlags kDrawAtlasFlags
sk_sp< const SkImage > atlas
Definition SkRecords.h:331
static void CopyV(void *dst)
Definition dl_builder.cc:21
void toQuad(SkScalar width, SkScalar height, SkPoint quad[4]) const
Definition SkRSXform.cpp:9

◆ drawCircle()

void flutter::DisplayListBuilder::drawCircle ( const SkPoint center,
SkScalar  radius 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1005 of file dl_builder.cc.

1005 {
1006 DisplayListAttributeFlags flags = kDrawCircleFlags;
1007 OpResult result = PaintResult(current_, flags);
1008 if (result != OpResult::kNoEffect) {
1009 SkRect bounds = SkRect::MakeLTRB(center.fX - radius, center.fY - radius,
1010 center.fX + radius, center.fY + radius);
1011 if (AccumulateOpBounds(bounds, flags)) {
1012 Push<DrawCircleOp>(0, center, radius);
1013 CheckLayerOpacityCompatibility();
1014 UpdateLayerResult(result);
1015 }
1016 }
1017}
static SkScalar center(float pos0, float pos1)
static constexpr DisplayListAttributeFlags kDrawCircleFlags
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition SkRect.h:646

◆ DrawCircle()

void flutter::DisplayListBuilder::DrawCircle ( const SkPoint center,
SkScalar  radius,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1018 of file dl_builder.cc.

1020 {
1021 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawCircleFlags);
1022 drawCircle(center, radius);
1023}
void drawCircle(const SkPoint &center, SkScalar radius) override

◆ DrawColor()

void flutter::DisplayListBuilder::DrawColor ( DlColor  color,
DlBlendMode  mode 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 951 of file dl_builder.cc.

951 {
952 OpResult result = PaintResult(DlPaint(color).setBlendMode(mode));
953 if (result != OpResult::kNoEffect && AccumulateUnbounded()) {
954 Push<DrawColorOp>(0, color, mode);
955 CheckLayerOpacityCompatibility(mode);
956 UpdateLayerResult(result);
957 }
958}
SkColor4f color
void setBlendMode(DlBlendMode mode) override
Definition dl_builder.h:315

◆ drawColor()

void flutter::DisplayListBuilder::drawColor ( DlColor  color,
DlBlendMode  mode 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 411 of file dl_builder.h.

411 {
413 }
void DrawColor(DlColor color, DlBlendMode mode) override

◆ drawDisplayList()

void flutter::DisplayListBuilder::drawDisplayList ( const sk_sp< DisplayList display_list,
SkScalar  opacity 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 469 of file dl_builder.h.

470 {
471 DrawDisplayList(display_list, opacity);
472 }
void DrawDisplayList(const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1) override

◆ DrawDisplayList()

void flutter::DisplayListBuilder::DrawDisplayList ( const sk_sp< DisplayList display_list,
SkScalar  opacity = SK_Scalar1 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1379 of file dl_builder.cc.

1380 {
1381 if (!std::isfinite(opacity) || opacity <= SK_ScalarNearlyZero ||
1382 display_list->op_count() == 0 || display_list->bounds().isEmpty() ||
1383 current_layer_->is_nop_) {
1384 return;
1385 }
1386 const SkRect bounds = display_list->bounds();
1387 bool accumulated;
1388 switch (accumulator()->type()) {
1390 accumulated = AccumulateOpBounds(bounds, kDrawDisplayListFlags);
1391 break;
1393 auto rtree = display_list->rtree();
1394 if (rtree) {
1395 std::list<SkRect> rects =
1396 rtree->searchAndConsolidateRects(GetLocalClipBounds(), false);
1397 accumulated = false;
1398 for (const SkRect& rect : rects) {
1399 // TODO (https://github.com/flutter/flutter/issues/114919): Attributes
1400 // are not necessarily `kDrawDisplayListFlags`.
1401 if (AccumulateOpBounds(rect, kDrawDisplayListFlags)) {
1402 accumulated = true;
1403 }
1404 }
1405 } else {
1406 accumulated = AccumulateOpBounds(bounds, kDrawDisplayListFlags);
1407 }
1408 break;
1409 }
1410 if (!accumulated) {
1411 return;
1412 }
1413
1414 DlPaint current_paint = current_;
1415 Push<DrawDisplayListOp>(0, display_list,
1416 opacity < SK_Scalar1 ? opacity : SK_Scalar1);
1417
1418 // This depth increment accounts for every draw call in the child
1419 // DisplayList and is in addition to the implicit depth increment
1420 // that was performed when we pushed the DrawDisplayListOp. The
1421 // eventual dispatcher can use or ignore the implicit depth increment
1422 // as it sees fit depending on whether it needs to do rendering
1423 // before or after the drawDisplayList op, but it must be accounted
1424 // for if the depth value accounting is to remain consistent between
1425 // the recording and dispatching process.
1426 depth_ += display_list->total_depth();
1427
1428 is_ui_thread_safe_ = is_ui_thread_safe_ && display_list->isUIThreadSafe();
1429 // Not really necessary if the developer is interacting with us via
1430 // our attribute-state-less DlCanvas methods, but this avoids surprises
1431 // for those who may have been using the stateful Dispatcher methods.
1432 SetAttributesFromPaint(current_paint,
1434
1435 // The non-nested op count accumulated in the |Push| method will include
1436 // this call to |drawDisplayList| for non-nested op count metrics.
1437 // But, for nested op count metrics we want the |drawDisplayList| call itself
1438 // to be transparent. So we subtract 1 from our accumulated nested count to
1439 // balance out against the 1 that was accumulated into the regular count.
1440 // This behavior is identical to the way SkPicture computed nested op counts.
1441 nested_op_count_ += display_list->op_count(true) - 1;
1442 nested_bytes_ += display_list->bytes(true);
1443 UpdateLayerOpacityCompatibility(display_list->can_apply_group_opacity());
1444 // Nop DisplayLists are eliminated above so we either affect transparent
1445 // pixels or we do not. We should not have [kNoEffect].
1446 UpdateLayerResult(display_list->modifies_transparent_black()
1447 ? OpResult::kAffectsAll
1448 : OpResult::kPreservesTransparency);
1449}
#define SK_Scalar1
Definition SkScalar.h:18
#define SK_ScalarNearlyZero
Definition SkScalar.h:99
SkRect GetLocalClipBounds() const override
Definition dl_builder.h:139
static constexpr DisplayListAttributeFlags kDrawDisplayListFlags
static constexpr DisplayListAttributeFlags kSaveLayerWithPaintFlags

◆ drawDRRect()

void flutter::DisplayListBuilder::drawDRRect ( const SkRRect outer,
const SkRRect inner 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1044 of file dl_builder.cc.

1045 {
1046 DisplayListAttributeFlags flags = kDrawDRRectFlags;
1047 OpResult result = PaintResult(current_, flags);
1048 if (result != OpResult::kNoEffect &&
1049 AccumulateOpBounds(outer.getBounds(), flags)) {
1050 Push<DrawDRRectOp>(0, outer, inner);
1051 CheckLayerOpacityCompatibility();
1052 UpdateLayerResult(result);
1053 }
1054}
const SkRect & getBounds() const
Definition SkRRect.h:279
static constexpr DisplayListAttributeFlags kDrawDRRectFlags

◆ DrawDRRect()

void flutter::DisplayListBuilder::DrawDRRect ( const SkRRect outer,
const SkRRect inner,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1055 of file dl_builder.cc.

1057 {
1058 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawDRRectFlags);
1059 drawDRRect(outer, inner);
1060}
void drawDRRect(const SkRRect &outer, const SkRRect &inner) override

◆ DrawImage()

void flutter::DisplayListBuilder::DrawImage ( const sk_sp< DlImage > &  image,
const SkPoint  point,
DlImageSampling  sampling,
const DlPaint paint = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1223 of file dl_builder.cc.

1226 {
1227 if (paint != nullptr) {
1228 SetAttributesFromPaint(*paint,
1230 drawImage(image, point, sampling, true);
1231 } else {
1232 drawImage(image, point, sampling, false);
1233 }
1234}
void drawImage(const sk_sp< DlImage > image, const SkPoint point, DlImageSampling sampling, bool render_with_attributes) override
static constexpr DisplayListAttributeFlags kDrawImageWithPaintFlags
sk_sp< SkImage > image
Definition examples.cpp:29

◆ drawImage()

void flutter::DisplayListBuilder::drawImage ( const sk_sp< DlImage image,
const SkPoint  point,
DlImageSampling  sampling,
bool  render_with_attributes 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1201 of file dl_builder.cc.

1204 {
1205 DisplayListAttributeFlags flags = render_with_attributes //
1208 OpResult result = PaintResult(current_, flags);
1209 if (result == OpResult::kNoEffect) {
1210 return;
1211 }
1212 SkRect bounds = SkRect::MakeXYWH(point.fX, point.fY, //
1213 image->width(), image->height());
1214 if (AccumulateOpBounds(bounds, flags)) {
1215 render_with_attributes
1216 ? Push<DrawImageWithAttrOp>(0, image, point, sampling)
1217 : Push<DrawImageOp>(0, image, point, sampling);
1218 CheckLayerOpacityCompatibility(render_with_attributes);
1219 UpdateLayerResult(result);
1220 is_ui_thread_safe_ = is_ui_thread_safe_ && image->isUIThreadSafe();
1221 }
1222}
int width() const
Definition SkImage.h:285
int height() const
Definition SkImage.h:291
static constexpr DisplayListAttributeFlags kDrawImageFlags
SkSamplingOptions sampling
Definition SkRecords.h:337
float fX
x-axis value
float fY
y-axis value
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition SkRect.h:659

◆ DrawImageNine()

void flutter::DisplayListBuilder::DrawImageNine ( const sk_sp< DlImage > &  image,
const SkIRect center,
const SkRect dst,
DlFilterMode  filter,
const DlPaint paint = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1285 of file dl_builder.cc.

1289 {
1290 if (paint != nullptr) {
1291 SetAttributesFromPaint(*paint,
1293 drawImageNine(image, center, dst, filter, true);
1294 } else {
1295 drawImageNine(image, center, dst, filter, false);
1296 }
1297}
void drawImageNine(const sk_sp< DlImage > image, const SkIRect &center, const SkRect &dst, DlFilterMode filter, bool render_with_attributes) override
static constexpr DisplayListAttributeFlags kDrawImageNineWithPaintFlags

◆ drawImageNine()

void flutter::DisplayListBuilder::drawImageNine ( const sk_sp< DlImage image,
const SkIRect center,
const SkRect dst,
DlFilterMode  filter,
bool  render_with_attributes 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1267 of file dl_builder.cc.

1271 {
1272 DisplayListAttributeFlags flags = render_with_attributes
1275 OpResult result = PaintResult(current_, flags);
1276 if (result != OpResult::kNoEffect && AccumulateOpBounds(dst, flags)) {
1277 render_with_attributes
1278 ? Push<DrawImageNineWithAttrOp>(0, image, center, dst, filter)
1279 : Push<DrawImageNineOp>(0, image, center, dst, filter);
1280 CheckLayerOpacityCompatibility(render_with_attributes);
1281 UpdateLayerResult(result);
1282 is_ui_thread_safe_ = is_ui_thread_safe_ && image->isUIThreadSafe();
1283 }
1284}
static constexpr DisplayListAttributeFlags kDrawImageNineFlags
dst
Definition cp.py:12

◆ DrawImageRect() [1/4]

virtual void flutter::DlCanvas::DrawImageRect ( const sk_sp< DlImage > &  image,
const SkIRect src,
const SkRect dst,
DlImageSampling  sampling,
const DlPaint paint = nullptr,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
inlinevirtual

Reimplemented from flutter::DlCanvas.

Definition at line 173 of file dl_canvas.h.

179 {
180 DrawImageRect(image, SkRect::Make(src), dst, sampling, paint, constraint);
181 }
void DrawImageRect(const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
static SkRect Make(const SkISize &size)
Definition SkRect.h:669

◆ DrawImageRect() [2/4]

void flutter::DlCanvas::DrawImageRect ( const sk_sp< DlImage > &  image,
const SkRect dst,
DlImageSampling  sampling,
const DlPaint paint = nullptr,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
inline

Definition at line 182 of file dl_canvas.h.

186 {
187 DrawImageRect(image, image->bounds(), dst, sampling, paint, constraint);
188 }
SkIRect bounds() const
Definition SkImage.h:303

◆ DrawImageRect() [3/4]

void flutter::DisplayListBuilder::DrawImageRect ( const sk_sp< DlImage > &  image,
const SkRect src,
const SkRect dst,
DlImageSampling  sampling,
const DlPaint paint = nullptr,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1253 of file dl_builder.cc.

1258 {
1259 if (paint != nullptr) {
1260 SetAttributesFromPaint(*paint,
1262 drawImageRect(image, src, dst, sampling, true, constraint);
1263 } else {
1264 drawImageRect(image, src, dst, sampling, false, constraint);
1265 }
1266}
void drawImageRect(const sk_sp< DlImage > image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, bool render_with_attributes, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
static constexpr DisplayListAttributeFlags kDrawImageRectWithPaintFlags

◆ DrawImageRect() [4/4]

virtual void flutter::DlCanvas::DrawImageRect ( const sk_sp< DlImage > &  image,
const SkRect src,
const SkRect dst,
DlImageSampling  sampling,
const DlPaint paint = nullptr,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
virtual

Implements flutter::DlCanvas.

◆ drawImageRect()

void flutter::DisplayListBuilder::drawImageRect ( const sk_sp< DlImage image,
const SkRect src,
const SkRect dst,
DlImageSampling  sampling,
bool  render_with_attributes,
SrcRectConstraint  constraint = SrcRectConstraint::kFast 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1235 of file dl_builder.cc.

1240 {
1241 DisplayListAttributeFlags flags = render_with_attributes
1244 OpResult result = PaintResult(current_, flags);
1245 if (result != OpResult::kNoEffect && AccumulateOpBounds(dst, flags)) {
1246 Push<DrawImageRectOp>(0, image, src, dst, sampling, render_with_attributes,
1247 constraint);
1248 CheckLayerOpacityCompatibility(render_with_attributes);
1249 UpdateLayerResult(result);
1250 is_ui_thread_safe_ = is_ui_thread_safe_ && image->isUIThreadSafe();
1251 }
1252}
static constexpr DisplayListAttributeFlags kDrawImageRectFlags

◆ drawLine()

void flutter::DisplayListBuilder::drawLine ( const SkPoint p0,
const SkPoint p1 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 959 of file dl_builder.cc.

959 {
960 SkRect bounds = SkRect::MakeLTRB(p0.fX, p0.fY, p1.fX, p1.fY).makeSorted();
961 DisplayListAttributeFlags flags =
962 (bounds.width() > 0.0f && bounds.height() > 0.0f) ? kDrawLineFlags
964 OpResult result = PaintResult(current_, flags);
965 if (result != OpResult::kNoEffect && AccumulateOpBounds(bounds, flags)) {
966 Push<DrawLineOp>(0, p0, p1);
967 CheckLayerOpacityCompatibility();
968 UpdateLayerResult(result);
969 }
970}
static constexpr DisplayListAttributeFlags kDrawLineFlags
static constexpr DisplayListAttributeFlags kDrawHVLineFlags
Optional< SkRect > bounds
Definition SkRecords.h:189
SkRect makeSorted() const
Definition SkRect.h:1330

◆ DrawLine()

void flutter::DisplayListBuilder::DrawLine ( const SkPoint p0,
const SkPoint p1,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 971 of file dl_builder.cc.

973 {
974 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawLineFlags);
975 drawLine(p0, p1);
976}
void drawLine(const SkPoint &p0, const SkPoint &p1) override

◆ drawOval()

void flutter::DisplayListBuilder::drawOval ( const SkRect bounds)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 991 of file dl_builder.cc.

991 {
992 DisplayListAttributeFlags flags = kDrawOvalFlags;
993 OpResult result = PaintResult(current_, flags);
994 if (result != OpResult::kNoEffect &&
995 AccumulateOpBounds(bounds.makeSorted(), flags)) {
996 Push<DrawOvalOp>(0, bounds);
997 CheckLayerOpacityCompatibility();
998 UpdateLayerResult(result);
999 }
1000}
static constexpr DisplayListAttributeFlags kDrawOvalFlags

◆ DrawOval()

void flutter::DisplayListBuilder::DrawOval ( const SkRect bounds,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1001 of file dl_builder.cc.

1001 {
1002 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawOvalFlags);
1003 drawOval(bounds);
1004}
void drawOval(const SkRect &bounds) override

◆ drawPaint()

void flutter::DisplayListBuilder::drawPaint ( )
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 939 of file dl_builder.cc.

939 {
940 OpResult result = PaintResult(current_, kDrawPaintFlags);
941 if (result != OpResult::kNoEffect && AccumulateUnbounded()) {
942 Push<DrawPaintOp>(0);
943 CheckLayerOpacityCompatibility();
944 UpdateLayerResult(result);
945 }
946}
static constexpr DisplayListAttributeFlags kDrawPaintFlags

◆ DrawPaint()

void flutter::DisplayListBuilder::DrawPaint ( const DlPaint paint)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 947 of file dl_builder.cc.

947 {
948 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawPaintFlags);
949 drawPaint();
950}

◆ drawPath()

void flutter::DisplayListBuilder::drawPath ( const SkPath path)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1061 of file dl_builder.cc.

1061 {
1062 DisplayListAttributeFlags flags = kDrawPathFlags;
1063 OpResult result = PaintResult(current_, flags);
1064 if (result != OpResult::kNoEffect) {
1065 bool is_visible = path.isInverseFillType()
1066 ? AccumulateUnbounded()
1067 : AccumulateOpBounds(path.getBounds(), flags);
1068 if (is_visible) {
1069 Push<DrawPathOp>(0, path);
1070 CheckLayerOpacityHairlineCompatibility();
1071 UpdateLayerResult(result);
1072 }
1073 }
1074}
static constexpr DisplayListAttributeFlags kDrawPathFlags

◆ DrawPath()

void flutter::DisplayListBuilder::DrawPath ( const SkPath path,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1075 of file dl_builder.cc.

1075 {
1076 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawPathFlags);
1077 drawPath(path);
1078}
void drawPath(const SkPath &path) override

◆ drawPoints()

void flutter::DisplayListBuilder::drawPoints ( PointMode  mode,
uint32_t  count,
const SkPoint  pts[] 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1124 of file dl_builder.cc.

1126 {
1127 if (count == 0) {
1128 return;
1129 }
1130 DisplayListAttributeFlags flags = FlagsForPointMode(mode);
1131 OpResult result = PaintResult(current_, flags);
1132 if (result == OpResult::kNoEffect) {
1133 return;
1134 }
1135
1137 int bytes = count * sizeof(SkPoint);
1138 RectBoundsAccumulator ptBounds;
1139 for (size_t i = 0; i < count; i++) {
1140 ptBounds.accumulate(pts[i]);
1141 }
1142 SkRect point_bounds = ptBounds.bounds();
1143 if (!AccumulateOpBounds(point_bounds, flags)) {
1144 return;
1145 }
1146
1147 void* data_ptr;
1148 switch (mode) {
1149 case PointMode::kPoints:
1150 data_ptr = Push<DrawPointsOp>(bytes, count);
1151 break;
1152 case PointMode::kLines:
1153 data_ptr = Push<DrawLinesOp>(bytes, count);
1154 break;
1155 case PointMode::kPolygon:
1156 data_ptr = Push<DrawPolygonOp>(bytes, count);
1157 break;
1158 default:
1160 return;
1161 }
1162 CopyV(data_ptr, pts, count);
1163 // drawPoints treats every point or line (or segment of a polygon)
1164 // as a completely separate operation meaning we cannot ensure
1165 // distribution of group opacity without analyzing the mode and the
1166 // bounds of every sub-primitive.
1167 // See: https://fiddle.skia.org/c/228459001d2de8db117ce25ef5cedb0c
1168 UpdateLayerOpacityCompatibility(false);
1169 UpdateLayerResult(result);
1170}
static constexpr int kMaxDrawPointsCount
#define FML_UNREACHABLE()
Definition logging.h:109
#define FML_DCHECK(condition)
Definition logging.h:103

◆ DrawPoints()

void flutter::DisplayListBuilder::DrawPoints ( PointMode  mode,
uint32_t  count,
const SkPoint  pts[],
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1171 of file dl_builder.cc.

1174 {
1175 SetAttributesFromPaint(paint, FlagsForPointMode(mode));
1176 drawPoints(mode, count, pts);
1177}
void drawPoints(PointMode mode, uint32_t count, const SkPoint pts[]) override

◆ drawRect()

void flutter::DisplayListBuilder::drawRect ( const SkRect rect)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 977 of file dl_builder.cc.

977 {
978 DisplayListAttributeFlags flags = kDrawRectFlags;
979 OpResult result = PaintResult(current_, flags);
980 if (result != OpResult::kNoEffect &&
981 AccumulateOpBounds(rect.makeSorted(), flags)) {
982 Push<DrawRectOp>(0, rect);
983 CheckLayerOpacityCompatibility();
984 UpdateLayerResult(result);
985 }
986}
static constexpr DisplayListAttributeFlags kDrawRectFlags

◆ DrawRect()

void flutter::DisplayListBuilder::DrawRect ( const SkRect rect,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 987 of file dl_builder.cc.

987 {
988 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawRectFlags);
989 drawRect(rect);
990}
void drawRect(const SkRect &rect) override

◆ drawRRect()

void flutter::DisplayListBuilder::drawRRect ( const SkRRect rrect)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1024 of file dl_builder.cc.

1024 {
1025 if (rrect.isRect()) {
1026 drawRect(rrect.rect());
1027 } else if (rrect.isOval()) {
1028 drawOval(rrect.rect());
1029 } else {
1030 DisplayListAttributeFlags flags = kDrawRRectFlags;
1031 OpResult result = PaintResult(current_, flags);
1032 if (result != OpResult::kNoEffect &&
1033 AccumulateOpBounds(rrect.getBounds(), flags)) {
1034 Push<DrawRRectOp>(0, rrect);
1035 CheckLayerOpacityCompatibility();
1036 UpdateLayerResult(result);
1037 }
1038 }
1039}
bool isOval() const
Definition SkRRect.h:85
static constexpr DisplayListAttributeFlags kDrawRRectFlags

◆ DrawRRect()

void flutter::DisplayListBuilder::DrawRRect ( const SkRRect rrect,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1040 of file dl_builder.cc.

1040 {
1041 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawRRectFlags);
1042 drawRRect(rrect);
1043}
void drawRRect(const SkRRect &rrect) override

◆ DrawShadow()

void flutter::DisplayListBuilder::DrawShadow ( const SkPath path,
const DlColor  color,
const SkScalar  elevation,
bool  transparent_occluder,
SkScalar  dpr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1526 of file dl_builder.cc.

1530 {
1531 OpResult result = PaintResult(DlPaint(color));
1532 if (result != OpResult::kNoEffect) {
1533 SkRect shadow_bounds =
1535 if (AccumulateOpBounds(shadow_bounds, kDrawShadowFlags)) {
1536 transparent_occluder //
1537 ? Push<DrawShadowTransparentOccluderOp>(0, path, color, elevation,
1538 dpr)
1539 : Push<DrawShadowOp>(0, path, color, elevation, dpr);
1540 UpdateLayerOpacityCompatibility(false);
1541 UpdateLayerResult(result);
1542 }
1543 }
1544}
SkMatrix GetTransform() const override
Definition dl_builder.h:113
static constexpr DisplayListAttributeFlags kDrawShadowFlags
static SkRect ComputeShadowBounds(const SkPath &path, float elevation, SkScalar dpr, const SkMatrix &ctm)
Definition dl_canvas.cc:12

◆ drawShadow()

void flutter::DisplayListBuilder::drawShadow ( const SkPath path,
const DlColor  color,
const SkScalar  elevation,
bool  transparent_occluder,
SkScalar  dpr 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 478 of file dl_builder.h.

482 {
483 DrawShadow(path, color, elevation, transparent_occluder, dpr);
484 }
void DrawShadow(const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override

◆ DrawTextBlob()

void flutter::DisplayListBuilder::DrawTextBlob ( const sk_sp< SkTextBlob > &  blob,
SkScalar  x,
SkScalar  y,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1477 of file dl_builder.cc.

1480 {
1481 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawTextBlobFlags);
1482 drawTextBlob(blob, x, y);
1483}
void drawTextBlob(const sk_sp< SkTextBlob > blob, SkScalar x, SkScalar y) override
static constexpr DisplayListAttributeFlags kDrawTextBlobFlags
double y
double x

◆ drawTextBlob()

void flutter::DisplayListBuilder::drawTextBlob ( const sk_sp< SkTextBlob blob,
SkScalar  x,
SkScalar  y 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1450 of file dl_builder.cc.

1452 {
1453 DisplayListAttributeFlags flags = kDrawTextBlobFlags;
1454 OpResult result = PaintResult(current_, flags);
1455 if (result == OpResult::kNoEffect) {
1456 return;
1457 }
1458 bool unclipped = AccumulateOpBounds(blob->bounds().makeOffset(x, y), flags);
1459 // TODO(https://github.com/flutter/flutter/issues/82202): Remove once the
1460 // unit tests can use Fuchsia's font manager instead of the empty default.
1461 // Until then we might encounter empty bounds for otherwise valid text and
1462 // thus we ignore the results from AccumulateOpBounds.
1463#if defined(OS_FUCHSIA)
1464 unclipped = true;
1465#endif // OS_FUCHSIA
1466 if (unclipped) {
1467 Push<DrawTextBlobOp>(0, blob, x, y);
1468 // There is no way to query if the glyphs of a text blob overlap and
1469 // there are no current guarantees from either Skia or Impeller that
1470 // they will protect overlapping glyphs from the effects of overdraw
1471 // so we must make the conservative assessment that this DL layer is
1472 // not compatible with group opacity inheritance.
1473 UpdateLayerOpacityCompatibility(false);
1474 UpdateLayerResult(result);
1475 }
1476}
const SkRect & bounds() const
Definition SkTextBlob.h:53
constexpr SkRect makeOffset(float dx, float dy) const
Definition SkRect.h:965

◆ drawTextFrame()

void flutter::DisplayListBuilder::drawTextFrame ( const std::shared_ptr< impeller::TextFrame > &  text_frame,
SkScalar  x,
SkScalar  y 
)
overridevirtual

Implements flutter::DlOpReceiver.

Definition at line 1485 of file dl_builder.cc.

1488 {
1489 DisplayListAttributeFlags flags = kDrawTextBlobFlags;
1490 OpResult result = PaintResult(current_, flags);
1491 if (result == OpResult::kNoEffect) {
1492 return;
1493 }
1494 impeller::Rect bounds = text_frame->GetBounds();
1495 SkRect sk_bounds = SkRect::MakeLTRB(bounds.GetLeft(), bounds.GetTop(),
1496 bounds.GetRight(), bounds.GetBottom());
1497 bool unclipped = AccumulateOpBounds(sk_bounds.makeOffset(x, y), flags);
1498 // TODO(https://github.com/flutter/flutter/issues/82202): Remove once the
1499 // unit tests can use Fuchsia's font manager instead of the empty default.
1500 // Until then we might encounter empty bounds for otherwise valid text and
1501 // thus we ignore the results from AccumulateOpBounds.
1502#if defined(OS_FUCHSIA)
1503 unclipped = true;
1504#endif // OS_FUCHSIA
1505 if (unclipped) {
1506 Push<DrawTextFrameOp>(0, text_frame, x, y);
1507 // There is no way to query if the glyphs of a text blob overlap and
1508 // there are no current guarantees from either Skia or Impeller that
1509 // they will protect overlapping glyphs from the effects of overdraw
1510 // so we must make the conservative assessment that this DL layer is
1511 // not compatible with group opacity inheritance.
1512 UpdateLayerOpacityCompatibility(false);
1513 UpdateLayerResult(result);
1514 }
1515}

◆ DrawTextFrame()

void flutter::DisplayListBuilder::DrawTextFrame ( const std::shared_ptr< impeller::TextFrame > &  text_frame,
SkScalar  x,
SkScalar  y,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1517 of file dl_builder.cc.

1521 {
1522 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawTextBlobFlags);
1523 drawTextFrame(text_frame, x, y);
1524}
void drawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y) override

◆ drawVertices()

void flutter::DisplayListBuilder::drawVertices ( const DlVertices vertices,
DlBlendMode  mode 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 1178 of file dl_builder.cc.

1179 {
1180 DisplayListAttributeFlags flags = kDrawVerticesFlags;
1181 OpResult result = PaintResult(current_, flags);
1182 if (result != OpResult::kNoEffect &&
1183 AccumulateOpBounds(vertices->bounds(), flags)) {
1184 void* pod = Push<DrawVerticesOp>(vertices->size(), mode);
1185 new (pod) DlVertices(vertices);
1186 // DrawVertices applies its colors to the paint so we have no way
1187 // of controlling opacity using the current paint attributes.
1188 // Although, examination of the |mode| might find some predictable
1189 // cases.
1190 UpdateLayerOpacityCompatibility(false);
1191 UpdateLayerResult(result);
1192 }
1193}
static constexpr DisplayListAttributeFlags kDrawVerticesFlags

◆ DrawVertices() [1/3]

void flutter::DisplayListBuilder::DrawVertices ( const DlVertices vertices,
DlBlendMode  mode,
const DlPaint paint 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 1194 of file dl_builder.cc.

1196 {
1197 SetAttributesFromPaint(paint, DisplayListOpFlags::kDrawVerticesFlags);
1198 drawVertices(vertices, mode);
1199}
void drawVertices(const DlVertices *vertices, DlBlendMode mode) override

◆ DrawVertices() [2/3]

virtual void flutter::DlCanvas::DrawVertices ( const DlVertices vertices,
DlBlendMode  mode,
const DlPaint paint 
)
virtual

Implements flutter::DlCanvas.

◆ DrawVertices() [3/3]

void flutter::DlCanvas::DrawVertices ( const std::shared_ptr< const DlVertices > &  vertices,
DlBlendMode  mode,
const DlPaint paint 
)
inline

Definition at line 157 of file dl_canvas.h.

159 {
160 DrawVertices(vertices.get(), mode, paint);
161 }
void DrawVertices(const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint) override

◆ Flush()

void flutter::DisplayListBuilder::Flush ( )
inlineoverridevirtual

Implements flutter::DlCanvas.

Definition at line 245 of file dl_builder.h.

245{}

◆ GetBaseLayerSize()

SkISize flutter::DisplayListBuilder::GetBaseLayerSize ( ) const
overridevirtual

Implements flutter::DlCanvas.

Definition at line 122 of file dl_builder.cc.

122 {
123 return tracker_.base_device_cull_rect().roundOut().size();
124}
void roundOut(SkIRect *dst) const
Definition SkRect.h:1241

◆ GetDestinationClipBounds()

SkRect flutter::DisplayListBuilder::GetDestinationClipBounds ( ) const
inlineoverridevirtual

Conservative estimate of the bounds of all outstanding clip operations measured in the coordinate space within which this DisplayList will be rendered.

Implements flutter::DlCanvas.

Definition at line 132 of file dl_builder.h.

132 {
133 return tracker_.device_cull_rect();
134 }

◆ GetImageInfo()

SkImageInfo flutter::DisplayListBuilder::GetImageInfo ( ) const
overridevirtual

Implements flutter::DlCanvas.

Definition at line 126 of file dl_builder.cc.

126 {
128 return SkImageInfo::MakeUnknown(size.width(), size.height());
129}
SkISize GetBaseLayerSize() const override
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 keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259
static SkImageInfo MakeUnknown()

◆ GetLocalClipBounds()

SkRect flutter::DisplayListBuilder::GetLocalClipBounds ( ) const
inlineoverridevirtual

Conservative estimate of the bounds of all outstanding clip operations transformed into the local coordinate space in which currently recorded rendering operations are interpreted.

Implements flutter::DlCanvas.

Definition at line 139 of file dl_builder.h.

139 {
140 return tracker_.local_cull_rect();
141 }

◆ GetSaveCount()

int flutter::DisplayListBuilder::GetSaveCount ( ) const
inlineoverridevirtual

Implements flutter::DlCanvas.

Definition at line 58 of file dl_builder.h.

58{ return layer_stack_.size(); }

◆ GetTransform()

SkMatrix flutter::DisplayListBuilder::GetTransform ( ) const
inlineoverridevirtual

Returns the 3x3 partial perspective transform representing all transform operations executed so far in this DisplayList within the enclosing save stack.

Implements flutter::DlCanvas.

Definition at line 113 of file dl_builder.h.

113{ return tracker_.matrix_3x3(); }

◆ GetTransformFullPerspective()

SkM44 flutter::DisplayListBuilder::GetTransformFullPerspective ( ) const
inlineoverridevirtual

Returns the 4x4 full perspective transform representing all transform operations executed so far in this DisplayList within the enclosing save stack.

Implements flutter::DlCanvas.

Definition at line 106 of file dl_builder.h.

106 {
107 return tracker_.matrix_4x4();
108 }

◆ QuickReject()

bool flutter::DisplayListBuilder::QuickReject ( const SkRect bounds) const
overridevirtual

Return true iff the supplied bounds are easily shown to be outside of the current clip bounds. This method may conservatively return false if it cannot make the determination.

Implements flutter::DlCanvas.

Definition at line 935 of file dl_builder.cc.

935 {
936 return tracker_.content_culled(bounds);
937}
bool content_culled(const SkRect &content_bounds) const

◆ Restore()

void flutter::DisplayListBuilder::Restore ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 429 of file dl_builder.cc.

429 {
430 if (layer_stack_.size() <= 1) {
431 return;
432 }
433
434 SaveOpBase* op = reinterpret_cast<SaveOpBase*>(storage_.get() +
435 current_layer_->save_offset());
436
437 if (!current_layer_->has_deferred_save_op_) {
438 op->restore_index = op_index_;
439 op->total_content_depth = depth_ - current_layer_->start_depth_;
440 Push<RestoreOp>(0);
441 if (current_layer_->is_save_layer()) {
442 // A saveLayer will usually do a final copy to the main buffer in
443 // addition to its content, but that is accounted for outside of
444 // the total content depth computed above.
445 depth_ += render_op_depth_cost_;
446 }
447 }
448
449 std::shared_ptr<const DlImageFilter> filter = current_layer_->filter();
450 {
451 // We should not pop the stack until we are done synching up the current
452 // and parent layers.
453 auto parent_layer = &layer_stack_.end()[-2];
454
455 if (current_layer_->is_save_layer()) {
456 // Layers are never deferred for now, we need to update the
457 // following code if we ever do saveLayer culling...
458 FML_DCHECK(!current_layer_->has_deferred_save_op_);
459 FML_DCHECK(current_layer_->layer_accumulator_);
460
461 SkRect content_bounds = current_layer_->layer_accumulator_->bounds();
462
463 switch (op->type) {
464 case DisplayListOpType::kSaveLayer:
465 case DisplayListOpType::kSaveLayerBackdrop: {
466 SaveLayerOpBase* layer_op = reinterpret_cast<SaveLayerOpBase*>(op);
467 if (op->options.bounds_from_caller()) {
468 if (!content_bounds.isEmpty() &&
469 !layer_op->rect.contains(content_bounds)) {
470 op->options = op->options.with_content_is_clipped();
471 content_bounds.intersect(layer_op->rect);
472 }
473 }
474 layer_op->rect = content_bounds;
475 break;
476 }
477 default:
479 }
480
481 if (layer_tracker_->getSaveCount() > 1) {
482 layer_tracker_->restore();
483 } else {
484 // If this was the last layer in the tracker, then there should
485 // be no parent saveLayer.
486 FML_DCHECK(!parent_layer->layer_accumulator_);
487 layer_tracker_.reset();
488 }
489
490 if (parent_layer->layer_accumulator_) {
491 SkRect bounds_for_parent = content_bounds;
492 if (filter) {
493 if (!filter->map_local_bounds(bounds_for_parent, bounds_for_parent)) {
494 parent_layer->set_unbounded();
495 }
496 }
497 // The content_bounds were accumulated in the base coordinate system
498 // of the current layer, and have been adjusted there according to
499 // its image filter.
500 // The content bounds accumulation of the parent layer is relative
501 // to the parent's base coordinate system, so we need to adjust
502 // bounds_for_parent to that coordinate space.
503 FML_DCHECK(layer_tracker_);
504 layer_tracker_->mapRect(&bounds_for_parent);
505 parent_layer->layer_accumulator_->accumulate(bounds_for_parent);
506 }
507
508 if (current_layer_->is_group_opacity_compatible()) {
509 // We are now going to go back and modify the matching saveLayer
510 // call to add the option indicating it can distribute an opacity
511 // value to its children.
512 //
513 // Note that this operation cannot and does not change the size
514 // or structure of the SaveLayerOp record. It only sets an option
515 // flag on an existing field.
516 //
517 // Note that these kinds of modification operations on data already
518 // in the DisplayList are only allowed *during* the build phase.
519 // Once built, the DisplayList records must remain read only to
520 // ensure consistency of rendering and |Equals()| behavior.
521 op->options = op->options.with_can_distribute_opacity();
522 }
523 } else {
524 if (layer_tracker_) {
525 FML_DCHECK(layer_tracker_->getSaveCount() > 1);
526 layer_tracker_->restore();
527 }
528 // For regular save() ops there was no protecting layer so we have to
529 // accumulate the inheritance properties into the enclosing layer.
530 if (current_layer_->cannot_inherit_opacity()) {
531 parent_layer->mark_incompatible();
532 } else if (current_layer_->has_compatible_op()) {
533 parent_layer->add_compatible_op();
534 }
535 }
536 }
537
538 // Remember whether the outgoing layer was unbounded so we can adjust
539 // for it below after we apply the outgoing layer's filter to the bounds.
540 bool popped_was_unbounded = current_layer_->is_unbounded();
541
542 // parent_layer is no longer in scope, time to pop the layer.
543 layer_stack_.pop_back();
544 tracker_.restore();
545 current_layer_ = &layer_stack_.back();
546
547 // As we pop the accumulator, use the filter that was applied to the
548 // outgoing layer (saved above, if any) to adjust the bounds that
549 // were accumulated while that layer was active.
550 if (filter) {
551 const SkRect clip = tracker_.device_cull_rect();
552 if (!accumulator()->restore(
553 [filter = filter, matrix = GetTransform()](const SkRect& input,
554 SkRect& output) {
555 SkIRect output_bounds;
556 bool ret = filter->map_device_bounds(input.roundOut(), matrix,
557 output_bounds);
558 output.set(output_bounds);
559 return ret;
560 },
561 &clip)) {
562 popped_was_unbounded = true;
563 }
564 } else {
565 accumulator()->restore();
566 }
567
568 if (popped_was_unbounded) {
569 AccumulateUnbounded();
570 }
571}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
virtual void restore()=0
bool intersect(const SkRect &r)
Definition SkRect.cpp:114
bool isEmpty() const
Definition SkRect.h:693

◆ restore()

void flutter::DisplayListBuilder::restore ( )
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 363 of file dl_builder.h.

363{ Restore(); }

◆ RestoreToCount()

void flutter::DisplayListBuilder::RestoreToCount ( int  restore_count)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 572 of file dl_builder.cc.

572 {
573 FML_DCHECK(restore_count <= GetSaveCount());
574 while (restore_count < GetSaveCount() && GetSaveCount() > 1) {
575 restore();
576 }
577}
int GetSaveCount() const override
Definition dl_builder.h:58

◆ Rotate()

void flutter::DisplayListBuilder::Rotate ( SkScalar  degrees)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 729 of file dl_builder.cc.

729 {
730 if (SkScalarMod(degrees, 360.0) != 0.0) {
731 checkForDeferredSave();
732 Push<RotateOp>(0, degrees);
733 tracker_.rotate(degrees);
734 if (layer_tracker_) {
735 layer_tracker_->rotate(degrees);
736 }
737 }
738}
#define SkScalarMod(x, y)
Definition SkScalar.h:41

◆ rotate()

void flutter::DisplayListBuilder::rotate ( SkScalar  degrees)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 370 of file dl_builder.h.

370{ Rotate(degrees); }
void Rotate(SkScalar degrees) override

◆ Save()

void flutter::DisplayListBuilder::Save ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 400 of file dl_builder.cc.

400 {
401 layer_stack_.emplace_back();
402 current_layer_ = &layer_stack_.back();
403
404 FML_DCHECK(layer_stack_.size() >= 2u);
405 // Note we can't use the previous value of current_layer_ because
406 // the emplace_back() may have moved the storage locations, so we
407 // recompute the location of the penultimate layer info here.
408 auto parent_layer = &layer_stack_.end()[-2];
409
410 current_layer_->has_deferred_save_op_ = true;
411 current_layer_->is_nop_ = parent_layer->is_nop_;
412
413 if (parent_layer->layer_accumulator_) {
414 FML_DCHECK(layer_tracker_);
415 // If the previous layer was using an accumulator, we need to keep
416 // filling it with content bounds. We reuse the previous accumulator
417 // for this layer, but clone the associated transform so that new
418 // transform mutations are restricted to this save/restore context.
419 current_layer_->layer_accumulator_ = parent_layer->layer_accumulator_;
420 layer_tracker_->save();
421 } else {
422 FML_DCHECK(!layer_tracker_);
423 }
424
425 tracker_.save();
426 accumulator()->save();
427}

◆ save()

void flutter::DisplayListBuilder::save ( )
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 354 of file dl_builder.h.

354{ Save(); }

◆ saveLayer()

void flutter::DisplayListBuilder::saveLayer ( const SkRect bounds,
const SaveLayerOptions  options,
const DlImageFilter backdrop 
)
overrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 578 of file dl_builder.cc.

580 {
581 SaveLayerOptions options = in_options.without_optimizations();
582 DisplayListAttributeFlags flags = options.renders_with_attributes()
585 OpResult result = PaintResult(current_, flags);
586 if (result == OpResult::kNoEffect) {
587 save();
588 current_layer_->is_nop_ = true;
589 return;
590 }
591
592 size_t save_layer_offset = used_;
593
594 if (options.renders_with_attributes()) {
595 // The actual flood of the outer layer clip will occur after the
596 // (eventual) corresponding restore is called, but rather than
597 // remember this information in the LayerInfo until the restore
598 // method is processed, we just mark the unbounded state up front.
599 // Another reason to accumulate the clip here rather than in
600 // restore is so that this savelayer will be tagged in the rtree
601 // with its full bounds and the right op_index so that it doesn't
602 // get culled during rendering.
603 if (!paint_nops_on_transparency()) {
604 // We will fill the clip of the outer layer when we restore.
605 // Accumulate should always return true here because if the
606 // clip was empty then that would have been caught up above
607 // when we tested the PaintResult.
608 [[maybe_unused]] bool unclipped = AccumulateUnbounded();
609 FML_DCHECK(unclipped);
610 }
611 CheckLayerOpacityCompatibility(true);
612 layer_stack_.emplace_back(save_layer_offset, depth_);
613 layer_stack_.back().filter_ = current_.getImageFilter();
614 } else {
615 CheckLayerOpacityCompatibility(false);
616 layer_stack_.emplace_back(save_layer_offset, depth_);
617 }
618 current_layer_ = &layer_stack_.back();
619 current_layer_->is_save_layer_ = true;
620
621 tracker_.save();
622 accumulator()->save();
623
624 SkRect record_bounds;
625 if (in_options.bounds_from_caller()) {
626 options = options.with_bounds_from_caller();
627 record_bounds = bounds;
628 } else {
629 FML_DCHECK(record_bounds.isEmpty());
630 }
631 current_layer_->layer_accumulator_.reset(new RectBoundsAccumulator());
632 if (layer_tracker_) {
633 layer_tracker_->save();
634 layer_tracker_->setTransform(SkMatrix::I());
635 } else {
636 SkRect cull_rect;
637 if (in_options.bounds_from_caller()) {
638 cull_rect = bounds;
639 } else {
640 cull_rect = tracker_.local_cull_rect();
641 }
642 layer_tracker_.reset(
643 new DisplayListMatrixClipTracker(cull_rect, SkMatrix::I()));
644 }
645
646 if (backdrop) {
647 // A backdrop will affect up to the entire surface, bounded by the clip
648 // Accumulate should always return true here because if the
649 // clip was empty then that would have been caught up above
650 // when we tested the PaintResult.
651 [[maybe_unused]] bool unclipped = AccumulateUnbounded();
652 FML_DCHECK(unclipped);
653 Push<SaveLayerBackdropOp>(0, options, record_bounds, backdrop);
654 } else {
655 Push<SaveLayerOp>(0, options, record_bounds);
656 }
657
658 if (options.renders_with_attributes()) {
659 // |current_opacity_compatibility_| does not take an ImageFilter into
660 // account because an individual primitive with an ImageFilter can apply
661 // opacity on top of it. But, if the layer is applying the ImageFilter
662 // then it cannot pass the opacity on.
663 if (!current_opacity_compatibility_ ||
664 current_.getImageFilter() != nullptr) {
665 UpdateLayerOpacityCompatibility(false);
666 }
667 }
668 UpdateLayerResult(result);
669
670 if (options.renders_with_attributes() && current_.getImageFilter()) {
671 // We use |resetCullRect| here because we will be accumulating bounds of
672 // primitives before applying the filter to those bounds. We might
673 // encounter a primitive whose bounds are clipped, but whose filtered
674 // bounds will not be clipped. If the individual rendering ops bounds
675 // are clipped, it will not contribute to the overall bounds which
676 // could lead to inaccurate (subset) bounds of the DisplayList.
677 // We need to reset the cull rect here to avoid this premature clipping.
678 // The filtered bounds will be clipped to the existing clip rect when
679 // this layer is restored.
680 // If bounds is null then the original cull_rect will be used.
681 tracker_.resetLocalCullRect(in_options.bounds_from_caller() ? &bounds
682 : nullptr);
683 } else if (in_options.bounds_from_caller()) {
684 // Even though Skia claims that the bounds are only a hint, they actually
685 // use them as the temporary layer bounds during rendering the layer, so
686 // we set them as if a clip operation were performed.
687 tracker_.clipRect(bounds, ClipOp::kIntersect, false);
688 }
689}
const char * options
void resetLocalCullRect(const DlRect *cull_rect=nullptr)
static constexpr DisplayListAttributeFlags kSaveLayerFlags
std::shared_ptr< const DlImageFilter > getImageFilter() const
Definition dl_paint.h:154

◆ SaveLayer()

void flutter::DisplayListBuilder::SaveLayer ( const SkRect bounds,
const DlPaint paint = nullptr,
const DlImageFilter backdrop = nullptr 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 690 of file dl_builder.cc.

692 {
693 SaveLayerOptions options;
694 SkRect temp_bounds;
695 if (bounds) {
696 options = options.with_bounds_from_caller();
697 temp_bounds = *bounds;
698 } else {
699 temp_bounds.setEmpty();
700 }
701 if (paint != nullptr) {
702 options = options.with_renders_with_attributes();
703 SetAttributesFromPaint(*paint,
705 }
706 saveLayer(temp_bounds, options, backdrop);
707}
void saveLayer(const SkRect &bounds, const SaveLayerOptions options, const DlImageFilter *backdrop) override
void setEmpty()
Definition SkRect.h:842

◆ Scale()

void flutter::DisplayListBuilder::Scale ( SkScalar  sx,
SkScalar  sy 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 719 of file dl_builder.cc.

719 {
720 if (std::isfinite(sx) && std::isfinite(sy) && (sx != 1.0 || sy != 1.0)) {
721 checkForDeferredSave();
722 Push<ScaleOp>(0, sx, sy);
723 tracker_.scale(sx, sy);
724 if (layer_tracker_) {
725 layer_tracker_->scale(sx, sy);
726 }
727 }
728}

◆ scale()

void flutter::DisplayListBuilder::scale ( SkScalar  sx,
SkScalar  sy 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 368 of file dl_builder.h.

368{ Scale(sx, sy); }

◆ setAntiAlias()

void flutter::DisplayListBuilder::setAntiAlias ( bool  aa)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 267 of file dl_builder.h.

267 {
268 if (current_.isAntiAlias() != aa) {
269 onSetAntiAlias(aa);
270 }
271 }
bool isAntiAlias() const
Definition dl_paint.h:58

◆ setBlendMode()

void flutter::DisplayListBuilder::setBlendMode ( DlBlendMode  mode)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 315 of file dl_builder.h.

315 {
316 if (current_.getBlendMode() != mode) {
317 onSetBlendMode(mode);
318 }
319 }
DlBlendMode getBlendMode() const
Definition dl_paint.h:84

◆ setColor()

void flutter::DisplayListBuilder::setColor ( DlColor  color)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 309 of file dl_builder.h.

309 {
310 if (current_.getColor() != color) {
311 onSetColor(color);
312 }
313 }
DlColor getColor() const
Definition dl_paint.h:70

◆ setColorFilter()

void flutter::DisplayListBuilder::setColorFilter ( const DlColorFilter filter)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 333 of file dl_builder.h.

333 {
334 if (NotEquals(current_.getColorFilter(), filter)) {
335 onSetColorFilter(filter);
336 }
337 }
std::shared_ptr< const DlColorFilter > getColorFilter() const
Definition dl_paint.h:141
bool NotEquals(const T *a, const T *b)

◆ setColorSource()

void flutter::DisplayListBuilder::setColorSource ( const DlColorSource source)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 321 of file dl_builder.h.

321 {
322 if (NotEquals(current_.getColorSource(), source)) {
323 onSetColorSource(source);
324 }
325 }
std::shared_ptr< const DlColorSource > getColorSource() const
Definition dl_paint.h:128
SkBitmap source
Definition examples.cpp:28

◆ setDrawStyle()

void flutter::DisplayListBuilder::setDrawStyle ( DlDrawStyle  style)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 291 of file dl_builder.h.

291 {
292 if (current_.getDrawStyle() != style) {
293 onSetDrawStyle(style);
294 }
295 }
DlDrawStyle getDrawStyle() const
Definition dl_paint.h:92

◆ setImageFilter()

void flutter::DisplayListBuilder::setImageFilter ( const DlImageFilter filter)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 327 of file dl_builder.h.

327 {
328 if (NotEquals(current_.getImageFilter(), filter)) {
329 onSetImageFilter(filter);
330 }
331 }

◆ setInvertColors()

void flutter::DisplayListBuilder::setInvertColors ( bool  invert)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 273 of file dl_builder.h.

273 {
274 if (current_.isInvertColors() != invert) {
275 onSetInvertColors(invert);
276 }
277 }
bool isInvertColors() const
Definition dl_paint.h:64
gboolean invert

◆ setMaskFilter()

void flutter::DisplayListBuilder::setMaskFilter ( const DlMaskFilter filter)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 345 of file dl_builder.h.

345 {
346 if (NotEquals(current_.getMaskFilter(), filter)) {
347 onSetMaskFilter(filter);
348 }
349 }
std::shared_ptr< const DlMaskFilter > getMaskFilter() const
Definition dl_paint.h:167

◆ setPathEffect()

void flutter::DisplayListBuilder::setPathEffect ( const DlPathEffect effect)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 339 of file dl_builder.h.

339 {
340 if (NotEquals(current_.getPathEffect(), effect)) {
341 onSetPathEffect(effect);
342 }
343 }
std::shared_ptr< const DlPathEffect > getPathEffect() const
Definition dl_paint.h:180

◆ setStrokeCap()

void flutter::DisplayListBuilder::setStrokeCap ( DlStrokeCap  cap)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 279 of file dl_builder.h.

279 {
280 if (current_.getStrokeCap() != cap) {
281 onSetStrokeCap(cap);
282 }
283 }
DlStrokeCap getStrokeCap() const
Definition dl_paint.h:100

◆ setStrokeJoin()

void flutter::DisplayListBuilder::setStrokeJoin ( DlStrokeJoin  join)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 285 of file dl_builder.h.

285 {
286 if (current_.getStrokeJoin() != join) {
287 onSetStrokeJoin(join);
288 }
289 }
DlStrokeJoin getStrokeJoin() const
Definition dl_paint.h:108

◆ setStrokeMiter()

void flutter::DisplayListBuilder::setStrokeMiter ( float  limit)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 303 of file dl_builder.h.

303 {
304 if (current_.getStrokeMiter() != limit) {
305 onSetStrokeMiter(limit);
306 }
307 }
float getStrokeMiter() const
Definition dl_paint.h:122

◆ setStrokeWidth()

void flutter::DisplayListBuilder::setStrokeWidth ( float  width)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 297 of file dl_builder.h.

297 {
298 if (current_.getStrokeWidth() != width) {
299 onSetStrokeWidth(width);
300 }
301 }
float getStrokeWidth() const
Definition dl_paint.h:116
int32_t width

◆ SetTransform() [1/2]

void flutter::DisplayListBuilder::SetTransform ( const SkM44 matrix44)
inlineoverridevirtual

Implements flutter::DlCanvas.

Definition at line 96 of file dl_builder.h.

96 {
98 Transform(matrix44);
99 }
void Transform(const SkMatrix *matrix) override
void TransformReset() override

◆ SetTransform() [2/2]

void flutter::DisplayListBuilder::SetTransform ( const SkMatrix matrix)
inlineoverridevirtual

Implements flutter::DlCanvas.

Definition at line 91 of file dl_builder.h.

91 {
93 Transform(matrix);
94 }

◆ Skew()

void flutter::DisplayListBuilder::Skew ( SkScalar  sx,
SkScalar  sy 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 739 of file dl_builder.cc.

739 {
740 if (std::isfinite(sx) && std::isfinite(sy) && (sx != 0.0 || sy != 0.0)) {
741 checkForDeferredSave();
742 Push<SkewOp>(0, sx, sy);
743 tracker_.skew(sx, sy);
744 if (layer_tracker_) {
745 layer_tracker_->skew(sx, sy);
746 }
747 }
748}
void skew(SkScalar skx, SkScalar sky)

◆ skew()

void flutter::DisplayListBuilder::skew ( SkScalar  sx,
SkScalar  sy 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 372 of file dl_builder.h.

372{ Skew(sx, sy); }
void Skew(SkScalar sx, SkScalar sy) override

◆ Transform() [1/6]

void flutter::DlCanvas::Transform ( const SkM44 matrix44)
inline

Definition at line 89 of file dl_canvas.h.

89{ Transform(&matrix44); }

◆ Transform() [2/6]

void flutter::DisplayListBuilder::Transform ( const SkM44 matrix44)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 846 of file dl_builder.cc.

846 {
847 if (m44 != nullptr) {
849 m44->rc(0, 0), m44->rc(0, 1), m44->rc(0, 2), m44->rc(0, 3),
850 m44->rc(1, 0), m44->rc(1, 1), m44->rc(1, 2), m44->rc(1, 3),
851 m44->rc(2, 0), m44->rc(2, 1), m44->rc(2, 2), m44->rc(2, 3),
852 m44->rc(3, 0), m44->rc(3, 1), m44->rc(3, 2), m44->rc(3, 3));
853 }
854}
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override
Definition dl_builder.h:381

◆ Transform() [3/6]

virtual void flutter::DlCanvas::Transform ( const SkM44 matrix44)
virtual

Implements flutter::DlCanvas.

◆ Transform() [4/6]

void flutter::DlCanvas::Transform ( const SkMatrix matrix)
inline

Definition at line 88 of file dl_canvas.h.

88{ Transform(&matrix); }

◆ Transform() [5/6]

void flutter::DisplayListBuilder::Transform ( const SkMatrix matrix)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 841 of file dl_builder.cc.

841 {
842 if (matrix != nullptr) {
843 Transform(SkM44(*matrix));
844 }
845}
Definition SkM44.h:150

◆ Transform() [6/6]

virtual void flutter::DlCanvas::Transform ( const SkMatrix matrix)
virtual

Implements flutter::DlCanvas.

◆ Transform2DAffine()

void flutter::DisplayListBuilder::Transform2DAffine ( SkScalar  mxx,
SkScalar  mxy,
SkScalar  mxt,
SkScalar  myx,
SkScalar  myy,
SkScalar  myt 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 753 of file dl_builder.cc.

755 {
756 if (std::isfinite(mxx) && std::isfinite(myx) &&
757 std::isfinite(mxy) && std::isfinite(myy) &&
758 std::isfinite(mxt) && std::isfinite(myt)) {
759 if (mxx == 1 && mxy == 0 &&
760 myx == 0 && myy == 1) {
761 Translate(mxt, myt);
762 } else {
763 checkForDeferredSave();
764 Push<Transform2DAffineOp>(0,
765 mxx, mxy, mxt,
766 myx, myy, myt);
767 tracker_.transform2DAffine(mxx, mxy, mxt,
768 myx, myy, myt);
769 if (layer_tracker_) {
770 layer_tracker_->transform2DAffine(mxx, mxy, mxt,
771 myx, myy, myt);
772 }
773 }
774 }
775}
void Translate(SkScalar tx, SkScalar ty) override
void transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt)

◆ transform2DAffine()

void flutter::DisplayListBuilder::transform2DAffine ( SkScalar  mxx,
SkScalar  mxy,
SkScalar  mxt,
SkScalar  myx,
SkScalar  myy,
SkScalar  myt 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 376 of file dl_builder.h.

377 {
378 Transform2DAffine(mxx, mxy, mxt, myx, myy, myt);
379 }
void Transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override

◆ TransformFullPerspective()

void flutter::DisplayListBuilder::TransformFullPerspective ( SkScalar  mxx,
SkScalar  mxy,
SkScalar  mxz,
SkScalar  mxt,
SkScalar  myx,
SkScalar  myy,
SkScalar  myz,
SkScalar  myt,
SkScalar  mzx,
SkScalar  mzy,
SkScalar  mzz,
SkScalar  mzt,
SkScalar  mwx,
SkScalar  mwy,
SkScalar  mwz,
SkScalar  mwt 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 777 of file dl_builder.cc.

781 {
782 if ( mxz == 0 &&
783 myz == 0 &&
784 mzx == 0 && mzy == 0 && mzz == 1 && mzt == 0 &&
785 mwx == 0 && mwy == 0 && mwz == 0 && mwt == 1) {
786 Transform2DAffine(mxx, mxy, mxt,
787 myx, myy, myt);
788 } else if (std::isfinite(mxx) && std::isfinite(mxy) &&
789 std::isfinite(mxz) && std::isfinite(mxt) &&
790 std::isfinite(myx) && std::isfinite(myy) &&
791 std::isfinite(myz) && std::isfinite(myt) &&
792 std::isfinite(mzx) && std::isfinite(mzy) &&
793 std::isfinite(mzz) && std::isfinite(mzt) &&
794 std::isfinite(mwx) && std::isfinite(mwy) &&
795 std::isfinite(mwz) && std::isfinite(mwt)) {
796 checkForDeferredSave();
797 Push<TransformFullPerspectiveOp>(0,
798 mxx, mxy, mxz, mxt,
799 myx, myy, myz, myt,
800 mzx, mzy, mzz, mzt,
801 mwx, mwy, mwz, mwt);
802 tracker_.transformFullPerspective(mxx, mxy, mxz, mxt,
803 myx, myy, myz, myt,
804 mzx, mzy, mzz, mzt,
805 mwx, mwy, mwz, mwt);
806 if (layer_tracker_) {
807 layer_tracker_->transformFullPerspective(mxx, mxy, mxz, mxt,
808 myx, myy, myz, myt,
809 mzx, mzy, mzz, mzt,
810 mwx, mwy, mwz, mwt);
811 }
812 }
813}
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt)

◆ transformFullPerspective()

void flutter::DisplayListBuilder::transformFullPerspective ( SkScalar  mxx,
SkScalar  mxy,
SkScalar  mxz,
SkScalar  mxt,
SkScalar  myx,
SkScalar  myy,
SkScalar  myz,
SkScalar  myt,
SkScalar  mzx,
SkScalar  mzy,
SkScalar  mzz,
SkScalar  mzt,
SkScalar  mwx,
SkScalar  mwy,
SkScalar  mwz,
SkScalar  mwt 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 381 of file dl_builder.h.

385 {
386 TransformFullPerspective(mxx, mxy, mxz, mxt,
387 myx, myy, myz, myt,
388 mzx, mzy, mzz, mzt,
389 mwx, mwy, mwz, mwt);
390 }
void TransformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt) override

◆ TransformReset()

void flutter::DisplayListBuilder::TransformReset ( )
overridevirtual

Implements flutter::DlCanvas.

Definition at line 815 of file dl_builder.cc.

815 {
816 checkForDeferredSave();
817 Push<TransformResetOp>(0);
818 if (layer_tracker_) {
819 // The matrices in layer_tracker_ and tracker_ are similar, but
820 // start at a different base transform. The tracker_ potentially
821 // has some number of transform operations on it that prefix the
822 // operations accumulated in layer_tracker_. So we can't set them both
823 // to identity in parallel as they would no longer maintain their
824 // relationship to each other.
825 // Instead we reinterpret this operation as transforming by the
826 // inverse of the current transform. Doing so to tracker_ sets it
827 // to identity so we can avoid the math there, but we must do the
828 // math the long way for layer_tracker_. This becomes:
829 // layer_tracker_.transform(tracker_.inverse());
830 if (!layer_tracker_->inverseTransform(tracker_)) {
831 // If the inverse operation failed then that means that either
832 // the matrix above the current layer was singular, or the matrix
833 // became singular while we were accumulating the current layer.
834 // In either case, we should no longer be accumulating any
835 // contents so we set the layer tracking transform to a singular one.
836 layer_tracker_->setTransform(SkMatrix::Scale(0.0f, 0.0f));
837 }
838 }
839 tracker_.setIdentity();
840}
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition SkMatrix.h:75

◆ transformReset()

void flutter::DisplayListBuilder::transformReset ( )
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 393 of file dl_builder.h.

393{ TransformReset(); }

◆ Translate()

void flutter::DisplayListBuilder::Translate ( SkScalar  tx,
SkScalar  ty 
)
overridevirtual

Implements flutter::DlCanvas.

Definition at line 709 of file dl_builder.cc.

709 {
710 if (std::isfinite(tx) && std::isfinite(ty) && (tx != 0.0 || ty != 0.0)) {
711 checkForDeferredSave();
712 Push<TranslateOp>(0, tx, ty);
713 tracker_.translate(tx, ty);
714 if (layer_tracker_) {
715 layer_tracker_->translate(tx, ty);
716 }
717 }
718}
void translate(SkScalar tx, SkScalar ty)

◆ translate()

void flutter::DisplayListBuilder::translate ( SkScalar  tx,
SkScalar  ty 
)
inlineoverrideprivatevirtual

Implements flutter::DlOpReceiver.

Definition at line 366 of file dl_builder.h.

366{ Translate(tx, ty); }

Friends And Related Symbol Documentation

◆ DisplayListBuilderBenchmarkAccessor

DlOpReceiver & DisplayListBuilderBenchmarkAccessor ( DisplayListBuilder builder)
friend

Definition at line 10 of file dl_builder_benchmarks.cc.

10 {
11 return builder.asReceiver();
12}

◆ DisplayListBuilderTestingAccessor

DlOpReceiver & DisplayListBuilderTestingAccessor ( DisplayListBuilder builder)
friend

Definition at line 33 of file display_list_unittests.cc.

33 {
34 return builder.asReceiver();
35}

◆ DisplayListBuilderTestingAttributes

DlPaint DisplayListBuilderTestingAttributes ( DisplayListBuilder builder)
friend

Definition at line 37 of file display_list_unittests.cc.

37 {
38 return builder.CurrentAttributes();
39}

Member Data Documentation

◆ kMaxCullRect

constexpr SkRect flutter::DisplayListBuilder::kMaxCullRect
staticconstexpr
Initial value:
=
SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F)

Definition at line 32 of file dl_builder.h.


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