Skip to content

Commit

Permalink
Drop --enable-display-list flag, remove associated branched code (flu…
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield authored Jun 23, 2022
1 parent 52449a1 commit c40c1a8
Show file tree
Hide file tree
Showing 35 changed files with 158 additions and 1,586 deletions.
4 changes: 0 additions & 4 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ FILE: ../../../flutter/flow/layers/performance_overlay_layer_unittests.cc
FILE: ../../../flutter/flow/layers/physical_shape_layer.cc
FILE: ../../../flutter/flow/layers/physical_shape_layer.h
FILE: ../../../flutter/flow/layers/physical_shape_layer_unittests.cc
FILE: ../../../flutter/flow/layers/picture_layer.cc
FILE: ../../../flutter/flow/layers/picture_layer.h
FILE: ../../../flutter/flow/layers/picture_layer_unittests.cc
FILE: ../../../flutter/flow/layers/platform_view_layer.cc
FILE: ../../../flutter/flow/layers/platform_view_layer.h
FILE: ../../../flutter/flow/layers/platform_view_layer_unittests.cc
Expand Down Expand Up @@ -1277,7 +1274,6 @@ FILE: ../../../flutter/shell/common/shell_test_platform_view_vulkan.h
FILE: ../../../flutter/shell/common/shell_unittests.cc
FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc
FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h
FILE: ../../../flutter/shell/common/skp_shader_warmup_unittests.cc
FILE: ../../../flutter/shell/common/snapshot_surface_producer.h
FILE: ../../../flutter/shell/common/switches.cc
FILE: ../../../flutter/shell/common/switches.h
Expand Down
3 changes: 0 additions & 3 deletions common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ struct Settings {
// not supported on the platform.
bool enable_impeller = false;

// Selects the DisplayList for storage of rendering operations.
bool enable_display_list = true;

// Data set by platform-specific embedders for use in font initialization.
uint32_t font_initialization_data = 0;

Expand Down
31 changes: 0 additions & 31 deletions display_list/display_list_test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,16 @@
#include "flutter/display_list/display_list_test_utils.h"
#include "flutter/display_list/display_list_builder.h"

#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"

namespace flutter {
namespace testing {

sk_sp<SkPicture> GetSamplePicture() {
SkPictureRecorder recorder;
recorder.beginRecording(SkRect::MakeWH(150, 100));
SkPaint paint;
paint.setColor(SK_ColorRED);
recorder.getRecordingCanvas()->drawRect(SkRect::MakeXYWH(10, 10, 80, 80),
paint);
return recorder.finishRecordingAsPicture();
}

sk_sp<DisplayList> GetSampleDisplayList() {
DisplayListBuilder builder(SkRect::MakeWH(150, 100));
builder.setColor(SK_ColorRED);
builder.drawRect(SkRect::MakeXYWH(10, 10, 80, 80));
return builder.Build();
}

sk_sp<SkPicture> GetSampleNestedPicture() {
SkPictureRecorder recorder;
recorder.beginRecording(SkRect::MakeWH(150, 100));
SkCanvas* canvas = recorder.getRecordingCanvas();
SkPaint paint;
for (int y = 10; y <= 60; y += 10) {
for (int x = 10; x <= 60; x += 10) {
paint.setColor(((x + y) % 20) == 10 ? SK_ColorRED : SK_ColorBLUE);
canvas->drawRect(SkRect::MakeXYWH(x, y, 80, 80), paint);
}
}
SkPictureRecorder outer_recorder;
outer_recorder.beginRecording(SkRect::MakeWH(150, 100));
canvas = outer_recorder.getRecordingCanvas();
canvas->drawPicture(recorder.finishRecordingAsPicture());
return outer_recorder.finishRecordingAsPicture();
}

sk_sp<DisplayList> GetSampleNestedDisplayList() {
DisplayListBuilder builder(SkRect::MakeWH(150, 100));
for (int y = 10; y <= 60; y += 10) {
Expand Down
4 changes: 1 addition & 3 deletions display_list/display_list_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
namespace flutter {
namespace testing {

sk_sp<SkPicture> GetSamplePicture();
sk_sp<DisplayList> GetSampleDisplayList();
sk_sp<SkPicture> GetSampleNestedPicture();
sk_sp<DisplayList> GetSampleNestedDisplayList();
sk_sp<DisplayList> GetSampleDisplayList(int ops);
sk_sp<DisplayList> GetSampleNestedDisplayList();

} // namespace testing
} // namespace flutter
Expand Down
3 changes: 0 additions & 3 deletions flow/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ source_set("flow") {
"layers/performance_overlay_layer.h",
"layers/physical_shape_layer.cc",
"layers/physical_shape_layer.h",
"layers/picture_layer.cc",
"layers/picture_layer.h",
"layers/platform_view_layer.cc",
"layers/platform_view_layer.h",
"layers/shader_mask_layer.cc",
Expand Down Expand Up @@ -154,7 +152,6 @@ if (enable_unittests) {
"layers/opacity_layer_unittests.cc",
"layers/performance_overlay_layer_unittests.cc",
"layers/physical_shape_layer_unittests.cc",
"layers/picture_layer_unittests.cc",
"layers/platform_view_layer_unittests.cc",
"layers/shader_mask_layer_unittests.cc",
"layers/texture_layer_unittests.cc",
Expand Down
4 changes: 2 additions & 2 deletions flow/diff_context_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace testing {

TEST_F(DiffContextTest, ClipAlignment) {
MockLayerTree t1;
t1.root()->Add(
CreatePictureLayer(CreatePicture(SkRect::MakeLTRB(30, 30, 50, 50), 1)));
t1.root()->Add(CreateDisplayListLayer(
CreateDisplayList(SkRect::MakeLTRB(30, 30, 50, 50), 1)));
auto damage = DiffLayerTree(t1, MockLayerTree(), SkIRect::MakeEmpty(), 0, 0);
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(30, 30, 50, 50));
EXPECT_EQ(damage.buffer_damage, SkIRect::MakeLTRB(30, 30, 50, 50));
Expand Down
48 changes: 24 additions & 24 deletions flow/layers/container_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,16 @@ using ContainerLayerDiffTest = DiffContextTest;

// Insert PictureLayer amongst container layers
TEST_F(ContainerLayerDiffTest, PictureLayerInsertion) {
auto pic1 = CreatePicture(SkRect::MakeLTRB(0, 0, 50, 50), 1);
auto pic2 = CreatePicture(SkRect::MakeLTRB(100, 0, 150, 50), 1);
auto pic3 = CreatePicture(SkRect::MakeLTRB(200, 0, 250, 50), 1);
auto pic1 = CreateDisplayList(SkRect::MakeLTRB(0, 0, 50, 50), 1);
auto pic2 = CreateDisplayList(SkRect::MakeLTRB(100, 0, 150, 50), 1);
auto pic3 = CreateDisplayList(SkRect::MakeLTRB(200, 0, 250, 50), 1);

MockLayerTree t1;

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

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

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

MockLayerTree t2;
auto t2_c1 = CreateContainerLayer(CreatePictureLayer(pic1));
auto t2_c1 = CreateContainerLayer(CreateDisplayListLayer(pic1));
t2_c1->AssignOldLayer(t1_c1.get());
t2.root()->Add(t2_c1);

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

auto t2_c2 = CreateContainerLayer(CreatePictureLayer(pic2));
auto t2_c2 = CreateContainerLayer(CreateDisplayListLayer(pic2));
t2_c2->AssignOldLayer(t1_c2.get());
t2.root()->Add(t2_c2);

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

t2 = MockLayerTree();
t2.root()->Add(CreatePictureLayer(pic3));
t2.root()->Add(CreateDisplayListLayer(pic3));
t2.root()->Add(t2_c1);
t2.root()->Add(t2_c2);
damage = DiffLayerTree(t2, t1);
Expand All @@ -296,44 +296,44 @@ TEST_F(ContainerLayerDiffTest, PictureLayerInsertion) {
t2 = MockLayerTree();
t2.root()->Add(t2_c1);
t2.root()->Add(t2_c2);
t2.root()->Add(CreatePictureLayer(pic3));
t2.root()->Add(CreateDisplayListLayer(pic3));
damage = DiffLayerTree(t2, t1);
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(200, 0, 250, 50));
}

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

MockLayerTree t1;
t1.root()->Add(CreatePictureLayer(pic1));
t1.root()->Add(CreatePictureLayer(pic2));
t1.root()->Add(CreateDisplayListLayer(pic1));
t1.root()->Add(CreateDisplayListLayer(pic2));

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

MockLayerTree t2;
t2.root()->Add(CreatePictureLayer(pic3));
t2.root()->Add(CreatePictureLayer(pic1));
t2.root()->Add(CreatePictureLayer(pic2));
t2.root()->Add(CreateDisplayListLayer(pic3));
t2.root()->Add(CreateDisplayListLayer(pic1));
t2.root()->Add(CreateDisplayListLayer(pic2));

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

MockLayerTree t3;
t3.root()->Add(CreatePictureLayer(pic1));
t3.root()->Add(CreatePictureLayer(pic3));
t3.root()->Add(CreatePictureLayer(pic2));
t3.root()->Add(CreateDisplayListLayer(pic1));
t3.root()->Add(CreateDisplayListLayer(pic3));
t3.root()->Add(CreateDisplayListLayer(pic2));

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

MockLayerTree t4;
t4.root()->Add(CreatePictureLayer(pic1));
t4.root()->Add(CreatePictureLayer(pic2));
t4.root()->Add(CreatePictureLayer(pic3));
t4.root()->Add(CreateDisplayListLayer(pic1));
t4.root()->Add(CreateDisplayListLayer(pic2));
t4.root()->Add(CreateDisplayListLayer(pic3));

damage = DiffLayerTree(t4, t1);
EXPECT_EQ(damage.frame_damage, SkIRect::MakeLTRB(200, 0, 250, 50));
Expand Down
2 changes: 0 additions & 2 deletions flow/layers/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ struct PrerollContext {
};

class ContainerLayer;
class PictureLayer;
class DisplayListLayer;
class PerformanceOverlayLayer;
class TextureLayer;
Expand Down Expand Up @@ -360,7 +359,6 @@ class Layer {
uint64_t unique_id() const { return unique_id_; }

virtual const ContainerLayer* as_container_layer() const { return nullptr; }
virtual const PictureLayer* as_picture_layer() const { return nullptr; }
virtual const DisplayListLayer* as_display_list_layer() const {
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/opacity_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OpacityLayer : public ContainerLayer {
// By default, that offset is always zero, and all the offsets are handled by
// some parent TransformLayers. But we allow the offset to be non-zero for
// backward compatibility. If it's non-zero, the old behavior is to propage
// that offset to all the leaf layers (e.g., PictureLayer). That will make
// that offset to all the leaf layers (e.g., DisplayListLayer). That will make
// the retained rendering inefficient as a small offset change could propagate
// to many leaf layers. Therefore we try to capture that offset here to stop
// the propagation as repainting the OpacityLayer is expensive.
Expand Down
4 changes: 2 additions & 2 deletions flow/layers/opacity_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ TEST_F(OpacityLayerTest, OpacityInheritanceNestedWithIncompatibleChild) {
using OpacityLayerDiffTest = DiffContextTest;

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

MockLayerTree tree1;
Expand Down
Loading

0 comments on commit c40c1a8

Please sign in to comment.