5#include "flutter/common/task_runners.h"
6#include "flutter/fml/mapping.h"
7#include "flutter/fml/synchronization/waitable_event.h"
8#include "flutter/impeller/core/allocator.h"
9#include "flutter/impeller/core/device_buffer.h"
10#include "flutter/impeller/geometry/size.h"
11#include "flutter/impeller/renderer/context.h"
12#include "flutter/lib/ui/painting/image_decoder.h"
13#include "flutter/lib/ui/painting/image_decoder_impeller.h"
14#include "flutter/lib/ui/painting/image_decoder_no_gl_unittests.h"
15#include "flutter/lib/ui/painting/image_decoder_skia.h"
16#include "flutter/lib/ui/painting/multi_frame_codec.h"
17#include "flutter/runtime/dart_vm.h"
18#include "flutter/runtime/dart_vm_lifecycle.h"
19#include "flutter/testing/dart_isolate_runner.h"
20#include "flutter/testing/elf_loader.h"
21#include "flutter/testing/fixture_test.h"
22#include "flutter/testing/post_task_sync.h"
23#include "flutter/testing/test_dart_native_resolver.h"
24#include "flutter/testing/test_gl_surface.h"
25#include "flutter/testing/testing.h"
48 bool IsValid()
const override {
return true; }
55 return std::make_shared<TestImpellerAllocator>();
84 std::shared_ptr<const Capabilities> capabilities_;
95 bool has_gpu_context =
true)
97 impeller_context_(
std::make_shared<
impeller::TestImpellerContext>()),
98 gl_context_(has_gpu_context ? gl_surface_.CreateGrContext() : nullptr),
99 weak_gl_context_factory_(
106 fml::TimeDelta::FromNanoseconds(0),
108 runner_(task_runner),
109 is_gpu_disabled_sync_switch_(
std::make_shared<
fml::SyncSwitch>()),
110 weak_factory_(this) {
112 <<
"The IO manager must be initialized its primary task runner. The "
113 "test harness may not be set up correctly/safely.";
114 weak_prototype_ = weak_factory_.GetWeakPtr();
120 [&latch,
queue = unref_queue_]() {
129 return weak_prototype_;
134 return weak_gl_context_factory_ ? weak_gl_context_factory_->GetWeakPtr()
146 return is_gpu_disabled_sync_switch_;
151 return impeller_context_;
155 is_gpu_disabled_sync_switch_->SetSwitch(disabled);
162 std::shared_ptr<impeller::Context> impeller_context_;
164 std::unique_ptr<fml::WeakPtrFactory<GrDirectContext>>
165 weak_gl_context_factory_;
169 std::shared_ptr<fml::SyncSwitch> is_gpu_disabled_sync_switch_;
189 TestIOManager manager(runners.GetIOTaskRunner());
191 auto decoder = ImageDecoder::Make(settings, runners, loop->GetTaskRunner(),
192 manager.GetWeakIOManager(),
193 std::make_shared<fml::SyncSwitch>());
194 ASSERT_NE(decoder, nullptr);
220 unsigned int frame_index,
221 std::optional<unsigned int> prior_frame) {
240 thread_task_runner->PostTask([&]() {
245 std::make_shared<fml::SyncSwitch>());
251 fml::MakeRefCounted<ImageDescriptor>(
252 std::move(
data), std::make_unique<UnknownImageGenerator>());
255 const std::string& decode_error) {
260 decoder->Decode(image_descriptor, 0, 0,
callback);
276 std::unique_ptr<TestIOManager> io_manager;
278 auto release_io_manager = [&]() {
282 auto decode_image = [&]() {
285 settings, runners, loop->GetTaskRunner(),
286 io_manager->GetWeakIOManager(), std::make_shared<fml::SyncSwitch>());
291 ASSERT_GE(
data->size(), 0u);
294 std::shared_ptr<ImageGenerator> generator =
296 ASSERT_TRUE(generator);
298 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(
299 std::move(
data), std::move(generator));
302 const std::string& decode_error) {
305 EXPECT_TRUE(io_manager->did_access_is_gpu_disabled_sync_switch_);
308 EXPECT_FALSE(io_manager->did_access_is_gpu_disabled_sync_switch_);
309 image_decoder->Decode(descriptor, descriptor->width(), descriptor->height(),
313 auto set_up_io_manager_and_decode = [&]() {
314 io_manager = std::make_unique<TestIOManager>(runners.
GetIOTaskRunner());
323#if !IMPELLER_SUPPORTS_RENDERING
324 GTEST_SKIP() <<
"Impeller only test.";
327 auto no_gpu_access_context =
328 std::make_shared<impeller::TestImpellerContext>();
329 auto gpu_disabled_switch = std::make_shared<fml::SyncSwitch>(
true);
333 auto bitmap = std::make_shared<SkBitmap>();
337 auto buffer = std::make_shared<impeller::TestImpellerDeviceBuffer>(
desc);
341 ASSERT_EQ(no_gpu_access_context->command_buffer_count_, 0ul);
342 ASSERT_EQ(
result.second,
"");
345 no_gpu_access_context,
bitmap, gpu_disabled_switch,
347 ASSERT_EQ(no_gpu_access_context->command_buffer_count_, 0ul);
348 ASSERT_EQ(
result.second,
"");
358 ASSERT_TRUE(
image !=
nullptr);
362 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(
365#if IMPELLER_SUPPORTS_RENDERING
366 std::shared_ptr<impeller::Allocator> allocator =
367 std::make_shared<impeller::TestImpellerAllocator>();
368 std::optional<DecompressResult> decompressed =
372 ASSERT_TRUE(decompressed.has_value());
374 ASSERT_EQ(decompressed->image_info.colorSpace(),
nullptr);
385 ASSERT_TRUE(
image !=
nullptr);
389 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(
392#if IMPELLER_SUPPORTS_RENDERING
393 std::shared_ptr<impeller::Allocator> allocator =
394 std::make_shared<impeller::TestImpellerAllocator>();
395 std::optional<DecompressResult> decompressed =
400 ASSERT_TRUE(decompressed.has_value());
402 ASSERT_EQ(decompressed->image_info.colorSpace(),
nullptr);
409 ASSERT_TRUE(
image !=
nullptr);
413 std::shared_ptr<ImageGenerator> generator =
415 ASSERT_TRUE(generator);
417 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(std::move(
data),
418 std::move(generator));
420#if IMPELLER_SUPPORTS_RENDERING
421 std::shared_ptr<impeller::Allocator> allocator =
422 std::make_shared<impeller::TestImpellerAllocator>();
423 std::optional<DecompressResult> wide_result =
428 ASSERT_TRUE(wide_result.has_value());
430 ASSERT_TRUE(wide_result->image_info.colorSpace()->isSRGB());
432 const SkPixmap& wide_pixmap = wide_result->sk_bitmap->pixmap();
433 const uint32_t* pixel_ptr =
static_cast<const uint32_t*
>(wide_pixmap.
addr());
434 bool found_deep_red =
false;
435 for (
int i = 0;
i < wide_pixmap.
width() * wide_pixmap.
height(); ++
i) {
436 uint32_t pixel = *pixel_ptr++;
440 if (fabsf(red - 1.0931f) < 0.01f && fabsf(green - -0.2268f) < 0.01f &&
441 fabsf(blue - -0.1501f) < 0.01f) {
442 found_deep_red =
true;
446 ASSERT_TRUE(found_deep_red);
448 std::optional<DecompressResult> narrow_result =
453 ASSERT_TRUE(narrow_result.has_value());
461 ASSERT_TRUE(
image !=
nullptr);
465 std::shared_ptr<ImageGenerator> generator =
467 ASSERT_TRUE(generator);
469 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(std::move(
data),
470 std::move(generator));
472#if IMPELLER_SUPPORTS_RENDERING
473 std::shared_ptr<impeller::Allocator> allocator =
474 std::make_shared<impeller::TestImpellerAllocator>();
475 std::optional<DecompressResult>
result =
480 ASSERT_TRUE(
result.has_value());
496 std::unique_ptr<IOManager> io_manager;
498 auto release_io_manager = [&]() {
504 auto decode_image = [&]() {
507 settings, runners, loop->GetTaskRunner(),
508 io_manager->GetWeakIOManager(), std::make_shared<fml::SyncSwitch>());
513 ASSERT_GE(
data->size(), 0u);
516 std::shared_ptr<ImageGenerator> generator =
518 ASSERT_TRUE(generator);
520 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(
521 std::move(
data), std::move(generator));
524 const std::string& decode_error) {
530 image_decoder->Decode(descriptor, descriptor->width(), descriptor->height(),
534 auto set_up_io_manager_and_decode = [&]() {
535 io_manager = std::make_unique<TestIOManager>(runners.
GetIOTaskRunner());
543 ASSERT_EQ(decoded_size.
width(), 600);
544 ASSERT_EQ(decoded_size.
height(), 200);
558 std::unique_ptr<IOManager> io_manager;
560 auto release_io_manager = [&]() {
565 auto decode_image = [&]() {
568 settings, runners, loop->GetTaskRunner(),
569 io_manager->GetWeakIOManager(), std::make_shared<fml::SyncSwitch>());
574 ASSERT_GE(
data->size(), 0u);
577 std::shared_ptr<ImageGenerator> generator =
579 ASSERT_TRUE(generator);
581 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(
582 std::move(
data), std::move(generator));
585 const std::string& decode_error) {
590 image_decoder->Decode(descriptor, descriptor->width(), descriptor->height(),
594 auto set_up_io_manager_and_decode = [&]() {
606 const auto image_dimensions =
611 ASSERT_FALSE(image_dimensions.isEmpty());
613 ASSERT_NE(image_dimensions.width(), image_dimensions.height());
624 std::unique_ptr<IOManager> io_manager;
625 std::unique_ptr<ImageDecoder> image_decoder;
629 io_manager = std::make_unique<TestIOManager>(runners.GetIOTaskRunner());
635 image_decoder = ImageDecoder::Make(settings, runners, loop->GetTaskRunner(),
636 io_manager->GetWeakIOManager(),
637 std::make_shared<fml::SyncSwitch>());
641 auto decoded_size = [&](uint32_t target_width,
642 uint32_t target_height) ->
SkISize {
648 ASSERT_GE(
data->size(), 0u);
651 std::shared_ptr<ImageGenerator> generator =
653 ASSERT_TRUE(generator);
655 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(
656 std::move(
data), std::move(generator));
665 image_decoder->Decode(descriptor, target_width, target_height,
callback);
672 ASSERT_EQ(decoded_size(3024, 4032), image_dimensions);
685 VerifyCodecRepeatCountsForGifAndWebPAreConsistentWithLoopCounts) {
690 ASSERT_TRUE(gif_mapping);
691 ASSERT_TRUE(webp_mapping);
698 ASSERT_TRUE(gif_generator);
699 ASSERT_TRUE(webp_generator);
702 ASSERT_EQ(gif_generator->GetPlayCount(),
static_cast<unsigned int>(2));
703 ASSERT_EQ(webp_generator->GetPlayCount(),
static_cast<unsigned int>(2));
706TEST(ImageDecoderTest, VerifySimpleDecoding) {
709 ASSERT_TRUE(
image !=
nullptr);
714 std::shared_ptr<ImageGenerator> generator =
716 ASSERT_TRUE(generator);
718 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(std::move(
data),
719 std::move(generator));
722 ASSERT_EQ(compressed_image->width(), 6);
723 ASSERT_EQ(compressed_image->height(), 2);
726#if IMPELLER_SUPPORTS_RENDERING
727 std::shared_ptr<impeller::Allocator> allocator =
728 std::make_shared<impeller::TestImpellerAllocator>();
732 ASSERT_EQ(result_1.sk_bitmap->width(), 6);
733 ASSERT_EQ(result_1.sk_bitmap->height(), 2);
738 ASSERT_EQ(result_2.sk_bitmap->width(), 10);
739 ASSERT_EQ(result_2.sk_bitmap->height(), 10);
743TEST(ImageDecoderTest, ImagesWithTransparencyArePremulAlpha) {
747 std::shared_ptr<ImageGenerator> generator =
749 ASSERT_TRUE(generator);
751 auto descriptor = fml::MakeRefCounted<ImageDescriptor>(std::move(
data),
752 std::move(generator));
755 ASSERT_TRUE(compressed_image);
756 ASSERT_EQ(compressed_image->width(), 250);
757 ASSERT_EQ(compressed_image->height(), 250);
761TEST(ImageDecoderTest, VerifySubpixelDecodingPreservesExifOrientation) {
765 std::shared_ptr<ImageGenerator> generator =
767 ASSERT_TRUE(generator);
769 fml::MakeRefCounted<ImageDescriptor>(
data, std::move(generator));
773 ASSERT_EQ(600, descriptor->width());
774 ASSERT_EQ(200, descriptor->height());
777 ASSERT_TRUE(
image !=
nullptr);
781 auto decode = [descriptor](uint32_t target_width, uint32_t target_height) {
783 descriptor.get(), target_width, target_height,
788 ASSERT_TRUE(expected_data !=
nullptr);
789 ASSERT_FALSE(expected_data->isEmpty());
791 auto assert_image = [&](
auto decoded_image,
const std::string& decode_error) {
792 ASSERT_EQ(decoded_image->dimensions(),
SkISize::Make(300, 100));
795 ASSERT_TRUE(encoded->
equals(expected_data.get()));
798 assert_image(
decode(300, 100), {});
802 MultiFrameCodecCanBeCollectedBeforeIOTasksFinish) {
816 auto settings = CreateSettingsForFixture();
818 auto vm_data = vm_ref.GetVMData();
822 ASSERT_TRUE(gif_mapping);
825 std::shared_ptr<ImageGenerator> gif_generator =
827 ASSERT_TRUE(gif_generator);
837 std::unique_ptr<TestIOManager> io_manager;
841 io_manager = std::make_unique<TestIOManager>(runners.GetIOTaskRunner());
846 io_manager->GetWeakIOManager());
852 fml::AutoResetWaitableEvent isolate_latch;
853 fml::RefPtr<MultiFrameCodec> codec;
854 EXPECT_TRUE(isolate->RunInIsolateScope([&]() -> bool {
855 Dart_Handle library = Dart_RootLibrary();
856 if (Dart_IsError(library)) {
857 isolate_latch.Signal();
860 Dart_Handle closure =
861 Dart_GetField(library, Dart_NewStringFromCString(
"frameCallback"));
862 if (Dart_IsError(closure) || !Dart_IsClosure(closure)) {
863 isolate_latch.Signal();
867 codec = fml::MakeRefCounted<MultiFrameCodec>(std::move(gif_generator));
868 codec->getNextFrame(closure);
870 isolate_latch.Signal();
873 isolate_latch.Wait();
881 PostTaskSync(runners.GetIOTaskRunner(), [&]() { io_manager.reset(); });
885 auto settings = CreateSettingsForFixture();
887 auto vm_data = vm_ref.GetVMData();
891 ASSERT_TRUE(gif_mapping);
894 std::shared_ptr<ImageGenerator> gif_generator =
896 ASSERT_TRUE(gif_generator);
905 std::unique_ptr<TestIOManager> io_manager;
914 AddNativeCallback(
"ValidateFrameCallback",
918 io_manager = std::make_unique<TestIOManager>(runners.GetIOTaskRunner());
923 io_manager->GetWeakIOManager());
926 fml::AutoResetWaitableEvent isolate_latch;
928 EXPECT_TRUE(isolate->RunInIsolateScope([&]() -> bool {
929 Dart_Handle library = Dart_RootLibrary();
930 if (Dart_IsError(library)) {
931 isolate_latch.Signal();
934 Dart_Handle closure =
935 Dart_GetField(library, Dart_NewStringFromCString(
"frameCallback"));
936 if (Dart_IsError(closure) || !Dart_IsClosure(closure)) {
937 isolate_latch.Signal();
941 EXPECT_FALSE(io_manager->did_access_is_gpu_disabled_sync_switch_);
942 codec = fml::MakeRefCounted<MultiFrameCodec>(std::move(gif_generator));
943 codec->getNextFrame(closure);
944 isolate_latch.Signal();
947 isolate_latch.Wait();
951 EXPECT_TRUE(io_manager->did_access_is_gpu_disabled_sync_switch_);
960 PostTaskSync(runners.GetUITaskRunner(), [&]() { codec = nullptr; });
963 PostTaskSync(runners.GetIOTaskRunner(), [&]() { io_manager.reset(); });
967 MultiFrameCodecProducesATextureEvenIfGPUIsDisabledOnImpeller) {
968 auto settings = CreateSettingsForFixture();
971 auto vm_data = vm_ref.GetVMData();
975 ASSERT_TRUE(gif_mapping);
978 std::shared_ptr<ImageGenerator> gif_generator =
980 ASSERT_TRUE(gif_generator);
989 std::unique_ptr<TestIOManager> io_manager;
998 AddNativeCallback(
"ValidateFrameCallback",
1003 io_manager = std::make_unique<TestIOManager>(runners.GetIOTaskRunner());
1005 io_manager->SetGpuDisabled(true);
1010 io_manager->GetWeakIOManager());
1013 fml::AutoResetWaitableEvent isolate_latch;
1015 EXPECT_TRUE(isolate->RunInIsolateScope([&]() -> bool {
1016 Dart_Handle library = Dart_RootLibrary();
1017 if (Dart_IsError(library)) {
1018 isolate_latch.Signal();
1021 Dart_Handle closure =
1022 Dart_GetField(library, Dart_NewStringFromCString(
"frameCallback"));
1023 if (Dart_IsError(closure) || !Dart_IsClosure(closure)) {
1024 isolate_latch.Signal();
1028 EXPECT_FALSE(io_manager->did_access_is_gpu_disabled_sync_switch_);
1029 codec = fml::MakeRefCounted<MultiFrameCodec>(std::move(gif_generator));
1030 codec->getNextFrame(closure);
1031 isolate_latch.Signal();
1034 isolate_latch.Wait();
1038 EXPECT_TRUE(io_manager->did_access_is_gpu_disabled_sync_switch_);
1047 PostTaskSync(runners.GetUITaskRunner(), [&]() { codec = nullptr; });
1050 PostTaskSync(runners.GetIOTaskRunner(), [&]() { io_manager.reset(); });
1054 auto context = std::make_shared<impeller::TestImpellerContext>();
1057 EXPECT_FALSE(allocator.allocPixelRef(
nullptr));
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static sk_sp< Effect > Create()
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
@ kBGR_101010x_XR_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
static sk_sp< SkData > MakeWithoutCopy(const void *data, size_t length)
bool equals(const SkData *other) const
const SkImageInfo & imageInfo() const
SkColorSpace * colorSpace() const
SkISize dimensions() const
const void * addr() const
static DartVMRef Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< const DartSnapshot > isolate_snapshot=nullptr)
static std::pair< sk_sp< DlImage >, std::string > UploadTextureToStorage(const std::shared_ptr< impeller::Context > &context, std::shared_ptr< SkBitmap > bitmap, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch, impeller::StorageMode storage_mode, bool create_mips=true)
Create a host visible texture from the provided bitmap.
static std::pair< sk_sp< DlImage >, std::string > UploadTextureToPrivate(const std::shared_ptr< impeller::Context > &context, const std::shared_ptr< impeller::DeviceBuffer > &buffer, const SkImageInfo &image_info, const std::shared_ptr< SkBitmap > &bitmap, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch)
Create a device private texture from the provided host buffer. This method is only suported on the me...
static DecompressResult DecompressTexture(ImageDescriptor *descriptor, SkISize target_size, impeller::ISize max_texture_size, bool supports_wide_gamut, const std::shared_ptr< impeller::Allocator > &allocator)
static sk_sp< SkImage > ImageFromCompressedData(ImageDescriptor *descriptor, uint32_t target_width, uint32_t target_height, const fml::tracing::TraceFlow &flow)
std::function< void(sk_sp< DlImage >, std::string)> ImageResult
static std::unique_ptr< ImageDecoder > Make(const Settings &settings, const TaskRunners &runners, std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner, fml::WeakPtr< IOManager > io_manager, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch)
Keeps a priority-ordered registry of image generator builders to be used when decoding images....
std::shared_ptr< ImageGenerator > CreateCompatibleGenerator(const sk_sp< SkData > &buffer)
Walks the list of image generator builders in descending priority order until a compatible ImageGener...
The minimal interface necessary for defining a decoder that can be used for both single and multi-fra...
fml::RefPtr< fml::TaskRunner > GetUITaskRunner() const
fml::RefPtr< fml::TaskRunner > GetIOTaskRunner() const
fml::RefPtr< flutter::SkiaUnrefQueue > GetSkiaUnrefQueue() const override
std::shared_ptr< const fml::SyncSwitch > GetIsGpuDisabledSyncSwitch() override
~TestIOManager() override
void SetGpuDisabled(bool disabled)
fml::WeakPtr< IOManager > GetWeakIOManager() const override
std::shared_ptr< impeller::Context > GetImpellerContext() const override
bool did_access_is_gpu_disabled_sync_switch_
TestIOManager(const fml::RefPtr< fml::TaskRunner > &task_runner, bool has_gpu_context=true)
fml::WeakPtr< GrDirectContext > GetResourceContext() const override
An Image generator that pretends it can't recognize the data it was given.
const SkImageInfo & GetInfo()
Returns basic information about the contents of the encoded image. This information can almost always...
unsigned int GetPlayCount() const
The number of times an animated image should play through before playback stops.
const ImageGenerator::FrameInfo GetFrameInfo(unsigned int frame_index)
Get information about a single frame in the context of a multi-frame image, useful for animation and ...
bool GetPixels(const SkImageInfo &info, void *pixels, size_t row_bytes, unsigned int frame_index, std::optional< unsigned int > prior_frame)
Decode the image into a given buffer. This method is currently always used for sub-pixel image decodi...
~UnknownImageGenerator()=default
SkISize GetScaledDimensions(float scale)
Given a scale value, find the closest image size that can be used for efficiently decoding the image....
unsigned int GetFrameCount() const
Get the number of frames that the encoded image stores. This method is always expected to be called b...
static std::shared_ptr< ConcurrentMessageLoop > Create(size_t worker_count=std::thread::hardware_concurrency())
static void RunNowOrPostTask(const fml::RefPtr< fml::TaskRunner > &runner, const fml::closure &task)
virtual void PostTask(const fml::closure &task) override
virtual bool RunsTasksOnCurrentThread()
To do anything rendering related with Impeller, you need a context.
std::shared_ptr< CommandQueue > GetCommandQueue() const override
Return the graphics queue for submitting command buffers.
std::shared_ptr< ShaderLibrary > GetShaderLibrary() const override
Returns the library of shaders used to specify the programmable stages of a pipeline.
std::shared_ptr< PipelineLibrary > GetPipelineLibrary() const override
Returns the library of pipelines used by render or compute commands.
void Shutdown() override
Force all pending asynchronous work to finish. This is achieved by deleting all owned concurrent mess...
std::shared_ptr< Allocator > GetResourceAllocator() const override
Returns the allocator used to create textures and buffers on the device.
bool IsValid() const override
Determines if a context is valid. If the caller ever receives an invalid context, they must discard i...
const std::shared_ptr< const Capabilities > & GetCapabilities() const override
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
std::string DescribeGpuModel() const override
TestImpellerContext()=default
BackendType GetBackendType() const override
Get the graphics backend of an Impeller context.
size_t command_buffer_count_
std::shared_ptr< CommandBuffer > CreateCommandBuffer() const override
Create a new command buffer. Command buffers can be used to encode graphics, blit,...
std::shared_ptr< SamplerLibrary > GetSamplerLibrary() const override
Returns the library of combined image samplers used in shaders.
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
struct _Dart_NativeArguments * Dart_NativeArguments
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_CHECK(condition)
#define FML_UNREACHABLE()
fml::RefPtr< fml::TaskRunner > CreateNewThread(const std::string &name)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
sk_sp< const SkImage > image
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
TEST_F(DisplayListTest, Defaults)
void PostTaskSync(const fml::RefPtr< fml::TaskRunner > &task_runner, const std::function< void()> &function)
std::string GetDefaultKernelFilePath()
Returns the default path to kernel_blob.bin. This file is within the directory returned by GetFixture...
float DecodeBGR10(uint32_t x)
sk_sp< SkData > OpenFixtureAsSkData(const std::string &fixture_name)
Opens a fixture of the given file name and returns a Skia SkData holding its contents.
std::unique_ptr< AutoIsolateShutdown > RunDartCodeInIsolate(DartVMRef &vm_ref, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &kernel_file_path, fml::WeakPtr< IOManager > io_manager, std::shared_ptr< VolatilePathTracker > volatile_path_tracker, std::unique_ptr< PlatformConfiguration > platform_configuration)
TEST_F(ImageDecoderFixtureTest, NullCheckBuffer)
TEST(DisplayListComplexity, EmptyDisplayList)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
TEST_F(EngineAnimatorTest, AnimatorAcceptsMultipleRenders)
RefPtr< T > MakeRefCounted(Args &&... args)
const myers::Point & get(const myers::Segment &)
static DecodeResult decode(std::string path)
static constexpr SkISize MakeEmpty()
static constexpr SkISize Make(int32_t w, int32_t h)
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
Info about a single frame in the context of a multi-frame image, useful for animation and blending.
#define CREATE_NATIVE_ENTRY(native_entry)
#define EXPECT_TRUE(handle)