forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve iOS PlatformViews to better handle thread merging. (flutter#1…
- Loading branch information
Chris Yang
authored
Apr 9, 2020
1 parent
5a78dd8
commit f6b8eda
Showing
20 changed files
with
342 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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.