5#include "flutter/display_list/display_list.h"
6#include "flutter/display_list/dl_builder.h"
7#include "flutter/display_list/testing/dl_test_snippets.h"
8#include "flutter/shell/common/dl_op_spy.h"
9#include "flutter/testing/testing.h"
21#define ASSERT_DID_DRAW(spy, dl) \
23 ASSERT_TRUE(spy.did_draw()); \
24 ASSERT_TRUE(dl->modifies_transparent_black()); \
27#define ASSERT_NO_DRAW(spy, dl) \
29 ASSERT_FALSE(spy.did_draw()); \
30 ASSERT_FALSE(dl->modifies_transparent_black()); \
42 dl->Dispatch(dl_op_spy);
53 dl->Dispatch(dl_op_spy);
62 dl->Dispatch(dl_op_spy);
71 dl->Dispatch(dl_op_spy);
80 paint.setColorSource(
nullptr);
84 dl->Dispatch(dl_op_spy);
92 paint.setColorSource(color_source_transparent.
shared());
96 dl->Dispatch(dl_op_spy);
104 paint.setColorSource(color_source_transparent.
shared());
108 dl->Dispatch(dl_op_spy);
120 dl->Dispatch(dl_op_spy);
129 dl->Dispatch(dl_op_spy);
138 dl->Dispatch(dl_op_spy);
150 dl->Dispatch(dl_op_spy);
159 dl->Dispatch(dl_op_spy);
171 dl->Dispatch(dl_op_spy);
180 dl->Dispatch(dl_op_spy);
192 dl->Dispatch(dl_op_spy);
201 dl->Dispatch(dl_op_spy);
213 dl->Dispatch(dl_op_spy);
222 dl->Dispatch(dl_op_spy);
234 dl->Dispatch(dl_op_spy);
243 dl->Dispatch(dl_op_spy);
255 dl->Dispatch(dl_op_spy);
264 dl->Dispatch(dl_op_spy);
276 dl->Dispatch(dl_op_spy);
285 dl->Dispatch(dl_op_spy);
299 dl->Dispatch(dl_op_spy);
312 dl->Dispatch(dl_op_spy);
323 dl->Dispatch(dl_op_spy);
335 dl->Dispatch(dl_op_spy);
344 dl->Dispatch(dl_op_spy);
357 dl->Dispatch(dl_op_spy);
367 dl->Dispatch(dl_op_spy);
381 const SkPoint texture_coordinates[] = {
392 texture_coordinates,
colors, 0);
396 dl->Dispatch(dl_op_spy);
407 const SkPoint texture_coordinates[] = {
418 texture_coordinates,
colors, 0);
422 dl->Dispatch(dl_op_spy);
441 dl->Dispatch(dl_op_spy);
457 dl->Dispatch(dl_op_spy);
473 dl->Dispatch(dl_op_spy);
492 dl->Dispatch(dl_op_spy);
511 dl2->Dispatch(dl_op_spy);
527 dl2->Dispatch(dl_op_spy);
544 dl2->Dispatch(dl_op_spy);
561 dl2->Dispatch(dl_op_spy);
570 std::string
string =
"xx";
576 dl->Dispatch(dl_op_spy);
582 std::string
string =
"xx";
588 dl->Dispatch(dl_op_spy);
602 dl->Dispatch(dl_op_spy);
613 dl->Dispatch(dl_op_spy);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static const int points[]
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static SkPath Line(const SkPoint a, const SkPoint b)
static SkRRect MakeRect(const SkRect &r)
static sk_sp< SkTextBlob > MakeFromString(const char *string, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
void DrawPaint(const DlPaint &paint) override
sk_sp< DisplayList > Build()
void DrawDisplayList(const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1) override
@ kPoints
draw each point separately
std::shared_ptr< DlColorSource > shared() const override
static sk_sp< DlImage > Make(const SkImage *image)
bool did_draw()
Returns true if any non transparent content has been drawn.
static std::shared_ptr< DlVertices > Make(DlVertexMode mode, int vertex_count, const SkPoint vertices[], const SkPoint texture_coordinates[], const DlColor colors[], int index_count=0, const uint16_t indices[]=nullptr)
Constructs a DlVector with compact inline storage for all of its required and optional lists of data.
#define ASSERT_DID_DRAW(spy, dl)
#define ASSERT_NO_DRAW(spy, dl)
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
PODArray< SkColor > colors
SkFont CreateTestFontOfSize(SkScalar scalar)
TEST(DisplayListComplexity, EmptyDisplayList)
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
@ kTriangles
The vertices are taken 3 at a time to form a triangle.
@ kStroke
strokes boundary of shapes
@ kSrcOver
r = s + (1-sa)*d
font
Font Metadata and Metrics.
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeWH(float w, float h)
static constexpr DlColor kBlack()
static constexpr DlColor kTransparent()
static constexpr DlColor kRed()
static constexpr DlColor kGreen()