12#include "third_party/skia/include/core/SkSurface.h"
13#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
20 sk_sp<GrDirectContext> context)
31 std::make_unique<EmbedderTestBackingStoreProducerVulkan>(
context_,
40 FML_LOG(FATAL) <<
"Unsupported render target type: "
41 <<
static_cast<int>(
type);
46bool EmbedderTestCompositorVulkan::UpdateOffscrenComposition(
54 SkSurfaces::RenderTarget(
context_.get(),
58 kTopLeft_GrSurfaceOrigin,
64 FML_LOG(ERROR) <<
"Could not update the off-screen composition.";
68 auto canvas =
surface->getCanvas();
72 canvas->clear(SK_ColorTRANSPARENT);
77 sk_sp<SkImage> platform_rendered_contents;
79 sk_sp<SkImage> layer_image;
80 SkIPoint canvas_offset = SkIPoint::Make(0, 0);
82 switch (layer->type) {
92 canvas_offset = SkIPoint::Make(layer->offset.x, layer->offset.y);
99 FML_LOG(ERROR) <<
"Could not snapshot layer in test compositor: "
109 canvas->drawImage(layer_image.get(), canvas_offset.x(),
117 FML_LOG(ERROR) <<
"Could not update the contents of the sub-composition.";
122 auto last_composition_snapshot =
127 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_
EmbedderTestCompositorVulkan(DlISize surface_size, sk_sp< GrDirectContext > context)
void SetRenderTargetType(EmbedderTestBackingStoreProducer::RenderTargetType type, FlutterSoftwarePixelFormat software_pixfmt) override
~EmbedderTestCompositorVulkan() 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)