Reuse image data instead of fetching it every time off the GPU
This commit is contained in:
@@ -15,11 +15,15 @@ namespace gui {
|
||||
|
||||
void draw(const DrawContext& pctx, const Assets& assets) override;
|
||||
|
||||
[[nodiscard]] std::shared_ptr<::Texture> texture() const {
|
||||
[[nodiscard]] auto texture() const {
|
||||
return mTexture;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto data() const {
|
||||
return mData;
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<::Texture> mTexture;
|
||||
std::unique_ptr<ImageData> mData;
|
||||
std::shared_ptr<ImageData> mData;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user