Win bg fg buffer (#4)

* better frame available

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* fix win, bg fg buffers

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* swap -1

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-02-21 09:03:18 +08:00 • committed by GitHub
parent 749acc2f87
commit 69a51033bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 23 deletions

View file

@ -22,13 +22,12 @@ private:
flutter::TextureRegistrar* texture_registrar_ = nullptr;
std::unique_ptr<flutter::TextureVariant> texture_ = nullptr;
int64_t texture_id_;
mutable std::mutex mutex_;
int last_fg_index_ = 0;
std::mutex mutex_;
int fg_index_ = 0;
size_t width_[2] = {0, 0};
size_t height_[2] = {0, 0};
bool buff_ready_ = false;
size_t width_[2];
size_t height_[2];
std::vector<uint8_t> buffer_tmp_[2];
Timer timer_;
};
#endif // TEXTURE_RGBA_H_