This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Improve iOS PlatformViews to better handle thread merging. #16935
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
3c1aa03
first fix
a5a3a8b
fix thread merging crash
4f14cf8
formatting and remove testing code
25a9bac
remove extra testing code
d903fbe
remove extra stuff
09290b4
Merge branch 'master' into thread_merging_crash
89dde6e
fix dispose views race condition
90737aa
merge master
d7ec7f6
remove extra lines generated in merge
3d2efcd
remove extra line
64f8e9c
catransaction commit only on main thread
8015dc6
EndFrame force check platform view controller
cbb3bf4
merge master
9a914a9
review fixes
08dfdfd
formatting
61dab20
merge master
3bba821
add test view embedder
b8f95aa
Merge branch 'master' into thread_merging_crash
423d116
rename gpu thread merger
9c749cd
test for end frame call
b1747f9
remove unnecessary comment
640f289
review fixes
d364902
review fixes
aa4064e
review fixes
2038409
review fixes
49cd78f
gn format
4b63625
license golden
c20864f
Merge branch 'master' into thread_merging_crash
bf067ab
add external view embedder in fuschia tests
c23e5f7
fix complier error
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "shell_test_external_view_embedder.h" | ||
|
||
namespace flutter { | ||
|
||
// |ExternalViewEmbedder| | ||
void ShellTestExternalViewEmbedder::CancelFrame() {} | ||
|
||
// |ExternalViewEmbedder| | ||
void ShellTestExternalViewEmbedder::BeginFrame(SkISize frame_size, | ||
GrContext* context, | ||
double device_pixel_ratio) {} | ||
|
||
// |ExternalViewEmbedder| | ||
void ShellTestExternalViewEmbedder::PrerollCompositeEmbeddedView( | ||
int view_id, | ||
std::unique_ptr<EmbeddedViewParams> params) {} | ||
|
||
// |ExternalViewEmbedder| | ||
PostPrerollResult ShellTestExternalViewEmbedder::PostPrerollAction( | ||
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) { | ||
FML_DCHECK(raster_thread_merger); | ||
return post_preroll_result_; | ||
} | ||
|
||
// |ExternalViewEmbedder| | ||
std::vector<SkCanvas*> ShellTestExternalViewEmbedder::GetCurrentCanvases() { | ||
return {}; | ||
} | ||
|
||
// |ExternalViewEmbedder| | ||
SkCanvas* ShellTestExternalViewEmbedder::CompositeEmbeddedView(int view_id) { | ||
return nullptr; | ||
} | ||
|
||
// |ExternalViewEmbedder| | ||
bool ShellTestExternalViewEmbedder::SubmitFrame(GrContext* context, | ||
SkCanvas* background_canvas) { | ||
return true; | ||
} | ||
|
||
// |ExternalViewEmbedder| | ||
void ShellTestExternalViewEmbedder::FinishFrame() {} | ||
|
||
// |ExternalViewEmbedder| | ||
void ShellTestExternalViewEmbedder::EndFrame( | ||
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) { | ||
end_frame_call_back_(); | ||
} | ||
|
||
// |ExternalViewEmbedder| | ||
SkCanvas* ShellTestExternalViewEmbedder::GetRootCanvas() { | ||
return nullptr; | ||
} | ||
|
||
} // namespace flutter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_SHELL_TEST_EXTERNAL_VIEW_EMBEDDER_H_ | ||
#define FLUTTER_SHELL_TEST_EXTERNAL_VIEW_EMBEDDER_H_ | ||
|
||
#include "flutter/flow/embedded_views.h" | ||
#include "flutter/fml/raster_thread_merger.h" | ||
|
||
namespace flutter { | ||
|
||
//------------------------------------------------------------------------------ | ||
/// @brief The external view embedder used by |ShellTestPlatformViewGL| | ||
/// | ||
class ShellTestExternalViewEmbedder final : public ExternalViewEmbedder { | ||
public: | ||
using EndFrameCallBack = std::function<void(void)>; | ||
|
||
ShellTestExternalViewEmbedder(const EndFrameCallBack& end_frame_call_back, | ||
PostPrerollResult post_preroll_result) | ||
: end_frame_call_back_(end_frame_call_back), | ||
post_preroll_result_(post_preroll_result) {} | ||
|
||
~ShellTestExternalViewEmbedder() = default; | ||
|
||
private: | ||
// |ExternalViewEmbedder| | ||
void CancelFrame() override; | ||
|
||
// |ExternalViewEmbedder| | ||
void BeginFrame(SkISize frame_size, | ||
GrContext* context, | ||
double device_pixel_ratio) override; | ||
|
||
// |ExternalViewEmbedder| | ||
void PrerollCompositeEmbeddedView( | ||
int view_id, | ||
std::unique_ptr<EmbeddedViewParams> params) override; | ||
|
||
// |ExternalViewEmbedder| | ||
PostPrerollResult PostPrerollAction( | ||
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override; | ||
|
||
// |ExternalViewEmbedder| | ||
std::vector<SkCanvas*> GetCurrentCanvases() override; | ||
|
||
// |ExternalViewEmbedder| | ||
SkCanvas* CompositeEmbeddedView(int view_id) override; | ||
|
||
// |ExternalViewEmbedder| | ||
bool SubmitFrame(GrContext* context, SkCanvas* background_canvas) override; | ||
|
||
// |ExternalViewEmbedder| | ||
void FinishFrame() override; | ||
|
||
// |ExternalViewEmbedder| | ||
void EndFrame( | ||
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override; | ||
|
||
// |ExternalViewEmbedder| | ||
SkCanvas* GetRootCanvas() override; | ||
|
||
const EndFrameCallBack end_frame_call_back_; | ||
const PostPrerollResult post_preroll_result_; | ||
|
||
FML_DISALLOW_COPY_AND_ASSIGN(ShellTestExternalViewEmbedder); | ||
}; | ||
|
||
} // namespace flutter | ||
|
||
#endif // FLUTTER_SHELL_TEST_EXTERNAL_VIEW_EMBEDDER_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.