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

Conversation

@cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Nov 20, 2019

This PR is an exact re-land of "RendererContextSwitch guard flutter's gl context rework. #13812" + the fix for the image not showing issue which caused the revert. (flutter/flutter#45098)

Added RendererContextSwitches before some other gl operations.

Added a scenario test that makes sure the images are shown. The scenario tests are currently only running on simulator on CI. It needs to be run on an actual device to be sure the gl context is set correctly for image rendering. For now, I have manually tested it locally.
The effort of running the scenario test to device on CI is tracked here: flutter/flutter#43852

Preferably, A framework side golden tests for displaying an image should be added to catch the regression

All the changes in the PR besides "RendererContextSwitch guard flutter's gl context rework. #13812" is inline commented

IMPORTANT: We should only land this when flutter/flutter#45348 is resolved.

Copy link
Contributor Author

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the context switches added in this PR besides the re-land.

Comment on lines 333 to 349
RasterStatus Rasterizer::RasterAndSubmitCompositorFrame(
SurfaceFrame& frame,
CompositorContext::ScopedFrame& compositor_frame,
flutter::LayerTree& layer_tree) {
std::unique_ptr<RendererContextSwitchManager::RendererContextSwitch>
context_switch = surface_->MakeRenderContextCurrent();
if (!context_switch->GetSwitchResult()) {
return RasterStatus::kFailed;
}
RasterStatus raster_status = compositor_frame.Raster(layer_tree, false);
if (raster_status == RasterStatus::kFailed) {
return raster_status;
}
frame.Submit();
return raster_status;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added switch before Raster

Comment on lines 320 to 324
std::unique_ptr<RendererContextSwitchManager::RendererContextSwitch>
context_switch = surface_->MakeRenderContextCurrent();
if (!context_switch->GetSwitchResult()) {
return RasterStatus::kFailed;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added context switch

Comment on lines 358 to 362
std::unique_ptr<RendererContextSwitchManager::RendererContextSwitch>
context_switch = surface_->MakeRenderContextCurrent();
if (!context_switch->GetSwitchResult()) {
return nullptr;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added context switch

Comment on lines 94 to 98
std::unique_ptr<RendererContextSwitchManager::RendererContextSwitch>
context_switch = surface_->MakeRenderContextCurrent();
if (!context_switch->GetSwitchResult()) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added context switch

Comment on lines 579 to 583
std::unique_ptr<RendererContextSwitchManager::RendererContextSwitch>
context_switch = surface_->MakeRenderContextCurrent();
if (!context_switch->GetSwitchResult()) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added context switch

Comment on lines 596 to 600
std::unique_ptr<RendererContextSwitchManager::RendererContextSwitch>
context_switch = surface_->MakeRenderContextCurrent();
if (!context_switch->GetSwitchResult()) {
return std::nullopt;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added context switch

@chinmaygarde
Copy link
Member

It is a bit hard to parse just the additions so I may have something but LGTM. Can you reword the title to just say something like "Reland "RendererContextSwitch guard flutter's gl context rework.""

@cyanglaz cyanglaz changed the title Re-land "RendererContextSwitch guard flutter's gl context rework. #13812" + fix for image not showing Reland "RendererContextSwitch guard flutter's gl context rework. #13812" Nov 20, 2019
@cyanglaz
Copy link
Contributor Author

It is a bit hard to parse just the additions so I may have something but LGTM. Can you reword the title to just say something like "Reland "RendererContextSwitch guard flutter's gl context rework.""

Done.

@cyanglaz
Copy link
Contributor Author

@chinmaygarde I rebased and it is really to review.
The framework side integration test to catch the image rendering regression is landed.

@cyanglaz
Copy link
Contributor Author

Closing for now. Will open later when I find a reviewer for this.

@cyanglaz cyanglaz closed this Mar 19, 2020
Partizann pushed a commit to Partizann/engine that referenced this pull request Mar 23, 2020
Partizann pushed a commit to Partizann/engine that referenced this pull request Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants