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

Reland "fuchsia: Delete all the legacy code! (#26422)" #27075

Merged
merged 1 commit into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ config("config") {

defines = []

# This define is transitional and will be removed after the embedder API
# transition is complete.
#
# TODO(bugs.fuchsia.dev/54041): Remove when no longer necessary.
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
defines += [ "LEGACY_FUCHSIA_EMBEDDER" ]
}

if (is_debug) {
defines += [ "FLUTTER_ENABLE_DIFF_CONTEXT" ]
}
Expand Down
11 changes: 0 additions & 11 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc
FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h
FILE: ../../../flutter/flow/layers/backdrop_filter_layer_unittests.cc
FILE: ../../../flutter/flow/layers/checkerboard_layertree_unittests.cc
FILE: ../../../flutter/flow/layers/child_scene_layer.cc
FILE: ../../../flutter/flow/layers/child_scene_layer.h
FILE: ../../../flutter/flow/layers/clip_path_layer.cc
FILE: ../../../flutter/flow/layers/clip_path_layer.h
FILE: ../../../flutter/flow/layers/clip_path_layer_unittests.cc
Expand All @@ -69,7 +67,6 @@ FILE: ../../../flutter/flow/layers/color_filter_layer_unittests.cc
FILE: ../../../flutter/flow/layers/container_layer.cc
FILE: ../../../flutter/flow/layers/container_layer.h
FILE: ../../../flutter/flow/layers/container_layer_unittests.cc
FILE: ../../../flutter/flow/layers/fuchsia_layer_unittests.cc
FILE: ../../../flutter/flow/layers/image_filter_layer.cc
FILE: ../../../flutter/flow/layers/image_filter_layer.h
FILE: ../../../flutter/flow/layers/image_filter_layer_unittests.cc
Expand Down Expand Up @@ -118,8 +115,6 @@ FILE: ../../../flutter/flow/raster_cache_unittests.cc
FILE: ../../../flutter/flow/rtree.cc
FILE: ../../../flutter/flow/rtree.h
FILE: ../../../flutter/flow/rtree_unittests.cc
FILE: ../../../flutter/flow/scene_update_context.cc
FILE: ../../../flutter/flow/scene_update_context.h
FILE: ../../../flutter/flow/skia_gpu_object.cc
FILE: ../../../flutter/flow/skia_gpu_object.h
FILE: ../../../flutter/flow/skia_gpu_object_unittests.cc
Expand All @@ -128,8 +123,6 @@ FILE: ../../../flutter/flow/surface.h
FILE: ../../../flutter/flow/surface_frame.cc
FILE: ../../../flutter/flow/surface_frame.h
FILE: ../../../flutter/flow/texture_unittests.cc
FILE: ../../../flutter/flow/view_holder.cc
FILE: ../../../flutter/flow/view_holder.h
FILE: ../../../flutter/fml/ascii_trie.cc
FILE: ../../../flutter/fml/ascii_trie.h
FILE: ../../../flutter/fml/ascii_trie_unittests.cc
Expand Down Expand Up @@ -312,8 +305,6 @@ FILE: ../../../flutter/lib/ui/compositing/scene.h
FILE: ../../../flutter/lib/ui/compositing/scene_builder.cc
FILE: ../../../flutter/lib/ui/compositing/scene_builder.h
FILE: ../../../flutter/lib/ui/compositing/scene_builder_unittests.cc
FILE: ../../../flutter/lib/ui/compositing/scene_host.cc
FILE: ../../../flutter/lib/ui/compositing/scene_host.h
FILE: ../../../flutter/lib/ui/dart_runtime_hooks.cc
FILE: ../../../flutter/lib/ui/dart_runtime_hooks.h
FILE: ../../../flutter/lib/ui/dart_ui.cc
Expand Down Expand Up @@ -1342,8 +1333,6 @@ FILE: ../../../flutter/shell/platform/fuchsia/flutter/accessibility_bridge_unitt
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component_unittest.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/compositor_context.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/compositor_context.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/default_session_connection.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/default_session_connection.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/engine.cc
Expand Down
3 changes: 0 additions & 3 deletions common/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ declare_args() {

# Whether to use the Skia text shaper module for all text rendering
flutter_always_use_skshaper = false

# Whether to use the legacy embedder when building for Fuchsia.
flutter_enable_legacy_fuchsia_embedder = true
}

