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
Allow embedder controlled composition of Flutter layers. #10195
Merged
chinmaygarde
merged 14 commits into
flutter-team-archive:master
from
chinmaygarde:embedder_layer
Aug 13, 2019
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9ac4d51
Allow embedder controlled composition of Flutter layers.
chinmaygarde 2761522
Document tests.
chinmaygarde 29791ff
FlutterBackingStore::did_update
chinmaygarde 8e160ba
Optionally render to surface
chinmaygarde 91a3d39
Fix iOS & Android
chinmaygarde 9b8c091
Windows fix
chinmaygarde 9f14706
Sizes
chinmaygarde 786ae19
PR
chinmaygarde 4c5b365
PR
chinmaygarde c09cc95
PR
chinmaygarde fa25174
Document ivar.
chinmaygarde 04b0955
PR
chinmaygarde 6f88bc9
Comment
chinmaygarde 976b965
Width != Height
chinmaygarde 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
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,13 @@ | ||
| // 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. | ||
|
|
||
| #include "gpu_surface_software_delegate.h" | ||
|
|
||
| namespace flutter { | ||
|
|
||
| ExternalViewEmbedder* GPUSurfaceSoftwareDelegate::GetExternalViewEmbedder() { | ||
| 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,65 @@ | ||
| // 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_GPU_GPU_SURFACE_SOFTWARE_DELEGATE_H_ | ||
| #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_DELEGATE_H_ | ||
|
|
||
| #include "flutter/flow/embedded_views.h" | ||
| #include "flutter/fml/macros.h" | ||
| #include "third_party/skia/include/core/SkSurface.h" | ||
|
|
||
| namespace flutter { | ||
|
|
||
| //------------------------------------------------------------------------------ | ||
| /// @brief Interface implemented by all platform surfaces that can present | ||
| /// a software backing store to the "screen". The GPU surface | ||
| /// abstraction (which abstracts the client rendering API) uses this | ||
| /// delegation pattern to tell the platform surface (which abstracts | ||
| /// how backing stores fulfilled by the selected client rendering | ||
| /// API end up on the "screen" on a particular platform) when the | ||
| /// rasterizer needs to allocate and present the software backing | ||
| /// store. | ||
| /// | ||
| /// @see |IOSurfaceSoftware|, |AndroidSurfaceSoftware|, | ||
| /// |EmbedderSurfaceSoftware|. | ||
| /// | ||
| class GPUSurfaceSoftwareDelegate { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment class and methods.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| public: | ||
| //---------------------------------------------------------------------------- | ||
| /// @brief Called when the GPU surface needs a new buffer to render a new | ||
| /// frame into. | ||
| /// | ||
| /// @param[in] size The size of the frame. | ||
| /// | ||
| /// @return A raster surface returned by the platform. | ||
| /// | ||
| virtual sk_sp<SkSurface> AcquireBackingStore(const SkISize& size) = 0; | ||
|
|
||
| //---------------------------------------------------------------------------- | ||
| /// @brief Called by the platform when a frame has been rendered into the | ||
| /// backing store and the platform must display it on-screen. | ||
| /// | ||
| /// @param[in] backing_store The software backing store to present. | ||
| /// | ||
| /// @return Returns if the platform could present the backing store onto | ||
| /// the screen. | ||
| /// | ||
| virtual bool PresentBackingStore(sk_sp<SkSurface> backing_store) = 0; | ||
|
|
||
| //---------------------------------------------------------------------------- | ||
| /// @brief Gets the view embedder that controls how the Flutter layer | ||
| /// hierarchy split into multiple chunks should be composited back | ||
| /// on-screen. This field is optional and the Flutter rasterizer | ||
| /// will render into a single on-screen surface if this call | ||
| /// returns a null external view embedder. | ||
| /// | ||
| /// @return The external view embedder, or, null if Flutter is rendering | ||
| /// into a single on-screen surface. | ||
| /// | ||
| virtual ExternalViewEmbedder* GetExternalViewEmbedder() = 0; | ||
| }; | ||
|
|
||
| } // namespace flutter | ||
|
|
||
| #endif // FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_DELEGATE_H_ | ||
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.
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.
Doesn't it make it an owned mapping once we have a release proc?
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 guess so. The argument could also be made that this object does not own the mapping but gives the closure to collect it (so whoever passes in the closure to this owns the mapping).