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

Commit 3587761

Browse files
committed
fuchsia: Remove dead code / break dependencies
The fuchsia code around metrics and sizing was just sending this information through a side-channel, when the engine already had the information available. So, delete all of it to make future CLs simpler. Additionally, the SceneUpdateContext has many unneccesary dependencies re: metrics and PaintTasks. Break those to make future CLs simpler. Tested: Ran all unittests and ran workstation on Fuchsia BUG: 53062, 53063
1 parent 81489ec commit 3587761

81 files changed

Lines changed: 394 additions & 748 deletions

File tree

Some content is hidden

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

flow/compositor_context.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "flutter/flow/compositor_context.h"
66

77
#include "flutter/flow/layers/layer_tree.h"
8+
#include "flutter/fml/trace_event.h"
89
#include "third_party/skia/include/core/SkCanvas.h"
910

1011
namespace flutter {

flow/gl_context_switch.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "flutter/flow/gl_context_switch.h"
66

7+
#include "flutter/fml/logging.h"
8+
79
namespace flutter {
810

911
SwitchableGLContext::SwitchableGLContext() = default;

flow/gl_context_switch.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <memory>
1010
#include <vector>
1111

12-
#include "flutter/fml/logging.h"
1312
#include "flutter/fml/macros.h"
1413

1514
namespace flutter {

flow/layers/backdrop_filter_layer.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
#include "flutter/flow/layers/backdrop_filter_layer.h"
66

7+
#include "flutter/fml/logging.h"
8+
#include "flutter/fml/trace_event.h"
9+
710
namespace flutter {
811

912
BackdropFilterLayer::BackdropFilterLayer(sk_sp<SkImageFilter> filter)

flow/layers/backdrop_filter_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define FLUTTER_FLOW_LAYERS_BACKDROP_FILTER_LAYER_H_
77

88
#include "flutter/flow/layers/container_layer.h"
9-
9+
#include "flutter/fml/macros.h"
1010
#include "third_party/skia/include/core/SkImageFilter.h"
1111

1212
namespace flutter {

flow/layers/backdrop_filter_layer_unittests.cc

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

2827
EXPECT_DEATH_IF_SUPPORTED(layer->Paint(paint_context()),
2928
"needs_painting\\(\\)");
@@ -206,7 +205,7 @@ TEST_F(BackdropFilterLayerTest, Readback) {
206205

207206
// BDF with no filter blocks child with readback
208207
auto mock_layer =
209-
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, false, true);
208+
std::make_shared<MockLayer>(SkPath(), SkPaint(), false, true);
210209
layer2->Add(mock_layer);
211210
preroll_context()->surface_needs_readback = false;
212211
layer2->Preroll(preroll_context(), initial_transform);

flow/layers/child_scene_layer.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "flutter/flow/layers/child_scene_layer.h"
66

77
#include "flutter/flow/view_holder.h"
8+
#include "flutter/fml/trace_event.h"
89

910
namespace flutter {
1011

@@ -19,16 +20,21 @@ ChildSceneLayer::ChildSceneLayer(zx_koid_t layer_id,
1920

2021
void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
2122
TRACE_EVENT0("flutter", "ChildSceneLayer::Preroll");
22-
set_needs_system_composite(true);
2323

24+
context->has_platform_view = true;
25+
context->platform_view_exists_below = true;
2426
CheckForChildLayerBelow(context);
2527

26-
context->child_scene_layer_exists_below = true;
27-
2828
// An alpha "hole punch" is required if the frame behind us is not opaque.
29-
if (!context->is_opaque) {
30-
set_paint_bounds(
31-
SkRect::MakeXYWH(offset_.fX, offset_.fY, size_.fWidth, size_.fHeight));
29+
for (auto i = context->mutators_stack.Bottom();
30+
i != context->mutators_stack.Top(); ++i) {
31+
const auto& mutator = *i;
32+
if (mutator->GetType() == MutatorType::opacity &&
33+
mutator->GetAlpha() < 255) {
34+
set_paint_bounds(SkRect::MakeXYWH(offset_.fX, offset_.fY, size_.fWidth,
35+
size_.fHeight));
36+
break;
37+
}
3238
}
3339
}
3440

flow/layers/child_scene_layer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
#ifndef FLUTTER_FLOW_LAYERS_CHILD_SCENE_LAYER_H_
66
#define FLUTTER_FLOW_LAYERS_CHILD_SCENE_LAYER_H_
77

8+
#include "flutter/flow/layers/layer.h"
9+
#include "flutter/flow/scene_update_context.h"
810
#include "third_party/skia/include/core/SkMatrix.h"
911
#include "third_party/skia/include/core/SkPoint.h"
1012
#include "third_party/skia/include/core/SkSize.h"
1113

12-
#include "flutter/flow/layers/layer.h"
13-
#include "flutter/flow/scene_update_context.h"
14-
1514
namespace flutter {
1615

1716
// Layer that represents an embedded child.

flow/layers/clip_path_layer.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#include "flutter/flow/layers/clip_path_layer.h"
66

7+
#include "flutter/fml/trace_event.h"
8+
79
#if defined(LEGACY_FUCHSIA_EMBEDDER)
810

9-
#include "lib/ui/scenic/cpp/commands.h"
11+
#include "flutter/flow/scene_update_context.h" //nogncheck
1012

1113
#endif
1214

@@ -48,7 +50,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
4850

4951
// TODO(liyuqian): respect clip_behavior_
5052
SceneUpdateContext::Clip clip(context, clip_path_.getBounds());
51-
UpdateSceneChildren(context);
53+
ContainerLayer::UpdateScene(context);
5254
}
5355

5456
#endif

flow/layers/clip_path_layer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#include "flutter/flow/layers/container_layer.h"
99

10+
#include "flutter/fml/macros.h"
11+
#include "third_party/skia/include/core/SkPath.h"
12+
1013
namespace flutter {
1114

1215
class ClipPathLayer : public ContainerLayer {

0 commit comments

Comments
 (0)