5#include "flutter/testing/mock_canvas.h"
7#include "flutter/fml/logging.h"
8#include "flutter/testing/display_list_testing.h"
27 EXPECT_EQ(current_layer_, 0);
40 draw_calls_.emplace_back(
54 backdrop ? backdrop->shared() :
nullptr,
55 current_layer_ + 1}});
63 draw_calls_.emplace_back(
92 draw_calls_.emplace_back(
103 draw_calls_.emplace_back(
164 const std::shared_ptr<impeller::TextFrame>& text_frame,
182 bool transparent_occluder,
194 draw_calls_.emplace_back(
198 draw_calls_.emplace_back(
206 draw_calls_.emplace_back(
212 draw_calls_.emplace_back(
219 draw_calls_.emplace_back(
226 draw_calls_.emplace_back(
335 return os <<
"XY: " << r.
fX <<
", " << r.
fY;
339 return os <<
"LTRB: " << r.
fLeft <<
", " << r.
fTop <<
", " << r.
fRight <<
", "
349 return os <<
"Valid: " << r.
isValid()
350 <<
", FillType: " <<
static_cast<int>(r.
getFillType())
356 os << m.rc(0, 0) <<
", " << m.rc(0, 1) <<
", " << m.rc(0, 2) <<
", "
357 << m.rc(0, 3) << std::endl;
358 os << m.rc(1, 0) <<
", " << m.rc(1, 1) <<
", " << m.rc(1, 2) <<
", "
359 << m.rc(1, 3) << std::endl;
360 os << m.rc(2, 0) <<
", " << m.rc(2, 1) <<
", " << m.rc(2, 2) <<
", "
361 << m.rc(2, 3) << std::endl;
362 os << m.rc(3, 0) <<
", " << m.rc(3, 1) <<
", " << m.rc(3, 2) <<
", "
368 return a.save_to_layer ==
b.save_to_layer;
372 return os <<
data.save_to_layer;
377 return a.save_bounds ==
b.save_bounds &&
a.restore_paint ==
b.restore_paint &&
378 Equals(
a.backdrop_filter,
b.backdrop_filter) &&
379 a.save_to_layer ==
b.save_to_layer;
384 return os <<
data.save_bounds <<
" " <<
data.restore_paint <<
" "
385 <<
data.backdrop_filter <<
" " <<
data.save_to_layer;
390 return a.restore_to_layer ==
b.restore_to_layer;
395 return os <<
data.restore_to_layer;
400 return a.matrix ==
b.matrix;
405 return os <<
data.matrix;
410 return a.matrix ==
b.matrix;
415 return os <<
data.matrix;
420 return a.rect ==
b.rect &&
a.paint ==
b.paint;
425 return os <<
data.rect <<
" " <<
data.paint;
430 return a.path ==
b.path &&
a.paint ==
b.paint;
435 return os <<
data.path <<
" " <<
data.paint;
440 return a.serialized_text->equals(
b.serialized_text.get()) &&
441 a.paint ==
b.paint &&
a.offset ==
b.offset;
446 return os <<
data.serialized_text <<
" " <<
data.paint <<
" " <<
data.offset;
451 return a.image ==
b.image &&
a.
x ==
b.x &&
a.
y ==
b.y &&
452 a.options ==
b.options &&
a.paint ==
b.paint;
457 return os <<
data.image <<
" " <<
data.
x <<
" " <<
data.y <<
" "
458 <<
data.options <<
" " <<
data.paint;
463 return a.image ==
b.image &&
a.
x ==
b.x &&
a.
y ==
b.y &&
464 a.options ==
b.options;
469 return os <<
data.image <<
" " <<
data.
x <<
" " <<
data.y <<
" "
475 return a.display_list->Equals(
b.display_list) &&
a.opacity ==
b.opacity;
480 auto dl =
data.display_list;
481 return os <<
"[" << dl->unique_id() <<
" " << dl->op_count() <<
" "
482 << dl->bytes() <<
"] " <<
data.opacity;
487 return a.path ==
b.path &&
a.color ==
b.color &&
a.elevation ==
b.elevation &&
488 a.transparent_occluder ==
b.transparent_occluder &&
a.dpr ==
b.dpr;
493 return os <<
data.path <<
" " <<
data.color <<
" " <<
data.elevation <<
" "
494 <<
data.transparent_occluder <<
" " <<
data.dpr;
499 return a.rect ==
b.rect &&
a.clip_op ==
b.clip_op &&
a.style ==
b.style;
510 return os <<
data.rect <<
" " <<
data.clip_op <<
" " <<
data.style;
515 return a.rrect ==
b.rrect &&
a.clip_op ==
b.clip_op &&
a.style ==
b.style;
520 return os <<
data.rrect <<
" " <<
data.clip_op <<
" " <<
data.style;
525 return a.path ==
b.path &&
a.clip_op ==
b.clip_op &&
a.style ==
b.style;
530 return os <<
data.path <<
" " <<
data.clip_op <<
" " <<
data.style;
535 std::visit([&os](
auto&
d) { os <<
d; },
data);
540 return a.layer ==
b.layer &&
a.data ==
b.data;
544 return os <<
"[Layer: " <<
draw.layer <<
", Data: " <<
draw.data <<
"]";
549 return a.paint ==
b.paint;
554 return os <<
data.paint;
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)
static SkScalar center(float pos0, float pos1)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
static sk_sp< SkData > MakeUninitialized(size_t length)
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
static SkM44 Scale(SkScalar x, SkScalar y, SkScalar z=1)
static SkMatrix RotateDeg(SkScalar deg)
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static SkMatrix Skew(SkScalar kx, SkScalar ky)
SkPathFillType getFillType() const
const SkRect & getBounds() const
const SkRect & rect() const
void clipRect(const DlRect &rect, ClipOp op, bool is_aa)
SkRect local_cull_rect() const
SkRect device_cull_rect() const
void clipPath(const SkPath &path, ClipOp op, bool is_aa)
void transform(const DlMatrix &matrix)
void clipRRect(const SkRRect &rrect, ClipOp op, bool is_aa)
void setTransform(const DlMatrix &matrix)
SkMatrix matrix_3x3() const
SkRect base_device_cull_rect() const
bool content_culled(const SkRect &content_bounds) const
Holds all of the data (both required and optional) for a DisplayList drawVertices call.
SkM44 GetTransformFullPerspective() const 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 Translate(SkScalar tx, SkScalar ty) override
void DrawShadow(const SkPath &path, const DlColor color, const SkScalar elevation, bool transparent_occluder, SkScalar dpr) override
void SetTransform(const SkMatrix *matrix) override
void DrawCircle(const SkPoint ¢er, SkScalar radius, const DlPaint &paint) override
SkMatrix GetTransform() const override
void Transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt) override
void DrawTextBlob(const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const DlPaint &paint) override
SkRect GetLocalClipBounds() const override
SkRect GetDestinationClipBounds() const override
SkISize GetBaseLayerSize() const override
void DrawImageNine(const sk_sp< DlImage > &image, const SkIRect ¢er, const SkRect &dst, DlFilterMode filter, const DlPaint *paint=nullptr) override
SkImageInfo GetImageInfo() const override
void ClipRRect(const SkRRect &rrect, ClipOp clip_op, bool is_aa) override
void Transform(const SkMatrix *matrix) override
void DrawPaint(const DlPaint &paint) override
void DrawLine(const SkPoint &p0, const SkPoint &p1, const DlPaint &paint) override
void DrawImage(const sk_sp< DlImage > &image, const SkPoint point, DlImageSampling sampling, const DlPaint *paint=nullptr) override
void Scale(SkScalar sx, SkScalar sy) override
void Rotate(SkScalar degrees) override
void ClipPath(const SkPath &path, ClipOp clip_op, bool is_aa) override
void ClipRect(const SkRect &rect, ClipOp clip_op, bool is_aa) 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 DrawColor(DlColor color, DlBlendMode mode) override
void TransformReset() override
void DrawVertices(const DlVertices *vertices, DlBlendMode mode, const DlPaint &paint) override
std::variant< SaveData, SaveLayerData, RestoreData, ConcatMatrixData, SetMatrixData, DrawRectData, DrawPathData, DrawTextData, DrawImageDataNoPaint, DrawImageData, DrawDisplayListData, DrawShadowData, ClipRectData, ClipRRectData, ClipPathData, DrawPaintData > DrawCallData
void DrawRect(const SkRect &rect, const DlPaint &paint) override
void DrawPath(const SkPath &path, const DlPaint &paint) override
void DrawRRect(const SkRRect &rrect, const DlPaint &paint) override
void DrawPoints(PointMode mode, uint32_t count, const SkPoint pts[], const DlPaint &paint) override
void DrawDisplayList(const sk_sp< DisplayList > display_list, SkScalar opacity) 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 DrawTextFrame(const std::shared_ptr< impeller::TextFrame > &text_frame, SkScalar x, SkScalar y, const DlPaint &paint) override
void SaveLayer(const SkRect *bounds, const DlPaint *paint=nullptr, const DlImageFilter *backdrop=nullptr) override
void Skew(SkScalar sx, SkScalar sy) override
void DrawDRRect(const SkRRect &outer, const SkRRect &inner, const DlPaint &paint) override
bool QuickReject(const SkRect &bounds) const override
void DrawOval(const SkRect &bounds, const DlPaint &paint) override
void DrawArc(const SkRect &bounds, SkScalar start, SkScalar sweep, bool useCenter, const DlPaint &paint) override
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
#define FML_DCHECK(condition)
std::ostream & operator<<(std::ostream &os, const DisplayList &display_list)
bool operator==(const CGRect &lhs, const CGRect &rhs)
bool Equals(const T *a, const T *b)
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
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
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
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
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeUnknown()
static constexpr SkPoint Make(float x, float y)
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
void roundOut(SkIRect *dst) const
SkScalar fTop
smaller y-axis bounds