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(
int x,
int y)
const = 0;
26 virtual size_t width()
const = 0;
28 virtual void write(
const std::string&
path)
const = 0;
46 : surface_(
std::move(
surface)), adapter_(surface_->getCanvas()) {}
49 sk_sp<SkSurface>
sk_surface()
const override {
return surface_; }
53 sk_sp<SkSurface> surface_;
65 return SkImageInfo::MakeN32Premul(w,
h);
67 return SkImageInfo::Make(SkISize::Make(w,
h), kRGB_565_SkColorType,
91 virtual bool Snapshot(std::string& filename)
const;
107 static std::unique_ptr<DlSurfaceProvider> CreateSoftware();
108 static std::unique_ptr<DlSurfaceProvider> CreateMetal();
109 static std::unique_ptr<DlSurfaceProvider> CreateOpenGL();
Developer-facing API for rendering anything within the engine.
Backend implementation of |DlCanvas| for |SkCanvas|.
virtual size_t height() const =0
virtual ~DlPixelData()=default
virtual void write(const std::string &path) const =0
virtual const uint32_t * addr32(int x, int y) const =0
virtual size_t width() const =0
~DlSurfaceInstanceBase()=default
DlCanvas * GetCanvas() override
DlSurfaceInstanceBase(sk_sp< SkSurface > surface)
sk_sp< SkSurface > sk_surface() const override
virtual DlCanvas * GetCanvas()=0
virtual sk_sp< SkSurface > sk_surface() const =0
void FlushSubmitCpuSync()
virtual ~DlSurfaceInstance()=default
virtual bool supports(PixelFormat format) const =0
virtual std::shared_ptr< DlSurfaceInstance > GetPrimarySurface() const =0
virtual ~DlSurfaceProvider()=default
virtual sk_sp< DlImage > MakeImpellerImage(const sk_sp< DisplayList > &list, int width, int height) const
virtual bool supports_impeller() const
DlSurfaceProvider()=default
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 sk_sp< DlPixelData > ImpellerSnapshot(const sk_sp< DisplayList > &list, int width, int height) const
virtual std::shared_ptr< DlSurfaceInstance > MakeOffscreenSurface(size_t width, size_t height, PixelFormat format=kN32PremulPixelFormat) const =0
virtual BackendType backend_type() const =0
virtual bool InitializeSurface(size_t width, size_t height, PixelFormat format=kN32PremulPixelFormat)=0
virtual const std::string backend_name() const =0
uint32_t uint32_t * format
#define FML_DCHECK(condition)
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 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
Represents a texture and its intended draw transform/sampler configuration.