Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
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 (PlaygroundBackend backend, const PlaygroundSwitches &switches)
 
virtual ~Playground ()
 
bool IsPlaygroundEnabled () const
 
Point GetCursorPosition () const
 
ISize GetWindowSize () const
 
IRect GetWindowBounds () 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
 
ContentContextGetContentContext () const
 
std::shared_ptr< TypographerContextGetTypographerContext () const
 
bool OpenPlaygroundHere (const 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
 Returns true if OpenPlaygroundHere will actually render anything.
 
GLProcAddressResolver CreateGLProcAddressResolver () const
 
VKProcAddressResolver CreateVKProcAddressResolver () const
 
void SetGPUDisabled (bool disabled) const
 Mark the GPU as unavilable.
 
RuntimeStageBackend GetRuntimeStageBackend () const
 

Additional Inherited Members

- Public Types inherited from impeller::Playground
using SinglePassCallback = std::function< bool(RenderPass &pass)>
 
using RenderCallback = std::function< bool(RenderTarget &render_target)>
 
using GLProcAddressResolver = std::function< void *(const char *proc_name)>
 
using VKProcAddressResolver = std::function< void *(void *instance, const char *proc_name)>
 
- 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
void TearDownContextData ()
 
virtual bool ShouldKeepRendering () const
 
virtual void EnsureContextIsUnique ()
 Make sure that when the context is later created that it will not be shared with any other playgrounds.
 
bool PlatformSupportsWideGamutTests () const
 Returns true if the platform can support wide gamuts.
 
virtual bool EnsureContextSupportsWideGamut ()
 Make sure that when the context is later created that it will support wide gamuts if the platform supports it. Returns whether the platform supports wide gamut.
 
virtual void EnsureContextSupportsAntialiasLines ()
 Make sure that when the context is later created that it will support the experimental AA lines flag.
 
const PlaygroundSwitchesGetSwitches () const
 Return an unmodifiable reference to the current switches. The switches might change at the start of a test as it has a brief opportunity to call any of the Ensure* methods that define the environment it expects, but should be stable by the time any subsequent methods that might perform work are called.
 
void SetTypographerContext (std::shared_ptr< TypographerContext > typographer_context)
 
void SetWindowSize (ISize size)
 

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(GetParam(),
14 PlaygroundSwitches{flutter::testing::GetArgsForProcess()}) {}
Playground(PlaygroundBackend backend, const PlaygroundSwitches &switches)
Definition playground.cc:90
const fml::CommandLine & GetArgsForProcess()
Definition test_args.cc:11

◆ ~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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98
std::shared_ptr< ContextGLES > context

References context, impeller::kHostVisible, impeller::DeviceBufferDescriptor::size, and impeller::DeviceBufferDescriptor::storage_mode.

◆ GetWindowTitle()

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

Implements impeller::Playground.

Definition at line 49 of file compute_playground_test.cc.

49 {
51}
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:14
static std::string FormatWindowTitle(const std::string &test_name)

References impeller::FormatWindowTitle(), and flutter::testing::GetCurrentTestName().

◆ OpenAssetAsMapping()

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

Implements impeller::Playground.

Definition at line 37 of file compute_playground_test.cc.

38 {
40}
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:58

References flutter::testing::OpenFixtureAsMapping().

◆ SetUp()

void impeller::ComputePlaygroundTest::SetUp ( )
override

Definition at line 18 of file compute_playground_test.cc.

18 {
19 if (!Playground::SupportsBackend(GetParam())) {
20 GTEST_SKIP() << "Playground doesn't support this backend type.";
21 return;
22 }
23
25 GTEST_SKIP() << "Skipping due to user action.";
26 return;
27 }
28
29 start_time_ = fml::TimePoint::Now().ToEpochDelta();
30}
constexpr TimeDelta ToEpochDelta() const
Definition time_point.h:52
static TimePoint Now()
Definition time_point.cc:49
static bool ShouldOpenNewPlaygrounds()
static bool SupportsBackend(PlaygroundBackend backend)

References fml::TimePoint::Now(), impeller::Playground::ShouldOpenNewPlaygrounds(), impeller::Playground::SupportsBackend(), and fml::TimePoint::ToEpochDelta().

◆ TearDown()

void impeller::ComputePlaygroundTest::TearDown ( )
override

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