5#ifndef FLUTTER_DISPLAY_LIST_TESTING_DL_TEST_SURFACE_PROVIDER_H_
6#define FLUTTER_DISPLAY_LIST_TESTING_DL_TEST_SURFACE_PROVIDER_H_
16#include "third_party/skia/include/core/SkSurface.h"
25 virtual const uint32_t*
addr32(uint32_t
x, uint32_t
y)
const = 0;
26 virtual size_t width()
const = 0;
28 virtual bool write(
const std::string&
path)
const = 0;
87 virtual sk_sp<SkSurface>
sk_surface() {
return nullptr; }
108 return SkImageInfo::MakeN32Premul(w,
h);
110 return SkImageInfo::Make(SkISize::Make(w,
h), kRGB_565_SkColorType,
111 kOpaque_SkAlphaType);
139 static std::unique_ptr<DlSurfaceProvider> CreateSkiaSoftware();
140 static std::unique_ptr<DlSurfaceProvider> CreateSkiaOpenGL();
141 static std::unique_ptr<DlSurfaceProvider> CreateSkiaMetal();
142 static std::unique_ptr<DlSurfaceProvider> CreateImpellerMetal();
143 static std::unique_ptr<DlSurfaceProvider> CreateImpellerMetalSDF();
Developer-facing API for rendering anything within the engine.
virtual size_t height() const =0
virtual ~DlPixelData()=default
virtual const uint32_t * addr32(uint32_t x, uint32_t y) const =0
virtual bool write(const std::string &path) const =0
virtual size_t width() const =0
virtual int height() const =0
The height of the underlying surface.
virtual DlCanvas * GetCanvas()=0
virtual sk_sp< DlImage > SnapshotToImage() const =0
virtual int width() const =0
The width of the underlying surface.
DlISize GetSize() const
The size of the underlying surface.
virtual void Clear(const DlColor &color)=0
Clear the entire surface to the indicated color.
virtual sk_sp< SkSurface > sk_surface()
virtual std::unique_ptr< DlPixelData > SnapshotToPixelData() const =0
virtual bool SnapshotToFile(std::string &filename) const =0
Store a snapshot of this Surface to the file indicated by the filename.
virtual void RenderDisplayList(const sk_sp< DisplayList > &display_list)=0
virtual void FlushSubmitCpuSync()=0
virtual ~DlSurfaceInstance()=default
virtual bool TargetsImpeller() const =0
virtual std::shared_ptr< DlSurfaceInstance > GetPrimarySurface() const =0
static std::optional< BackendType > NameToBackend(const std::string &name)
virtual ~DlSurfaceProvider()=default
DlSurfaceProvider()=default
virtual bool InitializeSurface(size_t width, size_t height, PixelFormat format=kN32Premul)=0
virtual std::unique_ptr< DlSurfaceInstance > MakeOffscreenSurface(size_t width, size_t height, PixelFormat format=kN32Premul) const =0
static std::string BackendName(BackendType type)
static SkImageInfo MakeInfo(PixelFormat format, int w, int h)
static std::unique_ptr< DlSurfaceProvider > Create(BackendType backend_type)
virtual bool SupportsPixelFormat(PixelFormat format) const =0
virtual const std::string GetBackendName() const =0
virtual BackendType GetBackendType() const =0
uint32_t uint32_t * format
#define FML_DCHECK(condition)
impeller::ISize32 DlISize
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
impeller::ShaderType type