-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
567 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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.