Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
 
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
 
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 19 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:82
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 39 of file compute_playground_test.h.

41 {
42 DeviceBufferDescriptor desc;
43 desc.storage_mode = StorageMode::kHostVisible;
44 desc.size = sizeof(T);
45 auto buffer = context->GetResourceAllocator()->CreateBuffer(desc);
46 buffer->SetLabel(label);
47 return buffer;
48 }
static const uint8_t buffer[]
#define T

◆ 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()
void SetupContext(PlaygroundBackend backend, const PlaygroundSwitches &switches)
const PlaygroundSwitches switches_
Definition playground.h:120
static bool SupportsBackend(PlaygroundBackend backend)
Definition playground.cc:99

◆ 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: