Skip to content

Commit d1b56f9

Browse files
authored
Reland "fuchsia: Delete all the legacy code! (flutter#26422)" (flutter#27075)
This reverts commit bb3c49a9c3edf931a5601f0245faa85f5e077cb4.
1 parent 6c2b052 commit d1b56f9

File tree

71 files changed

+47
-3053
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+47
-3053
lines changed

BUILD.gn

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ config("config") {
2323

2424
defines = []
2525

26-
# This define is transitional and will be removed after the embedder API
27-
# transition is complete.
28-
#
29-
# TODO(bugs.fuchsia.dev/54041): Remove when no longer necessary.
30-
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
31-
defines += [ "LEGACY_FUCHSIA_EMBEDDER" ]
32-
}
33-
3426
if (is_debug) {
3527
defines += [ "FLUTTER_ENABLE_DIFF_CONTEXT" ]
3628
}

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc
5252
FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h
5353
FILE: ../../../flutter/flow/layers/backdrop_filter_layer_unittests.cc
5454
FILE: ../../../flutter/flow/layers/checkerboard_layertree_unittests.cc
55-
FILE: ../../../flutter/flow/layers/child_scene_layer.cc
56-
FILE: ../../../flutter/flow/layers/child_scene_layer.h
5755
FILE: ../../../flutter/flow/layers/clip_path_layer.cc
5856
FILE: ../../../flutter/flow/layers/clip_path_layer.h
5957
FILE: ../../../flutter/flow/layers/clip_path_layer_unittests.cc
@@ -69,7 +67,6 @@ FILE: ../../../flutter/flow/layers/color_filter_layer_unittests.cc
6967
FILE: ../../../flutter/flow/layers/container_layer.cc
7068
FILE: ../../../flutter/flow/layers/container_layer.h
7169
FILE: ../../../flutter/flow/layers/container_layer_unittests.cc
72-
FILE: ../../../flutter/flow/layers/fuchsia_layer_unittests.cc
7370
FILE: ../../../flutter/flow/layers/image_filter_layer.cc
7471
FILE: ../../../flutter/flow/layers/image_filter_layer.h
7572
FILE: ../../../flutter/flow/layers/image_filter_layer_unittests.cc
@@ -118,8 +115,6 @@ FILE: ../../../flutter/flow/raster_cache_unittests.cc
118115
FILE: ../../../flutter/flow/rtree.cc
119116
FILE: ../../../flutter/flow/rtree.h
120117
FILE: ../../../flutter/flow/rtree_unittests.cc
121-
FILE: ../../../flutter/flow/scene_update_context.cc
122-
FILE: ../../../flutter/flow/scene_update_context.h
123118
FILE: ../../../flutter/flow/skia_gpu_object.cc
124119
FILE: ../../../flutter/flow/skia_gpu_object.h
125120
FILE: ../../../flutter/flow/skia_gpu_object_unittests.cc
@@ -128,8 +123,6 @@ FILE: ../../../flutter/flow/surface.h
128123
FILE: ../../../flutter/flow/surface_frame.cc
129124
FILE: ../../../flutter/flow/surface_frame.h
130125
FILE: ../../../flutter/flow/texture_unittests.cc
131-
FILE: ../../../flutter/flow/view_holder.cc
132-
FILE: ../../../flutter/flow/view_holder.h
133126
FILE: ../../../flutter/fml/ascii_trie.cc
134127
FILE: ../../../flutter/fml/ascii_trie.h
135128
FILE: ../../../flutter/fml/ascii_trie_unittests.cc
@@ -312,8 +305,6 @@ FILE: ../../../flutter/lib/ui/compositing/scene.h
312305
FILE: ../../../flutter/lib/ui/compositing/scene_builder.cc
313306
FILE: ../../../flutter/lib/ui/compositing/scene_builder.h
314307
FILE: ../../../flutter/lib/ui/compositing/scene_builder_unittests.cc
315-
FILE: ../../../flutter/lib/ui/compositing/scene_host.cc
316-
FILE: ../../../flutter/lib/ui/compositing/scene_host.h
317308
FILE: ../../../flutter/lib/ui/dart_runtime_hooks.cc
318309
FILE: ../../../flutter/lib/ui/dart_runtime_hooks.h
319310
FILE: ../../../flutter/lib/ui/dart_ui.cc
@@ -1342,8 +1333,6 @@ FILE: ../../../flutter/shell/platform/fuchsia/flutter/accessibility_bridge_unitt
13421333
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component.cc
13431334
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component.h
13441335
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component_unittest.cc
1345-
FILE: ../../../flutter/shell/platform/fuchsia/flutter/compositor_context.cc
1346-
FILE: ../../../flutter/shell/platform/fuchsia/flutter/compositor_context.h
13471336
FILE: ../../../flutter/shell/platform/fuchsia/flutter/default_session_connection.cc
13481337
FILE: ../../../flutter/shell/platform/fuchsia/flutter/default_session_connection.h
13491338
FILE: ../../../flutter/shell/platform/fuchsia/flutter/engine.cc

common/config.gni

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ declare_args() {
1919

2020
# Whether to use the Skia text shaper module for all text rendering
2121
flutter_always_use_skshaper = false
22-
23-
# Whether to use the legacy embedder when building for Fuchsia.
24-
flutter_enable_legacy_fuchsia_embedder = true
2522
}
2623

2724
# feature_defines_list ---------------------------------------------------------

flow/BUILD.gn

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,6 @@ source_set("flow") {
8080
"//flutter/fml",
8181
"//third_party/skia",
8282
]
83-
84-
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
85-
sources += [
86-
"layers/child_scene_layer.cc",
87-
"layers/child_scene_layer.h",
88-
"scene_update_context.cc",
89-
"scene_update_context.h",
90-
"view_holder.cc",
91-
"view_holder.h",
92-
]
93-
94-
public_deps = [
95-
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
96-
"$fuchsia_sdk_root/fidl:fuchsia.ui.gfx",
97-
"$fuchsia_sdk_root/fidl:fuchsia.ui.views",
98-
"$fuchsia_sdk_root/pkg:scenic_cpp",
99-
]
100-
}
10183
}
10284

