Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1c267a6

Browse files
author
Jonah Williams
authored
Merge branch 'main' into draw_circles
2 parents b23b616 + 8dbffe5 commit 1c267a6

19 files changed

Lines changed: 896 additions & 563 deletions

.ci.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ targets:
140140
timeout: 60
141141

142142
- name: Linux Fuchsia
143-
bringup: true
144143
recipe: engine/engine
145144
properties:
146145
add_recipes_cq: "true"
@@ -257,6 +256,7 @@ targets:
257256
timeout: 90
258257

259258
- name: Linux linux_fuchsia
259+
bringup: true
260260
recipe: engine_v2/engine_v2
261261
timeout: 60
262262
properties:
@@ -376,6 +376,13 @@ targets:
376376
properties:
377377
config_name: mac_android_aot_engine
378378

379+
- name: Mac mac_clang_tidy
380+
bringup: true
381+
recipe: engine_v2/engine_v2
382+
timeout: 60
383+
properties:
384+
config_name: mac_clang_tidy
385+
379386
- name: Mac mac_host_engine
380387
recipe: engine_v2/engine_v2
381388
timeout: 60

ci/builders/mac_clang_tidy.json

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"builds": [
3+
{
4+
"drone_dimensions": [
5+
"device_type=none",
6+
"os=Mac-12",
7+
"cpu=arm64"
8+
],
9+
"gclient_variables": {
10+
"download_android_deps": false
11+
},
12+
"gn": [
13+
"--runtime-mode",
14+
"debug",
15+
"--prebuilt-dart-sdk",
16+
"--no-lto",
17+
"--force-mac-arm64"
18+
],
19+
"name": "host_debug",
20+
"ninja": {
21+
"config": "host_debug"
22+
}
23+
},
24+
{
25+
"drone_dimensions": [
26+
"device_type=none",
27+
"os=Mac-12",
28+
"cpu=arm64"
29+
],
30+
"gclient_variables": {
31+
"download_android_deps": false
32+
},
33+
"gn": [
34+
"--ios",
35+
"--runtime-mode",
36+
"debug",
37+
"--simulator",
38+
"--no-lto",
39+
"--force-mac-arm64"
40+
],
41+
"name": "ios_debug_sim",
42+
"ninja": {
43+
"config": "ios_debug_sim"
44+
}
45+
}
46+
],
47+
"tests": [
48+
{
49+
"name": "test: lint host_debug",
50+
"recipe": "engine_v2/tester_engine",
51+
"drone_dimensions": [
52+
"device_type=none",
53+
"os=Mac",
54+
"cpu=arm64"
55+
],
56+
"gclient_variables": {
57+
"download_android_deps": false
58+
},
59+
"dependencies": [
60+
"host_debug",
61+
"ios_debug_sim"
62+
],
63+
"tasks": [
64+
{
65+
"name": "test: lint host_debug",
66+
"parameters": [
67+
"--variant",
68+
"host_debug",
69+
"--lint-all",
70+
"--shard-id=1",
71+
"--shard-variants=ios_debug_sim"
72+
],
73+
"script": "flutter/ci/lint.sh"
74+
}
75+
]
76+
},
77+
{
78+
"name": "test: lint ios_debug_sim",
79+
"recipe": "engine_v2/tester_engine",
80+
"drone_dimensions": [
81+
"device_type=none",
82+
"os=Mac",
83+
"cpu=arm64"
84+
],
85+
"gclient_variables": {
86+
"download_android_deps": false
87+
},
88+
"dependencies": [
89+
"host_debug",
90+
"ios_debug_sim"
91+
],
92+
"tasks": [
93+
{
94+
"name": "test: lint ios_debug_sim",
95+
"parameters": [
96+
"--variant",
97+
"ios_debug_sim",
98+
"--lint-all",
99+
"--shard-id=0",
100+
"--shard-variants=host_debug"
101+
],
102+
"script": "flutter/ci/lint.sh"
103+
}
104+
]
105+
}
106+
]
107+
}

display_list/display_list_unittests.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ class DisplayListTestBase : public BaseT {
9292
};
9393
using DisplayListTest = DisplayListTestBase<::testing::Test>;
9494

95+
TEST_F(DisplayListTest, EmptyBuild) {
96+
DisplayListBuilder builder;
97+
auto dl = builder.Build();
98+
EXPECT_EQ(dl->op_count(), 0u);
99+
EXPECT_EQ(dl->bytes(), sizeof(DisplayList));
100+
}
101+
102+
TEST_F(DisplayListTest, EmptyRebuild) {
103+
DisplayListBuilder builder;
104+
auto dl1 = builder.Build();
105+
auto dl2 = builder.Build();
106+
auto dl3 = builder.Build();
107+
ASSERT_TRUE(dl1->Equals(dl2));
108+
ASSERT_TRUE(dl2->Equals(dl3));
109+
}
110+
95111
TEST_F(DisplayListTest, BuilderCanBeReused) {
96112
DisplayListBuilder builder(kTestBounds);
97113
builder.DrawRect(kTestBounds, DlPaint());

display_list/dl_builder.cc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -578,15 +578,18 @@ void DisplayListBuilder::Transform2DAffine(
578578
SkScalar myx, SkScalar myy, SkScalar myt) {
579579
if (SkScalarsAreFinite(mxx, myx) &&
580580
SkScalarsAreFinite(mxy, myy) &&
581-
SkScalarsAreFinite(mxt, myt) &&
582-
!(mxx == 1 && mxy == 0 && mxt == 0 &&
583-
myx == 0 && myy == 1 && myt == 0)) {
584-
checkForDeferredSave();
585-
Push<Transform2DAffineOp>(0, 1,
586-
mxx, mxy, mxt,
587-
myx, myy, myt);
588-
tracker_.transform2DAffine(mxx, mxy, mxt,
589-
myx, myy, myt);
581+
SkScalarsAreFinite(mxt, myt)) {
582+
if (mxx == 1 && mxy == 0 &&
583+
myx == 0 && myy == 1) {
584+
Translate(mxt, myt);
585+
} else {
586+
checkForDeferredSave();
587+
Push<Transform2DAffineOp>(0, 1,
588+
mxx, mxy, mxt,
589+
myx, myy, myt);
590+
tracker_.transform2DAffine(mxx, mxy, mxt,
591+
myx, myy, myt);
592+
}
590593
}
591594
}
592595
// full 4x4 transform in row major order

display_list/dl_builder.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,17 @@ class DisplayListBuilder final : public virtual DlCanvas,
113113
SkMatrix GetTransform() const override { return tracker_.matrix_3x3(); }
114114

115115
// |DlCanvas|
116-
void ClipRect(const SkRect& rect, ClipOp clip_op, bool is_aa) override;
116+
void ClipRect(const SkRect& rect,
117+
ClipOp clip_op = ClipOp::kIntersect,
118+
bool is_aa = false) override;
117119
// |DlCanvas|
118-
void ClipRRect(const SkRRect& rrect, ClipOp clip_op, bool is_aa) override;
120+
void ClipRRect(const SkRRect& rrect,
121+
ClipOp clip_op = ClipOp::kIntersect,
122+
bool is_aa = false) override;
119123
// |DlCanvas|
120-
void ClipPath(const SkPath& path, ClipOp clip_op, bool is_aa) override;
124+
void ClipPath(const SkPath& path,
125+
ClipOp clip_op = ClipOp::kIntersect,
126+
bool is_aa = false) override;
121127

122128
/// Conservative estimate of the bounds of all outstanding clip operations
123129
/// measured in the coordinate space within which this DisplayList will

0 commit comments

Comments
 (0)