Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ad66694
Implement unobstructed Platform Views
Feb 12, 2020
1fde093
Comments
Mar 2, 2020
9b747a3
Format gn
Mar 2, 2020
e8cfa5d
Remove log
Mar 2, 2020
ae64ac3
Add FlutterRTree unit test
Mar 2, 2020
e722620
Remove blue UIView
Mar 3, 2020
bce3c8a
Fix header
Mar 3, 2020
b1975e1
Update licenses_flutter
Mar 3, 2020
4318306
Update unit tests
Mar 3, 2020
84c3b0f
test (delete)
Mar 3, 2020
3635a70
Fix platform view scenarios tests
Mar 4, 2020
39f0bad
typo
Mar 4, 2020
62d8d8d
Update golden platform view
Mar 4, 2020
11242e9
Fix FlutterRTree bug
Mar 4, 2020
fcaa142
Clip platform view in the background canvas
Mar 4, 2020
2b27ed6
Add GetPlatformViewRect to EmbedderExternalViewEmbedder
Mar 4, 2020
b7c2bc6
Remove matrix check
Mar 4, 2020
71ba25c
Return empty skrect
Mar 4, 2020
7002929
Test
Mar 4, 2020
9f7f91c
Fix tests
Mar 5, 2020
4cb007a
Update rtree unit test
Mar 5, 2020
326f339
Minor fixes
Mar 6, 2020
6d283a9
Revert unintended change
Mar 6, 2020
781fb29
Remove stale comment
Mar 6, 2020
858849b
Clean up
Mar 6, 2020
d482d2d
Fix unittest
Mar 7, 2020
00f86a5
Add tests for unobstructed platform views
Mar 9, 2020
b35dde1
Format dart code
Mar 9, 2020
423036d
Clean up
Mar 9, 2020
ed891cb
Remove old rtree
Mar 10, 2020
207beb4
Clean up
Mar 10, 2020
f6d1269
Remove duplicated entry after rebase
Mar 11, 2020
af7b916
Remove dependency
Mar 11, 2020
4100603
Revert changes from rebase
Mar 11, 2020
0c06c48
Delete transient files
Mar 11, 2020
f705462
nits
Mar 11, 2020
71e5beb
Pass ios_context
Mar 11, 2020
d4f4386
comments
Mar 12, 2020
7f2d64e
Add todo
Mar 12, 2020
f48860f
Add FinishFrame hook to embedded_views
Mar 14, 2020
32fbc8c
empty line
Mar 14, 2020
165d9ea
Missing method
Mar 14, 2020
41b8ac4
Feedback
Mar 18, 2020
8488382
Merge remote-tracking branch 'upstream/master' into unobstructed_pv
Mar 19, 2020
32f433a
Feedback
Mar 20, 2020
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
5 changes: 4 additions & 1 deletion flow/embedded_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@

namespace flutter {

bool ExternalViewEmbedder::SubmitFrame(GrContext* context) {
bool ExternalViewEmbedder::SubmitFrame(GrContext* context,
SkCanvas* background_canvas) {
return false;
};

void ExternalViewEmbedder::FinishFrame(){};

void MutatorsStack::PushClipRect(const SkRect& rect) {
std::shared_ptr<Mutator> element = std::make_shared<Mutator>(rect);
vector_.push_back(element);
Expand Down
5 changes: 4 additions & 1 deletion flow/embedded_views.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ class ExternalViewEmbedder {
// Must be called on the UI thread.
virtual SkCanvas* CompositeEmbeddedView(int view_id) = 0;

virtual bool SubmitFrame(GrContext* context);
virtual bool SubmitFrame(GrContext* context, SkCanvas* background_canvas);

// This is called after submitting the embedder frame and the surface frame.
virtual void FinishFrame();

FML_DISALLOW_COPY_AND_ASSIGN(ExternalViewEmbedder);

Expand Down
2 changes: 1 addition & 1 deletion flow/layers/picture_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void PictureLayer::Paint(PaintContext& context) const {
return;
}
}
context.leaf_nodes_canvas->drawPicture(picture());
picture()->playback(context.leaf_nodes_canvas);
}

} // namespace flutter
3 changes: 0 additions & 3 deletions flow/layers/picture_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ TEST_F(PictureLayerTest, SimplePicture) {
1, MockCanvas::SetMatrixData{RasterCache::GetIntegralTransCTM(
layer_offset_matrix)}},
#endif
MockCanvas::DrawCall{
1, MockCanvas::DrawPictureData{mock_picture->serialize(), SkPaint(),
SkMatrix()}},
MockCanvas::DrawCall{1, MockCanvas::RestoreData{0}}});
EXPECT_EQ(mock_canvas().draw_calls(), expected_draw_calls);
}
Expand Down
12 changes: 10 additions & 2 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,17 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) {
if (raster_status == RasterStatus::kFailed) {
return raster_status;
}
frame->Submit();
if (external_view_embedder != nullptr) {
external_view_embedder->SubmitFrame(surface_->GetContext());
external_view_embedder->SubmitFrame(surface_->GetContext(),
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to make sure the CATransaction is committed after everything is ready to be presented.
Right now external_view_embedder->SubmitFrame commits the CATransaction, so we can't move frame->Submit to be called after it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can add a separate interface in external_view_embedder to commit transactions?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like a good approach, however I'd probably call the method which (on iOS) commits the transaction SubmitFrame 😄.

What do you think about adding a FinalizeCanvases method which will do everything but commit the transaction, and then separately SubmitFrame(which on iOS commits the transaction, on embedder platforms would present layers).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not too familiar with embedder platforms, does it mean iOS's FinalizeCanvases becomes an equivalent of embedder platforms' SubmitFrame?

Copy link
Author

Choose a reason for hiding this comment

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

I added a FinishFrame() method to ExternalViewEmbedder that can be used for committing the transaction. I believe this is the simplest refactor given the scope of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm OK with this only considering iOS. I'm not sure what the best approach would be considering external embedder. Probably need more inputs from @amirh or @chinmaygarde

root_surface_canvas);
// The external view embedder may mutate the root surface canvas while
// submitting the frame.
// Therefore, submit the final frame after asking the external view
// embedder to submit the frame.
frame->Submit();
external_view_embedder->FinishFrame();
} else {
frame->Submit();
}

FireNextFrameCallbackIfPresent();
Expand Down
Loading