10385
if (enable_unittests) {
@@ -194,11 +176,5 @@ if (enable_unittests) {
194176
# Required for M_PI and others.
195177
defines += [ "_USE_MATH_DEFINES" ]
196178
}
197-
198-
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
199-
sources += [ "layers/fuchsia_layer_unittests.cc" ]
200-
201-
deps += [ "//build/fuchsia/pkg:sys_cpp_testing" ]
202-
}
203179
}
204180
}

flow/layers/backdrop_filter_layer_unittests.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ TEST_F(BackdropFilterLayerTest, PaintingEmptyLayerDies) {
3030
parent->Preroll(preroll_context(), SkMatrix());
3131
EXPECT_EQ(layer->paint_bounds(), kEmptyRect);
3232
EXPECT_FALSE(layer->needs_painting(paint_context()));
33-
EXPECT_FALSE(layer->needs_system_composite());
3433

3534
EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
3635
"needs_painting\\(context\\)");
@@ -263,7 +262,7 @@ TEST_F(BackdropFilterLayerTest, Readback) {
263262

264263
// BDF with no filter blocks child with readback
265264
auto mock_layer =
266-
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, false, true);
265+
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, true);
267266
layer2->Add(mock_layer);
268267
preroll_context()->surface_needs_readback = false;
269268
layer2->Preroll(preroll_context(), initial_transform);

flow/layers/checkerboard_layertree_unittests.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,8 @@ TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerNotCheckBoard) {
297297
PhysicalShapeLayer::ComputeShadowBounds(layer_path.getBounds(),
298298
initial_elevation, 1.0f));
299299
EXPECT_TRUE(layer->needs_painting(paint_context()));
300-
EXPECT_FALSE(layer->needs_system_composite());
301300
EXPECT_EQ(layer->elevation(), initial_elevation);
302301

