5#include "flutter/shell/platform/embedder/tests/embedder_test_compositor_software.h"
7#include "flutter/fml/logging.h"
8#include "flutter/shell/platform/embedder/tests/embedder_assertions.h"
20bool EmbedderTestCompositorSoftware::UpdateOffscrenComposition(
22 size_t layers_count) {
30 FML_LOG(
ERROR) <<
"Could not update the off-screen composition.";
34 auto canvas =
surface->getCanvas();
40 for (
size_t i = 0;
i < layers_count; ++
i) {
41 const auto* layer = layers[
i];
48 switch (layer->type) {
51 reinterpret_cast<SkSurface*
>(layer->backing_store->user_data)
52 ->makeImageSnapshot();
66 FML_LOG(
ERROR) <<
"Could not snapshot layer in test compositor: "
76 canvas->drawImage(layer_image.
get(), canvas_offset.
x(),
84 FML_LOG(
ERROR) <<
"Could not update the contents of the sub-composition.";
93 callback(std::move(last_composition_snapshot));
constexpr SkColor SK_ColorTRANSPARENT
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
~EmbedderTestCompositorSoftware() override
EmbedderTestCompositorSoftware(SkISize surface_size)
NextSceneCallback next_scene_callback_
const SkISize surface_size_
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 > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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)