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

Commit c40c1a8

Browse files
authored
Drop --enable-display-list flag, remove associated branched code (#34233)
1 parent 52449a1 commit c40c1a8

35 files changed

+158
-1586
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ FILE: ../../../flutter/flow/layers/performance_overlay_layer_unittests.cc
174174
FILE: ../../../flutter/flow/layers/physical_shape_layer.cc
175175
FILE: ../../../flutter/flow/layers/physical_shape_layer.h
176176
FILE: ../../../flutter/flow/layers/physical_shape_layer_unittests.cc
177-
FILE: ../../../flutter/flow/layers/picture_layer.cc
178-
FILE: ../../../flutter/flow/layers/picture_layer.h
179-
FILE: ../../../flutter/flow/layers/picture_layer_unittests.cc
180177
FILE: ../../../flutter/flow/layers/platform_view_layer.cc
181178
FILE: ../../../flutter/flow/layers/platform_view_layer.h
182179
FILE: ../../../flutter/flow/layers/platform_view_layer_unittests.cc
@@ -1277,7 +1274,6 @@ FILE: ../../../flutter/shell/common/shell_test_platform_view_vulkan.h
12771274
FILE: ../../../flutter/shell/common/shell_unittests.cc
12781275
FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc
12791276
FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h
1280-
FILE: ../../../flutter/shell/common/skp_shader_warmup_unittests.cc
12811277
FILE: ../../../flutter/shell/common/snapshot_surface_producer.h
12821278
FILE: ../../../flutter/shell/common/switches.cc
12831279
FILE: ../../../flutter/shell/common/switches.h

common/settings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ struct Settings {
203203
// not supported on the platform.
204204
bool enable_impeller = false;
205205

206-
// Selects the DisplayList for storage of rendering operations.
207-
bool enable_display_list = true;
208-
209206
// Data set by platform-specific embedders for use in font initialization.
210207
uint32_t font_initialization_data = 0;
211208

display_list/display_list_test_utils.cc

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,16 @@
55
#include "flutter/display_list/display_list_test_utils.h"
66
#include "flutter/display_list/display_list_builder.h"
77

8-
#include "third_party/skia/include/core/SkPicture.h"
9-
#include "third_party/skia/include/core/SkPictureRecorder.h"
10-
118
namespace flutter {
129
namespace testing {
1310

14-
sk_sp<SkPicture> GetSamplePicture() {
15-
SkPictureRecorder recorder;
16-
recorder.beginRecording(SkRect::MakeWH(150, 100));
17-
SkPaint paint;
18-
paint.setColor(SK_ColorRED);
19-
recorder.getRecordingCanvas()->drawRect(SkRect::MakeXYWH(10, 10, 80, 80),
20-
paint);
21-
return recorder.finishRecordingAsPicture();
22-
}
23-
2411
sk_sp<DisplayList> GetSampleDisplayList() {
2512
DisplayListBuilder builder(SkRect::MakeWH(150, 100));
2613
builder.setColor(SK_ColorRED);
2714
builder.drawRect(SkRect::MakeXYWH(10, 10, 80, 80));
2815
return builder.Build();
2916
}
3017

31-
sk_sp<SkPicture> GetSampleNestedPicture() {
32-
SkPictureRecorder recorder;
33-
recorder.beginRecording(SkRect::MakeWH(150, 100));
34-
SkCanvas* canvas = recorder.getRecordingCanvas();
35-
SkPaint paint;
36-
for (int y = 10; y <= 60; y += 10) {
37-
for (int x = 10; x <= 60; x += 10) {
38-
paint.setColor(((x + y) % 20) == 10 ? SK_ColorRED : SK_ColorBLUE);
39-
canvas->drawRect(SkRect::MakeXYWH(x, y, 80, 80), paint);
40-
}
41-
}
42-
SkPictureRecorder outer_recorder;
43-
outer_recorder.beginRecording(SkRect::MakeWH(150, 100));
44-
canvas = outer_recorder.getRecordingCanvas();
45-
canvas->drawPicture(recorder.finishRecordingAsPicture());
46-
return outer_recorder.finishRecordingAsPicture();
47-
}
48-
4918
sk_sp<DisplayList> GetSampleNestedDisplayList() {
5019
DisplayListBuilder builder(SkRect::MakeWH(150, 100));
5120
for (int y = 10; y <= 60; y += 10) {

display_list/display_list_test_utils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
namespace flutter {
1414
namespace testing {
1515

16-
sk_sp<SkPicture> GetSamplePicture();
1716
sk_sp<DisplayList> GetSampleDisplayList();
18-
sk_sp<SkPicture> GetSampleNestedPicture();
19-
sk_sp<DisplayList> GetSampleNestedDisplayList();
2017
sk_sp<DisplayList> GetSampleDisplayList(int ops);
18+
sk_sp<DisplayList> GetSampleNestedDisplayList();
2119

2220
} // namespace testing
2321
} // namespace flutter

flow/BUILD.gn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ source_set("flow") {
4949
"layers/performance_overlay_layer.h",
5050
"layers/physical_shape_layer.cc",
5151
"layers/physical_shape_layer.h",
52-
"layers/picture_layer.cc",
53-
"layers/picture_layer.h",
5452
"layers/platform_view_layer.cc",
5553
"layers/platform_view_layer.h",
5654
"layers/shader_mask_layer.cc",
@@ -154,7 +152,6 @@ if (enable_unittests) {
154152
"layers/opacity_layer_unittests.cc",
155153
"layers/performance_overlay_layer_unittests.cc",
156154
"layers/physical_shape_layer_unittests.cc",
157-
"layers/picture_layer_unittests.cc",
158155
"layers/platform_view_layer_unittests.cc",
159156
"layers/shader_mask_layer_unittests.cc",
160157
"layers/texture_layer_unittests.cc",

flow/diff_context_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ namespace testing {
99

1010
TEST_F(DiffContextTest, ClipAlignment) {
1111
MockLayerTree t1;
12-
t1.root()->Add(
13-
CreatePictureLayer(CreatePicture(SkRect::MakeLTRB(30, 30, 50, 50), 1)));
12+
t1.root()->Add(CreateDisplayListLayer(
13+
CreateDisplayList(SkRect::MakeLTRB(30, 30, 50, 50), 1)));
1414
auto damage = DiffLayerTree(t1, MockLayerTree(), SkIRect::MakeEmpty(), 0, 0);
1515
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(30, 30, 50, 50));
1616
EXPECT_EQ(damage.buffer_damage, SkIRect::MakeLTRB(30, 30, 50, 50));

flow/layers/container_layer_unittests.cc

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,16 @@ using ContainerLayerDiffTest = DiffContextTest;
251251

252252
// Insert PictureLayer amongst container layers
253253
TEST_F(ContainerLayerDiffTest, PictureLayerInsertion) {
254-
auto pic1 = CreatePicture(SkRect::MakeLTRB(0, 0, 50, 50), 1);
255-
auto pic2 = CreatePicture(SkRect::MakeLTRB(100, 0, 150, 50), 1);
256-
auto pic3 = CreatePicture(SkRect::MakeLTRB(200, 0, 250, 50), 1);
254+
auto pic1 = CreateDisplayList(SkRect::MakeLTRB(0, 0, 50, 50), 1);
255+
auto pic2 = CreateDisplayList(SkRect::MakeLTRB(100, 0, 150, 50), 1);
256+
auto pic3 = CreateDisplayList(SkRect::MakeLTRB(200, 0, 250, 50), 1);
257257

258258
MockLayerTree t1;
259259

260-
auto t1_c1 = CreateContainerLayer(CreatePictureLayer(pic1));
260+
auto t1_c1 = CreateContainerLayer(CreateDisplayListLayer(pic1));
261261
t1.root()->Add(t1_c1);
262262

263-
auto t1_c2 = CreateContainerLayer(CreatePictureLayer(pic2));
263+
auto t1_c2 = CreateContainerLayer(CreateDisplayListLayer(pic2));
264264
t1.root()->Add(t1_c2);
265265

266266
auto damage = DiffLayerTree(t1, MockLayerTree());
@@ -269,13 +269,13 @@ TEST_F(ContainerLayerDiffTest, PictureLayerInsertion) {
269269
// Add in the middle
270270

271271
MockLayerTree t2;
272-
auto t2_c1 = CreateContainerLayer(CreatePictureLayer(pic1));
272+
auto t2_c1 = CreateContainerLayer(CreateDisplayListLayer(pic1));
273273
t2_c1->AssignOldLayer(t1_c1.get());
274274
t2.root()->Add(t2_c1);
275275

276-
t2.root()->Add(CreatePictureLayer(pic3));
276+
t2.root()->Add(CreateDisplayListLayer(pic3));
277277

278-
auto t2_c2 = CreateContainerLayer(CreatePictureLayer(pic2));
278+
auto t2_c2 = CreateContainerLayer(CreateDisplayListLayer(pic2));
279279
t2_c2->AssignOldLayer(t1_c2.get());
280280
t2.root()->Add(t2_c2);
281281

@@ -285,7 +285,7 @@ TEST_F(ContainerLayerDiffTest, PictureLayerInsertion) {
285285
// Add in the beginning
286286

287287
t2 = MockLayerTree();
288-
t2.root()->Add(CreatePictureLayer(pic3));
288+
t2.root()->Add(CreateDisplayListLayer(pic3));
289289
t2.root()->Add(t2_c1);
290290
t2.root()->Add(t2_c2);
291291
damage = DiffLayerTree(t2, t1);
@@ -296,44 +296,44 @@ TEST_F(ContainerLayerDiffTest, PictureLayerInsertion) {
296296
t2 = MockLayerTree();
297297
t2.root()->Add(t2_c1);
298298
t2.root()->Add(t2_c2);
299-
t2.root()->Add(CreatePictureLayer(pic3));
299+
t2.root()->Add(CreateDisplayListLayer(pic3));
300300
damage = DiffLayerTree(t2, t1);
301301
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(200, 0, 250, 50));
302302
}
303303

304304
// Insert picture layer amongst other picture layers
305305
TEST_F(ContainerLayerDiffTest, PictureInsertion) {
306-
auto pic1 = CreatePicture(SkRect::MakeLTRB(0, 0, 50, 50), 1);
307-
auto pic2 = CreatePicture(SkRect::MakeLTRB(100, 0, 150, 50), 1);
308-
auto pic3 = CreatePicture(SkRect::MakeLTRB(200, 0, 250, 50), 1);
306+
auto pic1 = CreateDisplayList(SkRect::MakeLTRB(0, 0, 50, 50), 1);
307+
auto pic2 = CreateDisplayList(SkRect::MakeLTRB(100, 0, 150, 50), 1);
308+
auto pic3 = CreateDisplayList(SkRect::MakeLTRB(200, 0, 250, 50), 1);
309309

310310
MockLayerTree t1;
311-
t1.root()->Add(CreatePictureLayer(pic1));
312-
t1.root()->Add(CreatePictureLayer(pic2));
311+
t1.root()->Add(CreateDisplayListLayer(pic1));
312+
t1.root()->Add(CreateDisplayListLayer(pic2));
313313

314314
auto damage = DiffLayerTree(t1, MockLayerTree());
315315
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(0, 0, 150, 50));
316316

317317
MockLayerTree t2;
318-
t2.root()->Add(CreatePictureLayer(pic3));
319-
t2.root()->Add(CreatePictureLayer(pic1));
320-
t2.root()->Add(CreatePictureLayer(pic2));
318+
t2.root()->Add(CreateDisplayListLayer(pic3));
319+
t2.root()->Add(CreateDisplayListLayer(pic1));
320+
t2.root()->Add(CreateDisplayListLayer(pic2));
321321

322322
damage = DiffLayerTree(t2, t1);
323323
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(200, 0, 250, 50));
324324

325325
MockLayerTree t3;
326-
t3.root()->Add(CreatePictureLayer(pic1));
327-
t3.root()->Add(CreatePictureLayer(pic3));
328-
t3.root()->Add(CreatePictureLayer(pic2));
326+
t3.root()->Add(CreateDisplayListLayer(pic1));
327+
t3.root()->Add(CreateDisplayListLayer(pic3));
328+
t3.root()->Add(CreateDisplayListLayer(pic2));
329329

330330
damage = DiffLayerTree(t3, t1);
331331
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(200, 0, 250, 50));
332332

333333
MockLayerTree t4;
334-
t4.root()->Add(CreatePictureLayer(pic1));
335-
t4.root()->Add(CreatePictureLayer(pic2));
336-
t4.root()->Add(CreatePictureLayer(pic3));
334+
t4.root()->Add(CreateDisplayListLayer(pic1));
335+
t4.root()->Add(CreateDisplayListLayer(pic2));
336+
t4.root()->Add(CreateDisplayListLayer(pic3));
337337

338338
damage = DiffLayerTree(t4, t1);
339339
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(200, 0, 250, 50));

flow/layers/layer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ struct PrerollContext {
102102
};
103103

104104
class ContainerLayer;
105-
class PictureLayer;
106105
class DisplayListLayer;
107106
class PerformanceOverlayLayer;
108107
class TextureLayer;
@@ -360,7 +359,6 @@ class Layer {
360359
uint64_t unique_id() const { return unique_id_; }
361360

362361
virtual const ContainerLayer* as_container_layer() const { return nullptr; }
363-
virtual const PictureLayer* as_picture_layer() const { return nullptr; }
364362
virtual const DisplayListLayer* as_display_list_layer() const {
365363
return nullptr;
366364
}

flow/layers/opacity_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class OpacityLayer : public ContainerLayer {
2121
// By default, that offset is always zero, and all the offsets are handled by
2222
// some parent TransformLayers. But we allow the offset to be non-zero for
2323
// backward compatibility. If it's non-zero, the old behavior is to propage
24-
// that offset to all the leaf layers (e.g., PictureLayer). That will make
24+
// that offset to all the leaf layers (e.g., DisplayListLayer). That will make
2525
// the retained rendering inefficient as a small offset change could propagate
2626
// to many leaf layers. Therefore we try to capture that offset here to stop
2727
// the propagation as repainting the OpacityLayer is expensive.

flow/layers/opacity_layer_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ TEST_F(OpacityLayerTest, OpacityInheritanceNestedWithIncompatibleChild) {
606606
using OpacityLayerDiffTest = DiffContextTest;
607607

608608
TEST_F(OpacityLayerDiffTest, FractionalTranslation) {
609-
auto picture =
610-
CreatePictureLayer(CreatePicture(SkRect::MakeLTRB(10, 10, 60, 60), 1));
609+
auto picture = CreateDisplayListLayer(
610+
CreateDisplayList(SkRect::MakeLTRB(10, 10, 60, 60), 1));
611611
auto layer = CreateOpacityLater({picture}, 128, SkPoint::Make(0.5, 0.5));
612612

613613
MockLayerTree tree1;

0 commit comments

Comments
 (0)