303-
// The Fuchsia system compositor handles all elevated PhysicalShapeLayers and
304-
// their shadows , so we do not use the direct |Paint()| path there.
305-
#if !defined(LEGACY_FUCHSIA_EMBEDDER)
306302
const SkRect paint_bounds = SkRect::MakeXYWH(0, 0, 8, 8);
307303
const SkPaint clip_paint;
308304
SkPaint layer_paint;
@@ -323,7 +319,6 @@ TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerNotCheckBoard) {
323319
MockCanvas::DrawCall{2, MockCanvas::DrawPaint{layer_paint}},
324320
MockCanvas::DrawCall{2, MockCanvas::RestoreData{1}},
325321
MockCanvas::DrawCall{1, MockCanvas::RestoreData{0}}}));
326-
#endif
327322
}
328323

329324
TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerCheckBoard) {
@@ -341,12 +336,8 @@ TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerCheckBoard) {
341336
PhysicalShapeLayer::ComputeShadowBounds(layer_path.getBounds(),
342337
initial_elevation, 1.0f));
343338
EXPECT_TRUE(layer->needs_painting(paint_context()));
344-
EXPECT_FALSE(layer->needs_system_composite());
345339
EXPECT_EQ(layer->elevation(), initial_elevation);
346340

347-
// The Fuchsia system compositor handles all elevated PhysicalShapeLayers and
348-
// their shadows , so we do not use the direct |Paint()| path there.
349-
#if !defined(LEGACY_FUCHSIA_EMBEDDER)
350341
const SkRect paint_bounds = SkRect::MakeXYWH(0, 0, 8, 8);
351342
const SkPaint clip_paint;
352343
SkPaint layer_paint;
@@ -367,7 +358,6 @@ TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerCheckBoard) {
367358
MockCanvas::DrawCall{2, MockCanvas::DrawPaint{layer_paint}},
368359
MockCanvas::DrawCall{2, MockCanvas::RestoreData{1}},
369360
MockCanvas::DrawCall{1, MockCanvas::RestoreData{0}}}));
370-
#endif
371361
}
372362

373363
#endif

flow/layers/child_scene_layer.cc

Lines changed: 0 additions & 33 deletions
This file was deleted.

flow/layers/child_scene_layer.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

flow/layers/clip_path_layer.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
#include "flutter/flow/layers/clip_path_layer.h"
66
#include "flutter/flow/paint_utils.h"
77

8-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
9-
#include "lib/ui/scenic/cpp/commands.h"
10-
#endif
11-
128
namespace flutter {
139

1410
ClipPathLayer::ClipPathLayer(const SkPath& clip_path, Clip clip_behavior)
@@ -58,19 +54,6 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
5854
context->cull_rect = previous_cull_rect;
5955
}
6056

