5#ifndef FLUTTER_LIB_UI_PAINTING_TESTING_MOCKS_H_
6#define FLUTTER_LIB_UI_PAINTING_TESTING_MOCKS_H_
10#include "gmock/gmock.h"
24 : weak_factory_(this),
30 (sk_sp<DisplayList>,
const SkImageInfo&),
41 std::function<
void(sk_sp<DlImage>)>),
53 (
const std::shared_ptr<impeller::RuntimeStage>&),
58 return weak_factory_.GetWeakPtr();
62 return texture_registry_;
67 std::shared_ptr<MockTextureRegistry> texture_registry_;
Represents an image whose allocation is (usually) resident on device memory.
virtual size_t GetApproximateByteSize() const =0
virtual DlISize GetSize() const =0
virtual bool isTextureBacked() const =0
virtual bool isOpaque() const =0
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
virtual std::shared_ptr< impeller::Texture > impeller_texture() const =0
If this display list image is meant to be used by the Impeller backend, an Impeller texture instance....
virtual bool isUIThreadSafe() const =0
If the underlying platform image held by this object has no threading requirements for the release of...
virtual sk_sp< SkImage > skia_image() const =0
If this display list image is meant to be used by the Skia backend, an SkImage instance....
virtual bool MakeRenderContextCurrent()=0
virtual void MakeRasterSnapshot(sk_sp< DisplayList > display_list, DlISize picture_size, std::function< void(sk_sp< DlImage >)> callback)=0
virtual std::shared_ptr< TextureRegistry > GetTextureRegistry()=0
Gets the registry of external textures currently in use by the rasterizer. These textures may be upda...
virtual sk_sp< DlImage > MakeRasterSnapshotSync(sk_sp< DisplayList > display_list, DlISize picture_size)=0
virtual sk_sp< SkImage > ConvertToRasterImage(sk_sp< SkImage > image)=0
virtual GrDirectContext * GetGrContext()=0
virtual std::unique_ptr< GpuImageResult > MakeSkiaGpuImage(sk_sp< DisplayList > display_list, const SkImageInfo &image_info)=0
Attempts to create a GrBackendTexture for the specified DisplayList. May result in a raster bitmap if...
virtual void CacheRuntimeStage(const std::shared_ptr< impeller::RuntimeStage > &runtime_stage)=0
MOCK_METHOD(size_t, GetApproximateByteSize,(),(const, override))
MOCK_METHOD(bool, isOpaque,(),(const, override))
MOCK_METHOD(std::shared_ptr< impeller::Texture >, impeller_texture,(),(const, override))
MOCK_METHOD(sk_sp< SkImage >, skia_image,(),(const, override))
MOCK_METHOD(bool, isTextureBacked,(),(const, override))
MOCK_METHOD(bool, isUIThreadSafe,(),(const, override))
MOCK_METHOD(DlISize, GetSize,(),(const, override))
MOCK_METHOD(void, CacheRuntimeStage,(const std::shared_ptr< impeller::RuntimeStage > &),(override))
MOCK_METHOD(bool, MakeRenderContextCurrent,(),(override))
MOCK_METHOD(std::shared_ptr< TextureRegistry >, GetTextureRegistry,(),(override))
MOCK_METHOD(GrDirectContext *, GetGrContext,(),(override))
MOCK_METHOD(std::unique_ptr< GpuImageResult >, MakeSkiaGpuImage,(sk_sp< DisplayList >, const SkImageInfo &),(override))
MOCK_METHOD(void, MakeRasterSnapshot,(sk_sp< DisplayList >, DlISize, std::function< void(sk_sp< DlImage >)>),(override))
std::shared_ptr< MockTextureRegistry > GetMockTextureRegistry()
MOCK_METHOD(sk_sp< SkImage >, ConvertToRasterImage,(sk_sp< SkImage >),(override))
virtual ~MockSnapshotDelegate()=default
MOCK_METHOD(sk_sp< DlImage >, MakeRasterSnapshotSync,(sk_sp< DisplayList >, DlISize),(override))
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > GetWeakPtr()
virtual ~MockTextureRegistry()=default
MockTextureRegistry()=default