-
Notifications
You must be signed in to change notification settings - Fork 6k
Make sure that 'BeginFrame' and 'EndFrame' of the 'ExternalViewEmbedder' are paired #32058
Make sure that 'BeginFrame' and 'EndFrame' of the 'ExternalViewEmbedder' are paired #32058
Conversation
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM % nits.
As for the tests, @iskakaushik is trying to de-flake the tests, so we should try to go with a solution where we don't need to disable the tests.
flow/embedded_views.h
Outdated
|
|
||
| // Change the flag about whether it is used in this frame, it will be set to | ||
| // true when 'BeginFrame' and false when 'EndFrame'. | ||
| void set_used_this_frame(bool used_this_frame) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: void SetUsedThisFrame(bool used_this_frame)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
flow/embedded_views.h
Outdated
|
|
||
| // Whether it is used in this frame, returns true between 'BeginFrame' and | ||
| // 'EndFrame', otherwise returns false. | ||
| bool used_this_frame() const { return used_this_frame_; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: bool GetUsedThisFrame() or bool IsFrameUsed()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
shell/common/rasterizer.cc
Outdated
| external_view_embedder_->BeginFrame( | ||
| layer_tree.frame_size(), surface_->GetContext(), | ||
| layer_tree.device_pixel_ratio(), raster_thread_merger_); | ||
| external_view_embedder_->set_used_this_frame(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a: FML_DCHECK(!external_view_embedder_->used_this_frame())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
It seems that we are disabling the tests. If we make this change and disabling the tests in #32059 (comment), we will have to fix the tests for this change when re-enabling them. CC @iskakaushik |
3754158 to
28fc23d
Compare
|
@cyanglaz @iskakaushik |
chinmaygarde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the pattern followed elsewhere in the engine is to use an RAII wrapper that automatically inserts the end frame call. See flutter::CompositorContext::ScopedFrame. But this is fine too.
…ewEmbedder' are paired (flutter/engine#32058)
* 98962ee Make sure that 'BeginFrame' and 'EndFrame' of the 'ExternalViewEmbedder' are paired (flutter/engine#32058) * c62b0e2 Roll Skia from 3b238ceae9c3 to 8318cc9928ef (1 revision) (flutter/engine#32249) * f049e57 Explicitly cast fuchsia.io constants to uint32_t (flutter/engine#32250) * 5804870 Roll Skia from 8318cc9928ef to ae5984082b5e (3 revisions) (flutter/engine#32251) * f17ee9d Roll buildroot to 9e88510. (flutter/engine#32248)
fix flutter/flutter#100207
There is still a situation where
BeginFrameandEndFrameare not paired. For example, whenRasterStatusisRasterStatus::kDiscarded,BeginFrameis not called, butEndFrameis called.And when we try to pair
BeginFrameandEndFrame, the testsShellTest.DiscardLayerTreeOnResizeandShellTest.DiscardResubmittedLayerTreeOnResizeare failed. so we have two options:Disable these tests:
We're actually going to do that Disable several tests due to flakiness #32059 , and the reason for doing it is that these tests introduce this Issue:
ShellTest.DiscardLayerTreeOnResizeis flaky on presubmits. flutter#95751Introduce a new mechanism, such as adding a closure called
draw_layer_tree_finished_callbackinSettings.At the end of each
Rasterizer::DrawandRasterizer::DrawLastLayerTree, no matter whether it is succeeded or failed, this closure is called back, and this mechanism is used to replace theExternalViewEmbedderin these tests.cc @dnfield @cyanglaz @blasten
Pre-launch Checklist
writing and running engine tests.
///).