-
Notifications
You must be signed in to change notification settings - Fork 6k
Pass SurfaceFrame to SubmitFrame #18709
Pass SurfaceFrame to SubmitFrame #18709
Conversation
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.
Other than the use-after-move in the assertion, looks good.
shell/common/rasterizer.cc
Outdated
external_view_embedder->FinishFrame(); | ||
std::move(frame)); | ||
// The frame must be submitted at this point. | ||
FML_DCHECK(frame->IsSubmitted()); |
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.
This is a use after move. This check is passing because of undefined behavior.
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/surface_frame.cc
Outdated
SurfaceFrame::SurfaceFrame(sk_sp<SkSurface> surface, | ||
bool supports_readback, | ||
const SubmitCallback& submit_callback) | ||
: submitted_(false), |
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.
Initialize these in the header please. That way, if/when new ctors are added, they don't all have to remember to initialize all ivars.
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 see you just moved this TU. I bet this is an old TU. I'd recommend updating it nonetheless.
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.
@@ -141,6 +142,18 @@ source_set("common") { | |||
public_configs = [ "//flutter:config" ] | |||
} | |||
|
|||
source_set("surface_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.
Why is this in its own target? The only place this is being included (flow) also includes common.
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.
To workaround a circular dependency. :common
depends on //flutter/flow
, but //flutter/flow
depends on :surface_frame
.
f2be027
to
0fc6235
Compare
This PR refactors the
ExternalViewEmbedder
interface, such that SubmitFrame takes aSurfaceFrame
instead of just the surface'sSkCanvas
. As the name implies,SubmitFrame
should be responsible for submitting the frame.After taking this direction, I realized that
FinishFrame
can be removed, since the use case (submittingCATransitions
) be handled inSubmitFrame
.This is required for hybrid composition on Android.
Fixes flutter/flutter#58286