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 the GrContext to be created after IOManager etc. #7243
Closed
Closed
Changes from all commits
Commits
Show all changes
6 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
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,35 @@ | ||
| // 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_LIB_UI_RESOURCE_CONTEXT_MANAGER_H_ | ||
| #define FLUTTER_LIB_UI_RESOURCE_CONTEXT_MANAGER_H_ | ||
|
|
||
| #include "flutter/fml/memory/weak_ptr.h" | ||
| #include "third_party/skia/include/gpu/GrContext.h" | ||
|
|
||
| namespace blink { | ||
| // Interface for methods that manage the GrContext creation, access, and | ||
| // release. Meant to be implemented by the owner of the GLContext, e.g. the | ||
| // PlatformView. These methods may be called from a non-platform task runner. | ||
| class ResourceContextManager { | ||
| public: | ||
| virtual sk_sp<GrContext> CreateResourceContext() = 0; | ||
|
|
||
| // In almost all situations, this should be prefered to | ||
| // `CreateResourceContext`. This will get the currently applicable GrContext | ||
| // on the calling thread for the current GrContext, if one is available. | ||
|
Member
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. should "GrContext" be changed to "GLContext" here? |
||
| // Calling this will ensure that, in the event the GLContext has changed, the | ||
| // correct GrContext for the current GLContext will be used. Unlike all other | ||
| // methods on the platform view, this one may be called on a non-platform task | ||
| // runner. | ||
| virtual sk_sp<GrContext> GetOrCreateResourceContext() = 0; | ||
|
|
||
| virtual fml::WeakPtr<GrContext> GetOrCreateWeakResourceContext() = 0; | ||
|
|
||
| virtual void ReleaseResourceContext() const = 0; | ||
| }; | ||
|
|
||
| } // namespace blink | ||
|
|
||
| #endif // FLUTTER_LIB_UI_RESOURCE_CONTEXT_MANAGER_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
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.
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.
typo: "preferred"