27 {
29
31
35 image_info,
36 1,
38 nullptr,
39 false
40 );
41
43 FML_LOG(
ERROR) <<
"Could not update the off-screen composition.";
44 return false;
45 }
46
47 auto canvas =
surface->getCanvas();
48
49
50
52
53 for (size_t i = 0; i < layers_count; ++i) {
54 const auto* layer = layers[i];
55
57
60
61 switch (layer->type) {
63 layer_image =
64 reinterpret_cast<EmbedderTestBackingStoreProducer::UserData*>(
65 layer->backing_store->user_data)
67 break;
69 layer_image =
72 : nullptr;
74 break;
75 };
76
77
78
80 FML_LOG(
ERROR) <<
"Could not snapshot layer in test compositor: "
81 << *layer;
82 return false;
83 }
84
85
86
87 if (layer_image) {
88
89
90 canvas->drawImage(layer_image.
get(), canvas_offset.
x(),
92 }
93 }
94
96
98 FML_LOG(
ERROR) <<
"Could not update the contents of the sub-composition.";
99 return false;
100 }
101
107 callback(std::move(last_composition_snapshot));
108 }
109
110 return true;
111}
@ kTopLeft_GrSurfaceOrigin
constexpr SkColor SK_ColorTRANSPARENT
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
NextSceneCallback next_scene_callback_
const SkISize surface_size_
sk_sp< GrDirectContext > context_
sk_sp< SkImage > last_composition_
PlatformViewRendererCallback platform_view_renderer_callback_
@ kFlutterLayerContentTypePlatformView
Indicates that the contents of this layer are determined by the embedder.
@ kFlutterLayerContentTypeBackingStore
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_LOG(severity)
#define FML_CHECK(condition)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
constexpr int32_t y() const
static constexpr SkIPoint Make(int32_t x, int32_t y)
constexpr int32_t x() const
static SkImageInfo MakeN32Premul(int width, int height)