61-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
62-
63-
void ClipPathLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
64-
TRACE_EVENT0("flutter", "ClipPathLayer::UpdateScene");
65-
FML_DCHECK(needs_system_composite());
66-
67-
// TODO(liyuqian): respect clip_behavior_
68-
SceneUpdateContext::Clip clip(context, clip_path_.getBounds());
69-
UpdateSceneChildren(context);
70-
}
71-
72-
#endif
73-
7457
void ClipPathLayer::Paint(PaintContext& context) const {
7558
TRACE_EVENT0("flutter", "ClipPathLayer::Paint");
7659
FML_DCHECK(needs_painting(context));

flow/layers/clip_path_layer.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class ClipPathLayer : public ContainerLayer {
2727
return clip_behavior_ == Clip::antiAliasWithSaveLayer;
2828
}
2929

30-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
31-
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
32-
#endif
33-
3430
private:
3531
SkPath clip_path_;
3632
Clip clip_behavior_;

flow/layers/clip_path_layer_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ TEST_F(ClipPathLayerTest, Readback) {
222222
const Clip save_layer = Clip::antiAliasWithSaveLayer;
223223

224224
std::shared_ptr<MockLayer> nochild;
225-
auto reader = std::make_shared<MockLayer>(path, paint, false, false, true);
225+
auto reader = std::make_shared<MockLayer>(path, paint, false, true);
226226
auto nonreader = std::make_shared<MockLayer>(path, paint);
227227

228228
// No children, no prior readback -> no readback after

flow/layers/clip_rect_layer.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
5353
context->cull_rect = previous_cull_rect;
5454
}
5555

56-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
57-
58-
void ClipRectLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
59-
TRACE_EVENT0("flutter", "ClipRectLayer::UpdateScene");
60-
FML_DCHECK(needs_system_composite());
61-
62-
// TODO(liyuqian): respect clip_behavior_
63-
SceneUpdateContext::Clip clip(context, clip_rect_);
64-
UpdateSceneChildren(context);
65-
}
66-
67-
#endif
68-
6956
void ClipRectLayer::Paint(PaintContext& context) const {
7057
TRACE_EVENT0("flutter", "ClipRectLayer::Paint");
7158
FML_DCHECK(needs_painting(context));

flow/layers/clip_rect_layer.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ class ClipRectLayer : public ContainerLayer {
2626
return clip_behavior_ == Clip::antiAliasWithSaveLayer;
2727
}
2828

29-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
30-
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
31-
#endif
32-
3329
private:
3430
SkRect clip_rect_;
3531
Clip clip_behavior_;

flow/layers/clip_rect_layer_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ TEST_F(ClipRectLayerTest, Readback) {
220220
const Clip save_layer = Clip::antiAliasWithSaveLayer;
221221

222222
std::shared_ptr<MockLayer> nochild;
223-
auto reader = std::make_shared<MockLayer>(path, paint, false, false, true);
223+
auto reader = std::make_shared<MockLayer>(path, paint, false, true);
224224
auto nonreader = std::make_shared<MockLayer>(path, paint);
225225

226226
// No children, no prior readback -> no readback after

flow/layers/clip_rrect_layer.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,6 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
5454
context->cull_rect = previous_cull_rect;
5555
}
5656

57-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
58-
59-
void ClipRRectLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
60-
TRACE_EVENT0("flutter", "ClipRRectLayer::UpdateScene");
61-
FML_DCHECK(needs_system_composite());
62-
63-
// TODO(liyuqian): respect clip_behavior_
64-
SceneUpdateContext::Clip clip(context, clip_rrect_.getBounds());
65-
UpdateSceneChildren(context);
66-
}
67-
68-
#endif
69-
7057
void ClipRRectLayer::Paint(PaintContext& context) const {
7158
TRACE_EVENT0("flutter", "ClipRRectLayer::Paint");
7259
FML_DCHECK(needs_painting(context));

flow/layers/clip_rrect_layer.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class ClipRRectLayer : public ContainerLayer {
2727
return clip_behavior_ == Clip::antiAliasWithSaveLayer;
2828
}
2929

30-
#if defined(LEGACY_FUCHSIA_EMBEDDER)
31-
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
32-
#endif
33-
3430
private:
3531
SkRRect clip_rrect_;
3632
Clip clip_behavior_;

flow/layers/clip_rrect_layer_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ TEST_F(ClipRRectLayerTest, Readback) {
225225
const Clip save_layer = Clip::antiAliasWithSaveLayer;
226226

227227
std::shared_ptr<MockLayer> nochild;
228-
auto reader = std::make_shared<MockLayer>(path, paint, false, false, true);
228+
auto reader = std::make_shared<MockLayer>(path, paint, false, true);
229229
auto nonreader = std::make_shared<MockLayer>(path, paint);
230230

231231
// No children, no prior readback -> no readback after

flow/layers/color_filter_layer_unittests.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ TEST_F(ColorFilterLayerTest, PaintingEmptyLayerDies) {
2323
layer->Preroll(preroll_context(), SkMatrix());
2424
EXPECT_EQ(layer->paint_bounds(), kEmptyRect);
2525
EXPECT_FALSE(layer->needs_painting(paint_context()));
26-
EXPECT_FALSE(layer->needs_system_composite());
2726

2827
EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
2928
"needs_painting\\(context\\)");
@@ -207,7 +206,7 @@ TEST_F(ColorFilterLayerTest, Readback) {
207206

208207
// ColorFilterLayer blocks child with readback
209208
auto mock_layer =
210-
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, false, true);
209+
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, true);
211210
layer->Add(mock_layer);
212211
preroll_context()->surface_needs_readback = false;
213212
layer->Preroll(preroll_context(), initial_transform);

0 commit comments

Comments
 (0)