12#include "third_party/skia/include/core/SkSurface.h"
13#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
19 sk_sp<GrDirectContext> context)
30 std::make_unique<EmbedderTestBackingStoreProducerMetal>(
context_,
type);
38 FML_LOG(FATAL) <<
"Unsupported render target type: " <<
static_cast<int>(
type);
43bool EmbedderTestCompositorMetal::UpdateOffscrenComposition(
const FlutterLayer**
layers,
53 kTopLeft_GrSurfaceOrigin,
59 FML_LOG(ERROR) <<
"Could not update the off-screen composition.";
63 auto canvas =
surface->getCanvas();
67 canvas->clear(SK_ColorTRANSPARENT);
72 sk_sp<SkImage> platform_rendered_contents;
74 sk_sp<SkImage> layer_image;
75 SkIPoint canvas_offset = SkIPoint::Make(0, 0);
77 switch (layer->type) {
80 reinterpret_cast<SkSurface*
>(layer->backing_store->user_data)->makeImageSnapshot();
86 canvas_offset = SkIPoint::Make(layer->offset.x, layer->offset.y);
93 FML_LOG(ERROR) <<
"Could not snapshot layer in test compositor: " << *layer;
102 canvas->drawImage(layer_image.get(), canvas_offset.x(), canvas_offset.y());
109 FML_LOG(ERROR) <<
"Could not update the contents of the sub-composition.";
118 callback(std::move(last_composition_snapshot));
const DlISize surface_size_
NextSceneCallback next_scene_callback_
sk_sp< GrDirectContext > context_
sk_sp< SkImage > last_composition_
std::unique_ptr< EmbedderTestBackingStoreProducer > backingstore_producer_
PlatformViewRendererCallback platform_view_renderer_callback_
@ kFlutterLayerContentTypePlatformView
Indicates that the contents of this layer are determined by the embedder.
@ kFlutterLayerContentTypeBackingStore
FlutterSoftwarePixelFormat
const FlutterLayer size_t layers_count
const FlutterLayer ** layers
FlutterDesktopBinaryReply callback
#define FML_LOG(severity)
#define FML_CHECK(condition)
const SkISize & ToSkISize(const DlISize &size)