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
Texture support for glfw. #9822
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
5302cf8
Merge pull request #1 from flutter/master
cloudwebrtc 2953e13
Merge remote-tracking branch 'upstream/master'
cloudwebrtc 42b7502
Merge remote-tracking branch 'upstream/master'
cloudwebrtc ee2a336
Merge remote-tracking branch 'upstream/master'
cloudwebrtc bfd31aa
Merge remote-tracking branch 'upstream/master'
cloudwebrtc 08e9d07
Add Texture support for GLFW.
cloudwebrtc 0af9192
Fixed EventChannel for embedder.
cloudwebrtc bfb06c2
Fixed compiler error for stub_flutter_api.cc.
cloudwebrtc d6529fb
Update texture registrar for glfw.
cloudwebrtc 689f6e6
clang format.
cloudwebrtc e93c57c
Update.
cloudwebrtc eaec810
Update.
cloudwebrtc 63ad181
Add comments and code modify.
cloudwebrtc f07279e
Update DEPS
cloudwebrtc d1266a8
Update external_texture_gl.h
cloudwebrtc 7391e42
Fix compilation errors for linux and clang/gn format.
cloudwebrtc 4c5f065
Fix license check error.
cloudwebrtc 93fc359
Fixed the order of glad.h contains a run error.
cloudwebrtc 184a13a
Update.
cloudwebrtc 1c70e99
Merge remote-tracking branch 'upstream/master' into texture_glfw
cloudwebrtc 63e1469
Fixed engine type definition error.
cloudwebrtc 0669a9c
Merge remote-tracking branch 'upstream/master' into texture_glfw
cloudwebrtc 2ccfeef
Use the new `glad' dependency.
cloudwebrtc dd1bffb
Update.
cloudwebrtc c400937
fix typo.
cloudwebrtc 6456082
clang-format.
cloudwebrtc a46b562
update.
cloudwebrtc 3ecb5fd
Add comment.
cloudwebrtc e1b7a8b
Add unit tests for texture.
cloudwebrtc 4903666
update.
cloudwebrtc eed131a
update.
cloudwebrtc aba2fa2
update unit test.
cloudwebrtc d8efcdb
Fixed typo.
cloudwebrtc 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
49 changes: 49 additions & 0 deletions
49
shell/platform/common/cpp/client_wrapper/include/flutter/texture_registrar.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,49 @@ | ||
| // 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_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_TEXTURE_REGISTRAR_H_ | ||
| #define FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_TEXTURE_REGISTRAR_H_ | ||
|
|
||
| #include <flutter_texture_registrar.h> | ||
|
|
||
| #include <stdint.h> | ||
| #include <memory> | ||
|
|
||
| namespace flutter { | ||
|
|
||
| // An external texture interface declaration. | ||
| class Texture { | ||
| public: | ||
| virtual ~Texture() {} | ||
| // This interface is used to respond to texture copy requests from the Flutter | ||
| // engine, Flutter engine will be providing the |height| and |width| | ||
| // parameters of bounds. In some cases, the user can be scale the texture to | ||
| // the size of the bounds to reduce memory usage. | ||
| virtual const PixelBuffer* CopyPixelBuffer(size_t width, size_t height) = 0; | ||
| }; | ||
|
|
||
| class TextureRegistrar { | ||
| public: | ||
| virtual ~TextureRegistrar() {} | ||
|
|
||
| /** | ||
| * Registers a |texture| object and returns the ID for that texture. | ||
| */ | ||
| virtual int64_t RegisterTexture(Texture* texture) = 0; | ||
|
|
||
| /** | ||
| * Notify the flutter engine that the texture object corresponding | ||
| * to |texure_id| needs to render a new texture. | ||
| */ | ||
| virtual void MarkTextureFrameAvailable(int64_t texture_id) = 0; | ||
|
|
||
| /** | ||
| * Unregisters an existing Texture object. | ||
| */ | ||
| virtual void UnregisterTexture(int64_t texture_id) = 0; | ||
| }; | ||
|
|
||
| } // namespace flutter | ||
|
|
||
| #endif // FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_TEXTURE_REGISTRAR_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
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.
What is the ownership model of the return value here? If it's a copy presumably something needs to release it, but in that case I would expect a
unique_ptr. The meaning/use of the return value needs to be clearly documented.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.
This still needs to be addressed.