Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
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
[embedder] FlutterBackingStoreConfig allows special treatment of root…
…-views
  • Loading branch information
iskakaushik committed Nov 20, 2020
commit 76034fdd45fc3f3d474d3c421743e5705290b2d7
2 changes: 2 additions & 0 deletions shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,8 @@ typedef struct {
size_t struct_size;
/// The size of the render target the engine expects to render into.
FlutterSize size;
/// This is true if a backing store is requested for the root view.
bool is_root_view;
} FlutterBackingStoreConfig;

typedef enum {
Expand Down
8 changes: 5 additions & 3 deletions shell/platform/embedder/embedder_external_view_embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ SkCanvas* EmbedderExternalViewEmbedder::CompositeEmbeddedView(int view_id) {
}

static FlutterBackingStoreConfig MakeBackingStoreConfig(
const SkISize& backing_store_size) {
const SkISize& backing_store_size,
bool is_root_view) {
FlutterBackingStoreConfig config = {};

config.struct_size = sizeof(config);

config.size.width = backing_store_size.width();
config.size.height = backing_store_size.height();
config.is_root_view = is_root_view;

return config;
}
Expand Down Expand Up @@ -172,8 +174,8 @@ void EmbedderExternalViewEmbedder::SubmitFrame(
// directly.
const auto render_surface_size = external_view->GetRenderSurfaceSize();

const auto backing_store_config =
MakeBackingStoreConfig(render_surface_size);
const auto backing_store_config = MakeBackingStoreConfig(
render_surface_size, external_view->IsRootView());

// This is where the embedder will create render targets for us. Control
// flow to the embedder makes the engine susceptible to having the embedder
Expand Down
1 change: 0 additions & 1 deletion shell/platform/embedder/tests/embedder_config_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ void EmbedderConfigBuilder::SetCompositor() {
return reinterpret_cast<EmbedderTestCompositor*>(user_data)->Present(
layers, //
layers_count //

);
};
project_args_.compositor = &compositor_;
Expand Down