Skip to content

Commit

Permalink
Clean obsolete 'shared_resource_context' (flutter#32521)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdPaleLight authored Apr 14, 2022
1 parent 8d1932a commit 0611bbf
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
10 changes: 2 additions & 8 deletions shell/common/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ std::unique_ptr<Shell> Shell::Spawn(
/*io_manager=*/std::move(io_manager));
},
is_gpu_disabled);
result->shared_resource_context_ = io_manager_->GetSharedResourceContext();
result->RunEngine(std::move(run_configuration));
return result;
}
Expand Down Expand Up @@ -803,16 +802,11 @@ void Shell::OnPlatformViewCreated(std::unique_ptr<Surface> surface) {

auto io_task = [io_manager = io_manager_->GetWeakPtr(), platform_view,
ui_task_runner = task_runners_.GetUITaskRunner(), ui_task,
shared_resource_context = shared_resource_context_,
raster_task_runner = task_runners_.GetRasterTaskRunner(),
raster_task, should_post_raster_task, &latch] {
if (io_manager && !io_manager->GetResourceContext()) {
sk_sp<GrDirectContext> resource_context;
if (shared_resource_context) {
resource_context = shared_resource_context;
} else {
resource_context = platform_view->CreateResourceContext();
}
sk_sp<GrDirectContext> resource_context =
platform_view->CreateResourceContext();
io_manager->NotifyResourceContextAvailable(resource_context);
}
// Step 1: Post a task on the UI thread to tell the engine that it has
Expand Down
2 changes: 0 additions & 2 deletions shell/common/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ class Shell final : public PlatformView::Delegate,
// How many frames have been timed since last report.
size_t UnreportedFramesCount() const;

sk_sp<GrDirectContext> shared_resource_context_;

Shell(DartVMRef vm,
TaskRunners task_runners,
fml::RefPtr<fml::RasterThreadMerger> parent_merger,
Expand Down
4 changes: 0 additions & 4 deletions shell/common/shell_io_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,4 @@ std::shared_ptr<impeller::Context> ShellIOManager::GetImpellerContext() const {
return impeller_context_;
}

sk_sp<GrDirectContext> ShellIOManager::GetSharedResourceContext() const {
return resource_context_;
};

} // namespace flutter
2 changes: 0 additions & 2 deletions shell/common/shell_io_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class ShellIOManager final : public IOManager {
// |IOManager|
std::shared_ptr<impeller::Context> GetImpellerContext() const override;

sk_sp<GrDirectContext> GetSharedResourceContext() const;

private:
// Resource context management.
sk_sp<GrDirectContext> resource_context_;
Expand Down

0 comments on commit 0611bbf

Please sign in to comment.