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
fuchsia: Add FuchsiaExternalViewEmbedder tests #28144
Merged
arbreng
merged 1 commit into
flutter:master
from
arbreng:fuchsia-external-view-embedder-tests
Sep 17, 2021
Merged
Changes from all commits
Commits
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,78 @@ | ||
| // 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_PLATFORM_FUCHSIA_FLUTTER_SURFACE_PRODUCER_H_ | ||
| #define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_SURFACE_PRODUCER_H_ | ||
|
|
||
| #include <fuchsia/ui/composition/cpp/fidl.h> | ||
| #include <lib/zx/event.h> | ||
|
|
||
| #include <functional> | ||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| #include "third_party/skia/include/core/SkSize.h" | ||
| #include "third_party/skia/include/core/SkSurface.h" | ||
|
|
||
| namespace flutter_runner { | ||
|
|
||
| using ReleaseImageCallback = std::function<void()>; | ||
|
|
||
| // This represents an abstract notion of a "rendering surface", which is a | ||
| // destination for pixels drawn by some rendering engine. In this case, the | ||
| // rendering engine is Skia combined with one of its rendering backends. | ||
| // | ||
| // In addition to allowing Skia-based drawing via `GetSkiaSurface`, this | ||
| // rendering surface can be shared with Scenic via `SetImageId`, | ||
| // `GetBufferCollectionImportToken`, `GetAcquireFene`, and `GetReleaseFence`. | ||
| class SurfaceProducerSurface { | ||
| public: | ||
| virtual ~SurfaceProducerSurface() = default; | ||
|
|
||
| virtual bool IsValid() const = 0; | ||
|
|
||
| virtual SkISize GetSize() const = 0; | ||
|
|
||
| virtual void SetImageId(uint32_t image_id) = 0; | ||
|
|
||
| virtual uint32_t GetImageId() = 0; | ||
|
|
||
| virtual sk_sp<SkSurface> GetSkiaSurface() const = 0; | ||
|
|
||
| virtual fuchsia::ui::composition::BufferCollectionImportToken | ||
| GetBufferCollectionImportToken() = 0; | ||
|
|
||
| virtual zx::event GetAcquireFence() = 0; | ||
|
|
||
| virtual zx::event GetReleaseFence() = 0; | ||
|
|
||
| virtual void SetReleaseImageCallback( | ||
| ReleaseImageCallback release_image_callback) = 0; | ||
|
|
||
| virtual size_t AdvanceAndGetAge() = 0; | ||
|
|
||
| virtual bool FlushSessionAcquireAndReleaseEvents() = 0; | ||
|
|
||
| virtual void SignalWritesFinished( | ||
| const std::function<void(void)>& on_writes_committed) = 0; | ||
| }; | ||
|
|
||
| // This represents an abstract notion of "surface producer", which serves as a | ||
| // source for `SurfaceProducerSurface`s. Produces surfaces should be returned | ||
| // to this `SurfaceProducer` via `SubmitSurfaces`, at which point they will be | ||
| // shared with Scenic. | ||
| class SurfaceProducer { | ||
| public: | ||
| virtual ~SurfaceProducer() = default; | ||
|
|
||
| virtual std::unique_ptr<SurfaceProducerSurface> ProduceSurface( | ||
| const SkISize& size) = 0; | ||
|
|
||
| virtual void SubmitSurfaces( | ||
| std::vector<std::unique_ptr<SurfaceProducerSurface>> surfaces) = 0; | ||
| }; | ||
|
|
||
| } // namespace flutter_runner | ||
|
|
||
| #endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_SURFACE_PRODUCER_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.
Uh oh!
There was an error while loading. Please reload this page.