5#include "flutter/shell/platform/embedder/tests/embedder_test_compositor.h"
9#include "flutter/fml/logging.h"
10#include "flutter/shell/platform/embedder/tests/embedder_assertions.h"
18 : surface_size_(surface_size), context_(
std::move(context)) {
25 for (
const auto&
callback : callbacks) {
55 std::unique_ptr<EmbedderTestBackingStoreProducer> backingstore_producer) {
65 size_t layers_count) {
68 <<
"Could not update the off-screen composition in the test compositor";
79 callback(view_id, layers, layers_count);
size_t GetBackingStoresCreatedCount() const
void AddOnCreateRenderTargetCallback(const fml::closure &callback)
bool present_callback_is_one_shot_
void AddOnPresentCallback(const fml::closure &callback)
void SetNextSceneCallback(const NextSceneCallback &next_scene_callback)
size_t GetBackingStoresCollectedCount() const
void AddOnCollectRenderTargetCallback(const fml::closure &callback)
std::vector< fml::closure > on_create_render_target_callbacks_
sk_sp< SkImage > GetLastComposition()
std::vector< fml::closure > on_present_callbacks_
EmbedderTestCompositor(SkISize surface_size, sk_sp< GrDirectContext > context)
size_t GetPendingBackingStoresCount() const
std::function< void(FlutterViewId view_id, const FlutterLayer **layers, size_t layers_count)> PresentCallback
bool CollectBackingStore(const FlutterBackingStore *backing_store)
std::function< void(sk_sp< SkImage > image)> NextSceneCallback
std::vector< fml::closure > on_collect_render_target_callbacks_
NextSceneCallback next_scene_callback_
sk_sp< GrDirectContext > GetGrContext()
bool CreateBackingStore(const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out)
void SetNextPresentCallback(const PresentCallback &next_present_callback)
Allows tests to install a callback to notify them when the entire render tree has been finalized so t...
void SetBackingStoreProducer(std::unique_ptr< EmbedderTestBackingStoreProducer > backingstore_producer)
size_t backing_stores_created_
const SkISize surface_size_
bool Present(FlutterViewId view_id, const FlutterLayer **layers, size_t layers_count)
sk_sp< GrDirectContext > context_
PresentCallback present_callback_
virtual bool UpdateOffscrenComposition(const FlutterLayer **layers, size_t layers_count)=0
size_t backing_stores_collected_
sk_sp< SkImage > last_composition_
virtual ~EmbedderTestCompositor()
void SetPresentCallback(const PresentCallback &present_callback, bool one_shot)
std::unique_ptr< EmbedderTestBackingStoreProducer > backingstore_producer_
std::function< sk_sp< SkImage >(const FlutterLayer &layer, GrDirectContext *context)> PlatformViewRendererCallback
PlatformViewRendererCallback platform_view_renderer_callback_
void SetPlatformViewRendererCallback(const PlatformViewRendererCallback &callback)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_LOG(severity)
#define FML_CHECK(condition)
static void InvokeAllCallbacks(const std::vector< fml::closure > &callbacks)
std::function< void()> closure