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

Commit 533dc37

Browse files
committed
Switched engine to use buffer collection.
The old way of allocating images meant that one would have to make sure that Scenic and Flutter were using exactly the same pixel formats. This patch removes the old image allocation and replaces it with a sysmem API that uses buffer collections instead. This permits a smooth negotiation of formats between the two systems.
1 parent 611a8d5 commit 533dc37

File tree

8 files changed

+167
-260
lines changed

8 files changed

+167
-260
lines changed

shell/platform/fuchsia/flutter/compositor_context.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ScopedFrame final : public flutter::CompositorContext::ScopedFrame {
9393
"of size: "
9494
<< physical_size.width() << "x" << physical_size.height();
9595
} else {
96-
task.material.SetTexture(*(surface->GetImage()));
96+
task.material.SetTexture(surface->GetImageId());
9797
}
9898

9999
frame_surfaces.emplace_back(std::move(surface));

shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
299299
if (layer->second.canvas_spy->DidDrawIntoCanvas()) {
300300
const auto& surface_index = frame_surface_indices.find(layer_id);
301301
FML_DCHECK(surface_index != frame_surface_indices.end());
302-
scenic::Image* surface_image =
303-
frame_surfaces[surface_index->second]->GetImage();
302+
uint32_t surface_image_id =
303+
frame_surfaces[surface_index->second]->GetImageId();
304304

305305
// Create a new layer if needed for the surface.
306306
FML_DCHECK(scenic_layer_index <= scenic_layers_.size());
@@ -363,7 +363,7 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
363363
layer->second.surface_size.height() * 0.5f, -layer_elevation);
364364
scenic_layer.material.SetColor(SK_AlphaOPAQUE, SK_AlphaOPAQUE,
365365
SK_AlphaOPAQUE, SK_AlphaOPAQUE - 1);
366-
scenic_layer.material.SetTexture(*surface_image);
366+
scenic_layer.material.SetTexture(surface_image_id);
367367

368368
// Only the first (i.e. the bottom-most) layer should receive input.
369369
// TODO: Workaround for invisible overlays stealing input. Remove when

0 commit comments

Comments
 (0)