# feature_defines_list ---------------------------------------------------------
Expand Down
24 changes: 0 additions & 24 deletions flow/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@ source_set("flow") {
"//flutter/fml",
"//third_party/skia",
]

if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
sources += [
"layers/child_scene_layer.cc",
"layers/child_scene_layer.h",
"scene_update_context.cc",
"scene_update_context.h",
"view_holder.cc",
"view_holder.h",
]

public_deps = [
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
"$fuchsia_sdk_root/fidl:fuchsia.ui.gfx",
"$fuchsia_sdk_root/fidl:fuchsia.ui.views",
"$fuchsia_sdk_root/pkg:scenic_cpp",
]
}
}

if (enable_unittests) {
Expand Down Expand Up @@ -194,11 +176,5 @@ if (enable_unittests) {
# Required for M_PI and others.
defines += [ "_USE_MATH_DEFINES" ]
}

if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
sources += [ "layers/fuchsia_layer_unittests.cc" ]

deps += [ "//build/fuchsia/pkg:sys_cpp_testing" ]
}
}
}
3 changes: 1 addition & 2 deletions flow/layers/backdrop_filter_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ TEST_F(BackdropFilterLayerTest, PaintingEmptyLayerDies) {
parent->Preroll(preroll_context(), SkMatrix());
EXPECT_EQ(layer->paint_bounds(), kEmptyRect);
EXPECT_FALSE(layer->needs_painting(paint_context()));
EXPECT_FALSE(layer->needs_system_composite());

EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
"needs_painting\\(context\\)");
Expand Down Expand Up @@ -263,7 +262,7 @@ TEST_F(BackdropFilterLayerTest, Readback) {

// BDF with no filter blocks child with readback
auto mock_layer =
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, false, true);
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, true);
layer2->Add(mock_layer);
preroll_context()->surface_needs_readback = false;
layer2->Preroll(preroll_context(), initial_transform);
Expand Down
10 changes: 0 additions & 10 deletions flow/layers/checkerboard_layertree_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,8 @@ TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerNotCheckBoard) {
PhysicalShapeLayer::ComputeShadowBounds(layer_path.getBounds(),
initial_elevation, 1.0f));
EXPECT_TRUE(layer->needs_painting(paint_context()));
EXPECT_FALSE(layer->needs_system_composite());
EXPECT_EQ(layer->elevation(), initial_elevation);

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

TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerCheckBoard) {
Expand All @@ -341,12 +336,8 @@ TEST_F(CheckerBoardLayerTest, PhysicalSaveLayerCheckBoard) {
PhysicalShapeLayer::ComputeShadowBounds(layer_path.getBounds(),
initial_elevation, 1.0f));
EXPECT_TRUE(layer->needs_painting(paint_context()));
EXPECT_FALSE(layer->needs_system_composite());
EXPECT_EQ(layer->elevation(), initial_elevation);

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

#endif
Expand Down
33 changes: 0 additions & 33 deletions flow/layers/child_scene_layer.cc

This file was deleted.

42 changes: 0 additions & 42 deletions flow/layers/child_scene_layer.h

This file was deleted.

17 changes: 0 additions & 17 deletions flow/layers/clip_path_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#include "flutter/flow/layers/clip_path_layer.h"
#include "flutter/flow/paint_utils.h"

#if defined(LEGACY_FUCHSIA_EMBEDDER)
#include "lib/ui/scenic/cpp/commands.h"
#endif

namespace flutter {

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

#if defined(LEGACY_FUCHSIA_EMBEDDER)

void ClipPathLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
TRACE_EVENT0("flutter", "ClipPathLayer::UpdateScene");
FML_DCHECK(needs_system_composite());

// TODO(liyuqian): respect clip_behavior_
SceneUpdateContext::Clip clip(context, clip_path_.getBounds());
UpdateSceneChildren(context);
}

#endif

void ClipPathLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipPathLayer::Paint");
FML_DCHECK(needs_painting(context));
Expand Down
4 changes: 0 additions & 4 deletions flow/layers/clip_path_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ class ClipPathLayer : public ContainerLayer {
return clip_behavior_ == Clip::antiAliasWithSaveLayer;
}

#if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
#endif

private:
SkPath clip_path_;
Clip clip_behavior_;
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/clip_path_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ TEST_F(ClipPathLayerTest, Readback) {
const Clip save_layer = Clip::antiAliasWithSaveLayer;

std::shared_ptr<MockLayer> nochild;
auto reader = std::make_shared<MockLayer>(path, paint, false, false, true);
auto reader = std::make_shared<MockLayer>(path, paint, false, true);
auto nonreader = std::make_shared<MockLayer>(path, paint);

// No children, no prior readback -> no readback after
Expand Down
13 changes: 0 additions & 13 deletions flow/layers/clip_rect_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
context->cull_rect = previous_cull_rect;
}

#if defined(LEGACY_FUCHSIA_EMBEDDER)

void ClipRectLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
TRACE_EVENT0("flutter", "ClipRectLayer::UpdateScene");
FML_DCHECK(needs_system_composite());

// TODO(liyuqian): respect clip_behavior_
SceneUpdateContext::Clip clip(context, clip_rect_);
UpdateSceneChildren(context);
}

