Flutter Engine
 
Loading...
Searching...
No Matches
flutter::testing::DisplayListRenderingTestBase< BaseT > Class Template Reference
Inheritance diagram for flutter::testing::DisplayListRenderingTestBase< BaseT >:
flutter::DisplayListOpFlags flutter::DisplayListFlags flutter::testing::DisplayListNopTest

Public Member Functions

 DisplayListRenderingTestBase ()=default
 

Static Public Member Functions

static bool StartsWith (std::string str, std::string prefix)
 
static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 

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

template<typename BaseT>
class flutter::testing::DisplayListRenderingTestBase< BaseT >

Definition at line 2821 of file dl_rendering_unittests.cc.

Constructor & Destructor Documentation

◆ DisplayListRenderingTestBase()

template<typename BaseT >
flutter::testing::DisplayListRenderingTestBase< BaseT >::DisplayListRenderingTestBase ( )
default

Member Function Documentation

◆ SetUpTestSuite()

template<typename BaseT >
static void flutter::testing::DisplayListRenderingTestBase< BaseT >::SetUpTestSuite ( )
inlinestatic

Definition at line 2838 of file dl_rendering_unittests.cc.

2838 {
2839 bool do_software = true;
2840 bool do_opengl = false;
2841 bool do_metal = false;
2842 std::vector<std::string> args = ::testing::internal::GetArgvs();
2843 for (auto p_arg = std::next(args.begin()); p_arg != args.end(); p_arg++) {
2844 std::string arg = *p_arg;
2845 bool enable = true;
2846 if (arg == "--save-impeller-failures") {
2848 continue;
2849 }
2850 if (StartsWith(arg, "--no")) {
2851 enable = false;
2852 arg = "-" + arg.substr(4);
2853 } else if (StartsWith(arg, "--disable")) {
2854 enable = false;
2855 arg = "--en" + arg.substr(5);
2856 }
2857 if (arg == "--enable-software") {
2858 do_software = enable;
2859 } else if (arg == "--enable-opengl" || arg == "--enable-gl") {
2860 do_opengl = enable;
2861 } else if (arg == "--enable-metal") {
2862 do_metal = enable;
2863 } else if (arg == "--enable-impeller") {
2865 }
2866 }
2867 // Multiple test suites use this test base. Make sure that they don't
2868 // double-register the supported providers.
2870 if (do_software) {
2871 CanvasCompareTester::AddProvider(BackendType::kSoftwareBackend);
2872 }
2873 if (do_opengl) {
2874 CanvasCompareTester::AddProvider(BackendType::kOpenGlBackend);
2875 }
2876 if (do_metal) {
2877 CanvasCompareTester::AddProvider(BackendType::kMetalBackend);
2878 }
2879 std::string providers = "";
2880 for (auto& back_end : CanvasCompareTester::TestBackends) {
2881 providers += " " + DlSurfaceProvider::BackendName(back_end);
2882 }
2883 std::string libraries = " Skia";
2886 libraries += " Impeller";
2887 }
2888 FML_LOG(INFO) << "Running tests on [" << providers //
2889 << " ], and [" << libraries << " ]";
2890 }
static bool StartsWith(std::string str, std::string prefix)
static std::string BackendName(BackendType type)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define FML_LOG(severity)
Definition logging.h:101

References flutter::testing::CanvasCompareTester::AddProvider(), args, flutter::testing::DlSurfaceProvider::BackendName(), flutter::testing::CanvasCompareTester::ClearProviders(), flutter::testing::RenderEnvironment::EnableImpeller, FML_LOG, flutter::testing::CanvasCompareTester::ImpellerSupported, flutter::testing::CanvasCompareTester::SaveImpellerFailureImages, flutter::testing::DisplayListRenderingTestBase< BaseT >::StartsWith(), and flutter::testing::CanvasCompareTester::TestBackends.

◆ StartsWith()

template<typename BaseT >
static bool flutter::testing::DisplayListRenderingTestBase< BaseT >::StartsWith ( std::string  str,
std::string  prefix 
)
inlinestatic

Definition at line 2826 of file dl_rendering_unittests.cc.

2826 {
2827 if (prefix.length() > str.length()) {
2828 return false;
2829 }
2830 for (size_t i = 0; i < prefix.length(); i++) {
2831 if (str[i] != prefix[i]) {
2832 return false;
2833 }
2834 }
2835 return true;
2836 }

References i.

Referenced by flutter::testing::DisplayListRenderingTestBase< BaseT >::SetUpTestSuite().

◆ TearDownTestSuite()

template<typename BaseT >
static void flutter::testing::DisplayListRenderingTestBase< BaseT >::TearDownTestSuite ( )
inlinestatic

Definition at line 2892 of file dl_rendering_unittests.cc.

2892 {
2894 FML_LOG(INFO);
2896 << " images saved in "
2898 for (const auto& filename : CanvasCompareTester::ImpellerFailureImages) {
2899 FML_LOG(INFO) << " " << filename;
2900 }
2901 FML_LOG(INFO);
2902 }
2903 }
static std::vector< std::string > ImpellerFailureImages
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size

References FML_LOG, flutter::testing::CanvasCompareTester::ImpellerFailureImageDirectory, flutter::testing::CanvasCompareTester::ImpellerFailureImages, and flutter::size.


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