10#include "third_party/skia/include/core/SkSurface.h"
18 : metal_surface_(
std::move(metal_surface)),
19 adapter_(metal_surface_->GetSurface()->getCanvas()) {}
22 sk_sp<SkSurface>
sk_surface()
const override {
return metal_surface_->GetSurface(); }
26 std::unique_ptr<TestMetalSurface> metal_surface_;
34 metal_context_ = std::make_unique<TestMetalContext>();
40 if (!metal_surface_) {
43 return metal_surface_;
51 surface->GetSurface()->getCanvas()->clear(SK_ColorTRANSPARENT);
52 return std::make_shared<DlMetalSurfaceInstance>(std::move(
surface));
58 : screenshot_(
std::move(screenshot)),
59 addr_(reinterpret_cast<const uint32_t*>(screenshot_->GetBytes())),
60 ints_per_row_(screenshot_->GetBytesPerRow() / 4) {
61 FML_DCHECK(screenshot_->GetBytesPerRow() == ints_per_row_ * 4);
65 const uint32_t*
addr32(
int x,
int y)
const override {
return addr_ + (
y * ints_per_row_) +
x; }
66 size_t width()
const override {
return screenshot_->GetWidth(); }
67 size_t height()
const override {
return screenshot_->GetHeight(); }
68 void write(
const std::string&
path)
const override { screenshot_->WriteToPNG(
path); }
71 std::unique_ptr<impeller::testing::Screenshot> screenshot_;
72 const uint32_t* addr_;
73 const uint32_t ints_per_row_;
80 return sk_make_sp<DlMetalPixelData>(snapshotter_->MakeScreenshot(*aiks_context_,
texture));
91void DlMetalSurfaceProvider::InitScreenShotter()
const {
Developer-facing API for rendering anything within the engine.
Backend implementation of |DlCanvas| for |SkCanvas|.
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
static std::shared_ptr< TypographerContext > Make()
uint32_t uint32_t * format
#define FML_DCHECK(condition)
impeller::testing::MetalScreenshotter MetalScreenshotter
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
std::shared_ptr< Texture > DisplayListToTexture(const sk_sp< flutter::DisplayList > &display_list, ISize size, AiksContext &context, bool reset_host_buffer, bool generate_mips)
Render the provided display list to a texture with the given size.