5#ifndef FLUTTER_LIB_UI_PAINTING_DISPLAY_LIST_DEFERRED_IMAGE_GPU_IMPELLER_H_
6#define FLUTTER_LIB_UI_PAINTING_DISPLAY_LIST_DEFERRED_IMAGE_GPU_IMPELLER_H_
8#include "flutter/common/graphics/texture.h"
9#include "flutter/display_list/image/dl_image.h"
10#include "flutter/flow/layers/layer_tree.h"
11#include "flutter/fml/macros.h"
12#include "flutter/fml/memory/weak_ptr.h"
13#include "flutter/fml/task_runner.h"
14#include "flutter/lib/ui/snapshot_delegate.h"
22 std::unique_ptr<LayerTree> layer_tree,
62 class ImageWrapper final :
public std::enable_shared_from_this<ImageWrapper>,
67 static std::shared_ptr<ImageWrapper>
Make(
73 static std::shared_ptr<ImageWrapper>
Make(
74 std::unique_ptr<LayerTree> layer_tree,
80 const std::shared_ptr<impeller::Texture>
texture()
const {
91 std::shared_ptr<impeller::Texture> texture_;
94 std::shared_ptr<TextureRegistry> texture_registry_;
96 mutable std::mutex error_mutex_;
97 std::optional<std::string> error_;
109 void SnapshotDisplayList(std::unique_ptr<LayerTree> layer_tree =
nullptr);
112 void OnGrContextCreated()
override;
115 void OnGrContextDestroyed()
override;
120 const std::shared_ptr<ImageWrapper> wrapper_;
122 explicit DlDeferredImageGPUImpeller(std::shared_ptr<ImageWrapper> wrapper);
124 FML_DISALLOW_COPY_AND_ASSIGN(DlDeferredImageGPUImpeller);
size_t GetApproximateByteSize() const override
SkISize dimensions() const override
bool isUIThreadSafe() const override
If the underlying platform image held by this object has no threading requirements for the release of...
bool isTextureBacked() const override
bool isOpaque() const override
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
OwningContext owning_context() const override
sk_sp< SkImage > skia_image() const override
If this display list image is meant to be used by the Skia backend, an SkImage instance....
std::shared_ptr< impeller::Texture > impeller_texture() const override
If this display list image is meant to be used by the Impeller backend, an Impeller texture instance....
static sk_sp< DlDeferredImageGPUImpeller > Make(std::unique_ptr< LayerTree > layer_tree, fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate, fml::RefPtr< fml::TaskRunner > raster_task_runner)
~DlDeferredImageGPUImpeller() override
Represents an image whose allocation is (usually) resident on device memory.
virtual std::optional< std::string > get_error() const
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate_
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size