Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
impeller::ComputePlaygroundTest Class Reference

#include <compute_playground_test.h>

Inheritance diagram for impeller::ComputePlaygroundTest:
impeller::Playground

Public Member Functions

 ComputePlaygroundTest ()
 
virtual ~ComputePlaygroundTest ()
 
void SetUp () override
 
void TearDown () override
 
std::unique_ptr< fml::MappingOpenAssetAsMapping (std::string asset_name) const override
 
std::string GetWindowTitle () const override
 
template<typename T >
std::shared_ptr< DeviceBufferCreateHostVisibleDeviceBuffer (const std::shared_ptr< Context > &context, const std::string &label)
 
- Public Member Functions inherited from impeller::Playground
 Playground (PlaygroundSwitches switches)
 
virtual ~Playground ()
 
void SetupContext (PlaygroundBackend backend, const PlaygroundSwitches &switches)
 
void SetupWindow ()
 
void TeardownWindow ()
 
bool IsPlaygroundEnabled () const
 
Point GetCursorPosition () const
 
ISize GetWindowSize () const
 
Point GetContentScale () const
 
Scalar GetSecondsElapsed () const
 Get the amount of time elapsed from the start of the playground's execution. More...
 
std::shared_ptr< ContextGetContext () const
 
std::shared_ptr< ContextMakeContext () const
 
bool OpenPlaygroundHere (const Renderer::RenderCallback &render_callback)
 
bool OpenPlaygroundHere (SinglePassCallback pass_callback)
 
std::shared_ptr< TextureCreateTextureForFixture (const char *fixture_name, bool enable_mipmapping=false) const
 
std::shared_ptr< TextureCreateTextureCubeForFixture (std::array< const char *, 6 > fixture_names) const
 
virtual std::unique_ptr< fml::MappingOpenAssetAsMapping (std::string asset_name) const =0
 
virtual std::string GetWindowTitle () const =0
 
fml::Status SetCapabilities (const std::shared_ptr< Capabilities > &capabilities)
 
bool WillRenderSomething () const
 

Additional Inherited Members

- Public Types inherited from impeller::Playground
using SinglePassCallback = std::function< bool(RenderPass &pass)>
 
- Static Public Member Functions inherited from impeller::Playground
static bool ShouldOpenNewPlaygrounds ()
 
static std::shared_ptr< CompressedImageLoadFixtureImageCompressed (std::shared_ptr< fml::Mapping > mapping)
 
static std::optional< DecompressedImageDecodeImageRGBA (const std::shared_ptr< CompressedImage > &compressed)
 
static std::shared_ptr< TextureCreateTextureForMapping (const std::shared_ptr< Context > &context, std::shared_ptr< fml::Mapping > mapping, bool enable_mipmapping=false)
 
static bool SupportsBackend (PlaygroundBackend backend)
 
- Protected Member Functions inherited from impeller::Playground
virtual bool ShouldKeepRendering () const
 
void SetWindowSize (ISize size)
 
- Protected Attributes inherited from impeller::Playground
const PlaygroundSwitches switches_
 

Detailed Description

Definition at line 17 of file compute_playground_test.h.

Constructor & Destructor Documentation

◆ ComputePlaygroundTest()

impeller::ComputePlaygroundTest::ComputePlaygroundTest ( )

Definition at line 12 of file compute_playground_test.cc.

13 : Playground(PlaygroundSwitches{flutter::testing::GetArgsForProcess()}) {}
Playground(PlaygroundSwitches switches)
Definition: playground.cc:83
const fml::CommandLine & GetArgsForProcess()
Definition: test_args.cc:12

◆ ~ComputePlaygroundTest()

impeller::ComputePlaygroundTest::~ComputePlaygroundTest ( )
virtualdefault

Member Function Documentation

◆ CreateHostVisibleDeviceBuffer()

template<typename T >
std::shared_ptr< DeviceBuffer > impeller::ComputePlaygroundTest::CreateHostVisibleDeviceBuffer ( const std::shared_ptr< Context > &  context,
const std::string &  label 
)
inline

Definition at line 37 of file compute_playground_test.h.

39 {
40 DeviceBufferDescriptor desc;
41 desc.storage_mode = StorageMode::kHostVisible;
42 desc.size = sizeof(T);
43 auto buffer = context->GetResourceAllocator()->CreateBuffer(desc);
44 buffer->SetLabel(label);
45 return buffer;
46 }
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
Definition: switches.h:126
#define T
Definition: precompiler.cc:65

◆ GetWindowTitle()

std::string impeller::ComputePlaygroundTest::GetWindowTitle ( ) const
overridevirtual

Implements impeller::Playground.

Definition at line 51 of file compute_playground_test.cc.

51 {
53}
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
Definition: testing.cc:15
static std::string FormatWindowTitle(const std::string &test_name)

◆ OpenAssetAsMapping()

std::unique_ptr< fml::Mapping > impeller::ComputePlaygroundTest::OpenAssetAsMapping ( std::string  asset_name) const
overridevirtual

Implements impeller::Playground.

Definition at line 39 of file compute_playground_test.cc.

40 {
42}
std::unique_ptr< fml::Mapping > OpenFixtureAsMapping(const std::string &fixture_name)
Opens a fixture of the given file name and returns a mapping to its contents.
Definition: testing.cc:59

◆ SetUp()

void impeller::ComputePlaygroundTest::SetUp ( )
override

Definition at line 17 of file compute_playground_test.cc.

17 {
18 if (!Playground::SupportsBackend(GetParam())) {
19 GTEST_SKIP_("Playground doesn't support this backend type.");
20 return;
21 }
22
24 GTEST_SKIP_("Skipping due to user action.");
25 return;
26 }
27
28 SetupContext(GetParam(), switches_);
30
31 start_time_ = fml::TimePoint::Now().ToEpochDelta();
32}
TimeDelta ToEpochDelta() const
Definition: time_point.h:52
static TimePoint Now()
Definition: time_point.cc:49
static bool ShouldOpenNewPlaygrounds()
Definition: playground.cc:167
void SetupContext(PlaygroundBackend backend, const PlaygroundSwitches &switches)
Definition: playground.cc:124
const PlaygroundSwitches switches_
Definition: playground.h:118
static bool SupportsBackend(PlaygroundBackend backend)
Definition: playground.cc:100

◆ TearDown()

void impeller::ComputePlaygroundTest::TearDown ( )
override

Definition at line 34 of file compute_playground_test.cc.

34 {
36}

The documentation for this class was generated from the following files: