Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::testing::DisplayListRendering Class Reference
Inheritance diagram for flutter::testing::DisplayListRendering:
flutter::DisplayListOpFlags flutter::DisplayListFlags flutter::testing::DisplayListNopTest

Public Member Functions

 DisplayListRendering ()=default
 

Static Public Member Functions

static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
static const std::vector< BackendType > & GetTestBackends ()
 
static std::unique_ptr< DlSurfaceProviderGetProvider (BackendType type)
 
static void RenderAll (const TestParameters &params, const BoundsTolerance &tolerance=CanvasCompareTester::DefaultTolerance)
 

Additional Inherited Members

- Static Protected Attributes inherited from flutter::DisplayListOpFlags
static constexpr DisplayListAttributeFlags kSaveLayerFlags
 
static constexpr DisplayListAttributeFlags kSaveLayerWithPaintFlags
 
static constexpr DisplayListAttributeFlags kDrawColorFlags
 
static constexpr DisplayListAttributeFlags kDrawPaintFlags
 
static constexpr DisplayListAttributeFlags kDrawHVLineFlags
 
static constexpr DisplayListAttributeFlags kDrawLineFlags
 
static constexpr DisplayListAttributeFlags kDrawRectFlags
 
static constexpr DisplayListAttributeFlags kDrawOvalFlags
 
static constexpr DisplayListAttributeFlags kDrawCircleFlags
 
static constexpr DisplayListAttributeFlags kDrawRRectFlags
 
static constexpr DisplayListAttributeFlags kDrawDRRectFlags
 
static constexpr DisplayListAttributeFlags kDrawRSuperellipseFlags
 
static constexpr DisplayListAttributeFlags kDrawPathFlags
 
static constexpr DisplayListAttributeFlags kDrawArcNoCenterFlags
 
static constexpr DisplayListAttributeFlags kDrawArcWithCenterFlags
 
static constexpr DisplayListAttributeFlags kDrawPointsAsPointsFlags
 
static constexpr DisplayListAttributeFlags kDrawPointsAsLinesFlags
 
static constexpr DisplayListAttributeFlags kDrawPointsAsPolygonFlags
 
static constexpr DisplayListAttributeFlags kDrawVerticesFlags
 
static constexpr DisplayListAttributeFlags kDrawImageFlags
 
static constexpr DisplayListAttributeFlags kDrawImageWithPaintFlags
 
static constexpr DisplayListAttributeFlags kDrawImageRectFlags
 
static constexpr DisplayListAttributeFlags kDrawImageRectWithPaintFlags
 
static constexpr DisplayListAttributeFlags kDrawImageNineFlags
 
static constexpr DisplayListAttributeFlags kDrawImageNineWithPaintFlags
 
static constexpr DisplayListAttributeFlags kDrawAtlasFlags
 
static constexpr DisplayListAttributeFlags kDrawAtlasWithPaintFlags
 
static constexpr DisplayListAttributeFlags kDrawDisplayListFlags
 
static constexpr DisplayListAttributeFlags kDrawTextFlags
 
static constexpr DisplayListAttributeFlags kDrawShadowFlags
 
static constexpr DisplayListAttributeFlags kDrawParagraphFlags
 

Detailed Description

Definition at line 2261 of file dl_rendering_unittests.cc.

Constructor & Destructor Documentation

◆ DisplayListRendering()

flutter::testing::DisplayListRendering::DisplayListRendering ( )
default

Member Function Documentation

◆ GetProvider()

static std::unique_ptr< DlSurfaceProvider > flutter::testing::DisplayListRendering::GetProvider ( BackendType  type)
inlinestatic

Definition at line 2310 of file dl_rendering_unittests.cc.

2310 {
2311 std::unique_ptr<DlSurfaceProvider> provider =
2313 if (provider == nullptr) {
2314 FML_LOG(ERROR) << "provider " << DlSurfaceProvider::BackendName(type)
2315 << " not supported (ignoring)";
2316 return nullptr;
2317 }
2318 provider->InitializeSurface(kTestWidth, kTestHeight,
2319 PixelFormat::kN32Premul);
2320 return provider;
2321 }
static std::string BackendName(BackendType type)
static std::unique_ptr< DlSurfaceProvider > Create(BackendType backend_type)
#define FML_LOG(severity)
Definition logging.h:101
constexpr uint32_t kTestWidth
constexpr uint32_t kTestHeight
impeller::ShaderType type

References flutter::testing::DlSurfaceProvider::BackendName(), flutter::testing::DlSurfaceProvider::Create(), FML_LOG, flutter::testing::kTestHeight, flutter::testing::kTestWidth, and type.

Referenced by RenderAll().

◆ GetTestBackends()

static const std::vector< BackendType > & flutter::testing::DisplayListRendering::GetTestBackends ( )
inlinestatic

Definition at line 2306 of file dl_rendering_unittests.cc.

2306 {
2307 return test_backends_;
2308 }

Referenced by SetUpTestSuite().

◆ RenderAll()

static void flutter::testing::DisplayListRendering::RenderAll ( const TestParameters params,
const BoundsTolerance tolerance = CanvasCompareTester::DefaultTolerance 
)
inlinestatic

Definition at line 2323 of file dl_rendering_unittests.cc.

2325 {
2326 for (BackendType backend : test_backends_) {
2327 std::unique_ptr<DlSurfaceProvider> provider = GetProvider(backend);
2328 CanvasCompareTester::RenderAll(provider, params, tolerance);
2329 }
2330 }
static void RenderAll(const std::unique_ptr< DlSurfaceProvider > &provider, const TestParameters &params, const BoundsTolerance &tolerance=DefaultTolerance)
static std::unique_ptr< DlSurfaceProvider > GetProvider(BackendType type)
const EmbeddedViewParams * params
DlSurfaceProvider::BackendType BackendType

References GetProvider(), params, and flutter::testing::CanvasCompareTester::RenderAll().

◆ SetUpTestSuite()

static void flutter::testing::DisplayListRendering::SetUpTestSuite ( )
inlinestatic

Definition at line 2266 of file dl_rendering_unittests.cc.

2266 {
2267 // Multiple test suites use this test base. Make sure that they don't
2268 // double-register the supported providers.
2269 test_backends_.clear();
2270
2271 std::vector<std::string> args = ::testing::internal::GetArgvs();
2272 fml::CommandLine command_line =
2273 fml::CommandLineFromIterators(args.begin(), args.end());
2274
2275 if (command_line.HasOption("--save-failure-images")) {
2277 }
2278
2279 std::vector<BackendType> enable_backends =
2280 ParseBackendList(command_line.GetOptionValues("enable"));
2281 for (BackendType backend : enable_backends) {
2282 AddProvider(backend);
2283 }
2284
2285 std::vector<BackendType> disable_backends =
2286 ParseBackendList(command_line.GetOptionValues("disable"));
2287 for (BackendType backend : disable_backends) {
2288 RemoveProvider(backend);
2289 }
2290
2291 if (GetTestBackends().empty()) {
2292 AddProvider(BackendType::kSkiaSoftware);
2293 }
2294
2295 std::string providers = "";
2296 for (BackendType back_end : GetTestBackends()) {
2297 providers += " " + DlSurfaceProvider::BackendName(back_end);
2298 }
2299 FML_LOG(INFO) << "Running tests on [" << providers << " ]";
2300 }
static const std::vector< BackendType > & GetTestBackends()
std::vector< std::string_view > GetOptionValues(std::string_view name) const
bool HasOption(std::string_view name, size_t *index=nullptr) const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
CommandLine CommandLineFromIterators(InputIterator first, InputIterator last)

References args, flutter::testing::DlSurfaceProvider::BackendName(), fml::CommandLineFromIterators(), flutter::testing::CanvasCompareTester::EnableSaveImagesOnFailures(), FML_LOG, fml::CommandLine::GetOptionValues(), GetTestBackends(), and fml::CommandLine::HasOption().

◆ TearDownTestSuite()

static void flutter::testing::DisplayListRendering::TearDownTestSuite ( )
inlinestatic

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