#endif

void ClipRectLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipRectLayer::Paint");
FML_DCHECK(needs_painting(context));
Expand Down
4 changes: 0 additions & 4 deletions flow/layers/clip_rect_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class ClipRectLayer : public ContainerLayer {
return clip_behavior_ == Clip::antiAliasWithSaveLayer;
}

#if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
#endif

private:
SkRect clip_rect_;
Clip clip_behavior_;
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/clip_rect_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ TEST_F(ClipRectLayerTest, Readback) {
const Clip save_layer = Clip::antiAliasWithSaveLayer;

std::shared_ptr<MockLayer> nochild;
auto reader = std::make_shared<MockLayer>(path, paint, false, false, true);
auto reader = std::make_shared<MockLayer>(path, paint, false, true);
auto nonreader = std::make_shared<MockLayer>(path, paint);

// No children, no prior readback -> no readback after
Expand Down
13 changes: 0 additions & 13 deletions flow/layers/clip_rrect_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,6 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
context->cull_rect = previous_cull_rect;
}

#if defined(LEGACY_FUCHSIA_EMBEDDER)

void ClipRRectLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
TRACE_EVENT0("flutter", "ClipRRectLayer::UpdateScene");
FML_DCHECK(needs_system_composite());

// TODO(liyuqian): respect clip_behavior_
SceneUpdateContext::Clip clip(context, clip_rrect_.getBounds());
UpdateSceneChildren(context);
}

#endif

void ClipRRectLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipRRectLayer::Paint");
FML_DCHECK(needs_painting(context));
Expand Down
4 changes: 0 additions & 4 deletions flow/layers/clip_rrect_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ class ClipRRectLayer : public ContainerLayer {
return clip_behavior_ == Clip::antiAliasWithSaveLayer;
}

#if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
#endif

private:
SkRRect clip_rrect_;
Clip clip_behavior_;
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/clip_rrect_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ TEST_F(ClipRRectLayerTest, Readback) {
const Clip save_layer = Clip::antiAliasWithSaveLayer;

std::shared_ptr<MockLayer> nochild;
auto reader = std::make_shared<MockLayer>(path, paint, false, false, true);
auto reader = std::make_shared<MockLayer>(path, paint, false, true);
auto nonreader = std::make_shared<MockLayer>(path, paint);

// No children, no prior readback -> no readback after
Expand Down
3 changes: 1 addition & 2 deletions flow/layers/color_filter_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ TEST_F(ColorFilterLayerTest, PaintingEmptyLayerDies) {
layer->Preroll(preroll_context(), SkMatrix());
EXPECT_EQ(layer->paint_bounds(), kEmptyRect);
EXPECT_FALSE(layer->needs_painting(paint_context()));
EXPECT_FALSE(layer->needs_system_composite());

EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
"needs_painting\\(context\\)");
Expand Down Expand Up @@ -207,7 +206,7 @@ TEST_F(ColorFilterLayerTest, Readback) {

// ColorFilterLayer blocks child with readback
auto mock_layer =
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, false, true);
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, true);
layer->Add(mock_layer);
preroll_context()->surface_needs_readback = false;
layer->Preroll(preroll_context(), initial_transform);
Expand Down
Loading