10#include "third_party/skia/include/core/SkSurface.h"
28 std::make_unique<EmbedderTestBackingStoreProducerSoftware>(
36 FML_LOG(FATAL) <<
"Unsupported render target type: "
37 <<
static_cast<int>(
type);
42bool EmbedderTestCompositorSoftware::UpdateOffscrenComposition(
49 auto surface = SkSurfaces::Raster(image_info);
52 FML_LOG(ERROR) <<
"Could not update the off-screen composition.";
56 auto canvas =
surface->getCanvas();
60 canvas->clear(SK_ColorTRANSPARENT);
65 sk_sp<SkImage> platform_rendered_contents;
67 sk_sp<SkImage> layer_image;
68 SkIPoint canvas_offset = SkIPoint::Make(0, 0);
70 switch (layer->type) {
80 canvas_offset = SkIPoint::Make(layer->offset.x, layer->offset.y);
87 FML_LOG(ERROR) <<
"Could not snapshot layer in test compositor: "
97 canvas->drawImage(layer_image.get(), canvas_offset.x(),
105 FML_LOG(ERROR) <<
"Could not update the contents of the sub-composition.";
110 auto last_composition_snapshot =
115 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_
EmbedderTestCompositorSoftware(DlISize surface_size)
~EmbedderTestCompositorSoftware() override
void SetRenderTargetType(EmbedderTestBackingStoreProducer::RenderTargetType type, FlutterSoftwarePixelFormat software_pixfmt) override
@ 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)