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

Commit 326b202

Browse files
authored
Reland fuchsia external view embedder will be shared with platform view (#22008)
* Reland fuchsia external view embedder will be shared with platform view This reverts commit 9b75279. * wait for the external view embedder to be initialized before creating shell
1 parent e51c710 commit 326b202

32 files changed

+152
-109
lines changed

flow/layers/child_scene_layer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
2424

2525
void ChildSceneLayer::Paint(PaintContext& context) const {}
2626

27-
void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) {
27+
void ChildSceneLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
2828
TRACE_EVENT0("flutter", "ChildSceneLayer::UpdateScene");
2929
FML_DCHECK(needs_system_composite());
30-
context.UpdateView(layer_id_, offset_, size_, hit_testable_);
30+
context->UpdateView(layer_id_, offset_, size_, hit_testable_);
3131
}
3232

3333
} // namespace flutter

flow/layers/child_scene_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ChildSceneLayer : public Layer {
2626

2727
void Paint(PaintContext& context) const override;
2828

29-
void UpdateScene(SceneUpdateContext& context) override;
29+
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
3030

3131
private:
3232
zx_koid_t layer_id_ = ZX_KOID_INVALID;

flow/layers/clip_path_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
4141

4242
#if defined(LEGACY_FUCHSIA_EMBEDDER)
4343

44-
void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
44+
void ClipPathLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
4545
TRACE_EVENT0("flutter", "ClipPathLayer::UpdateScene");
4646
FML_DCHECK(needs_system_composite());
4747

flow/layers/clip_path_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ClipPathLayer : public ContainerLayer {
2222
}
2323

2424
#if defined(LEGACY_FUCHSIA_EMBEDDER)
25-
void UpdateScene(SceneUpdateContext& context) override;
25+
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
2626
#endif
2727

2828
private:

flow/layers/clip_rect_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
3636

3737
#if defined(LEGACY_FUCHSIA_EMBEDDER)
3838

39-
void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
39+
void ClipRectLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
4040
TRACE_EVENT0("flutter", "ClipRectLayer::UpdateScene");
4141
FML_DCHECK(needs_system_composite());
4242

flow/layers/clip_rect_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ClipRectLayer : public ContainerLayer {
2121
}
2222

2323
#if defined(LEGACY_FUCHSIA_EMBEDDER)
24-
void UpdateScene(SceneUpdateContext& context) override;
24+
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
2525
#endif
2626

2727
private:

flow/layers/clip_rrect_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
3737

3838
#if defined(LEGACY_FUCHSIA_EMBEDDER)
3939

40-
void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
40+
void ClipRRectLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
4141
TRACE_EVENT0("flutter", "ClipRRectLayer::UpdateScene");
4242
FML_DCHECK(needs_system_composite());
4343

flow/layers/clip_rrect_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ClipRRectLayer : public ContainerLayer {
2222
}
2323

2424
#if defined(LEGACY_FUCHSIA_EMBEDDER)
25-
void UpdateScene(SceneUpdateContext& context) override;
25+
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
2626
#endif
2727

2828
private:

flow/layers/container_layer.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,19 @@ void ContainerLayer::CheckForChildLayerBelow(PrerollContext* context) {
9898
// All ContainerLayers make the check in PrerollChildren.
9999
}
100100

101-
void ContainerLayer::UpdateScene(SceneUpdateContext& context) {
101+
void ContainerLayer::UpdateScene(std::shared_ptr<SceneUpdateContext> context) {
102102
UpdateSceneChildren(context);
103103
}
104104

105-
void ContainerLayer::UpdateSceneChildren(SceneUpdateContext& context) {
105+
void ContainerLayer::UpdateSceneChildren(
106+
std::shared_ptr<SceneUpdateContext> context) {
106107
FML_DCHECK(needs_system_composite());
107108

108109
std::optional<SceneUpdateContext::Frame> frame;
109110
if (child_layer_exists_below_) {
110111
frame.emplace(
111112
context, SkRRect::MakeRect(paint_bounds()), SK_ColorTRANSPARENT,
112-
SkScalarRoundToInt(context.alphaf() * 255), "flutter::ContainerLayer");
113+
SkScalarRoundToInt(context->alphaf() * 255), "flutter::ContainerLayer");
113114
frame->AddPaintLayer(this);
114115
}
115116

flow/layers/container_layer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ContainerLayer : public Layer {
2121
void Paint(PaintContext& context) const override;
2222
#if defined(LEGACY_FUCHSIA_EMBEDDER)
2323
void CheckForChildLayerBelow(PrerollContext* context) override;
24-
void UpdateScene(SceneUpdateContext& context) override;
24+
void UpdateScene(std::shared_ptr<SceneUpdateContext> context) override;
2525
#endif
2626

2727
const std::vector<std::shared_ptr<Layer>>& layers() const { return layers_; }
@@ -33,7 +33,7 @@ class ContainerLayer : public Layer {
3333
void PaintChildren(PaintContext& context) const;
3434

3535
#if defined(LEGACY_FUCHSIA_EMBEDDER)
36-
void UpdateSceneChildren(SceneUpdateContext& context);
36+
void UpdateSceneChildren(std::shared_ptr<SceneUpdateContext> context);
3737
#endif
3838

3939
// Try to prepare the raster cache for a given layer.

0 commit comments

Comments
 (0)