5#include "flutter/shell/platform/embedder/embedder_surface_software.h"
9#include "flutter/fml/trace_event.h"
20 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder)
21 : software_dispatch_table_(
std::move(software_dispatch_table)),
22 external_view_embedder_(
std::move(external_view_embedder)) {
32bool EmbedderSurfaceSoftware::IsValid()
const {
37std::unique_ptr<Surface> EmbedderSurfaceSoftware::CreateGPUSurface() {
41 const bool render_to_surface = !external_view_embedder_;
42 auto surface = std::make_unique<GPUSurfaceSoftware>(
this, render_to_surface);
59 TRACE_EVENT0(
"flutter",
"EmbedderSurfaceSoftware::AcquireBackingStore");
62 <<
"Could not acquire backing store for the software surface.";
66 if (sk_surface_ !=
nullptr &&
76 if (sk_surface_ ==
nullptr) {
77 FML_LOG(
ERROR) <<
"Could not create backing store for software rendering.";
85bool EmbedderSurfaceSoftware::PresentBackingStore(
88 FML_LOG(
ERROR) <<
"Tried to present an invalid software surface.";
94 FML_LOG(
ERROR) <<
"Could not peek the pixels of the backing store.";
99 uint64_t expected_pixmap_data_size = pixmap.
width() * pixmap.
height() * 4;
103 if (expected_pixmap_data_size != pixmap_size) {
104 FML_LOG(
ERROR) <<
"Software backing store had unexpected size.";
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
static sk_sp< SkColorSpace > MakeSRGB()
size_t computeByteSize() const
const void * addr() const
bool peekPixels(SkPixmap *pixmap)
~EmbedderSurfaceSoftware() override
EmbedderSurfaceSoftware(SoftwareDispatchTable software_dispatch_table, std::shared_ptr< EmbedderExternalViewEmbedder > external_view_embedder)
#define FML_LOG(severity)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)
std::function< bool(const void *allocation, size_t row_bytes, size_t height)> software_present_backing_store
#define TRACE_EVENT0(category_group, name)