This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Repository navigation
Add a stub implementation of FlutterMetalCompositor #25790
Merged
gw280
merged 4 commits into
flutter-team-archive:master
from
gw280:gwright-fluttercompositormetal
Apr 27, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
48 changes: 48 additions & 0 deletions
48
shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // 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_METAL_COMPOSITOR_H_ | ||
| #define FLUTTER_METAL_COMPOSITOR_H_ | ||
|
|
||
| #include "flutter/fml/macros.h" | ||
| #include "flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h" | ||
|
|
||
| namespace flutter { | ||
|
|
||
| class FlutterMetalCompositor : public FlutterCompositor { | ||
| public: | ||
| explicit FlutterMetalCompositor(FlutterViewController* view_controller); | ||
|
|
||
| virtual ~FlutterMetalCompositor() = default; | ||
|
|
||
| // Creates a BackingStore and sets backing_store_out to a | ||
| // FlutterBackingStore struct containing details of the new | ||
| // backing store. | ||
| // | ||
| // If the backing store is being requested for the first time | ||
| // for a given frame, we do not create a new backing store but | ||
| // rather return the backing store associated with the | ||
| // FlutterView's FlutterSurfaceManager. | ||
| // | ||
| // Any additional state allocated for the backing store and | ||
| // saved as user_data in the backing store must be collected | ||
| // in backing_store_out's destruction_callback field which will | ||
| // be called when the embedder collects the backing store. | ||
| bool CreateBackingStore(const FlutterBackingStoreConfig* config, | ||
| FlutterBackingStore* backing_store_out) override; | ||
|
|
||
| // Releases and deallocates any and all resources that were allocated | ||
| // for this FlutterBackingStore object in CreateBackingStore. | ||
| bool CollectBackingStore(const FlutterBackingStore* backing_store) override; | ||
|
|
||
| // Composites the provided FlutterLayer objects and presents the composited | ||
| // frame to the FlutterView(s). | ||
| bool Present(const FlutterLayer** layers, size_t layers_count) override; | ||
|
|
||
| FML_DISALLOW_COPY_AND_ASSIGN(FlutterMetalCompositor); | ||
| }; | ||
|
|
||
| } // namespace flutter | ||
|
|
||
| #endif // FLUTTER_METAL_COMPOSITOR_H_ |
29 changes: 29 additions & 0 deletions
29
shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.mm
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,29 @@ | ||
| // 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. | ||
|
|
||
| #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.h" | ||
|
|
||
| #include "flutter/fml/logging.h" | ||
|
|
||
| namespace flutter { | ||
|
|
||
| FlutterMetalCompositor::FlutterMetalCompositor(FlutterViewController* view_controller) | ||
| : FlutterCompositor(view_controller) {} | ||
|
|
||
| bool FlutterMetalCompositor::CreateBackingStore(const FlutterBackingStoreConfig* config, | ||
| FlutterBackingStore* backing_store_out) { | ||
| FML_CHECK(false) << "Not implemented, see issue: https://github.com/flutter/flutter/issues/81320"; | ||
| return false; | ||
| } | ||
| bool FlutterMetalCompositor::CollectBackingStore(const FlutterBackingStore* backing_store) { | ||
| FML_CHECK(false) << "Not implemented, see issue: https://github.com/flutter/flutter/issues/81320"; | ||
| return false; | ||
| } | ||
|
|
||
| bool FlutterMetalCompositor::Present(const FlutterLayer** layers, size_t layers_count) { | ||
| FML_CHECK(false) << "Not implemented, see issue: https://github.com/flutter/flutter/issues/81320"; | ||
| return false; | ||
| } | ||
|
|
||
| } // namespace flutter | ||
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.