Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
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 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 kDrawTextBlobFlags
 
static constexpr DisplayListAttributeFlags kDrawShadowFlags
 

Detailed Description

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

Definition at line 2709 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 2726 of file dl_rendering_unittests.cc.

2726 {
2727 bool do_software = true;
2728 bool do_opengl = false;
2729 bool do_metal = false;
2730 std::vector<std::string> args = ::testing::internal::GetArgvs();
2731 for (auto p_arg = std::next(args.begin()); p_arg != args.end(); p_arg++) {
2732 std::string arg = *p_arg;
2733 bool enable = true;
2734 if (arg == "--save-impeller-failures") {
2736 continue;
2737 }
2738 if (StartsWith(arg, "--no")) {
2739 enable = false;
2740 arg = "-" + arg.substr(4);
2741 } else if (StartsWith(arg, "--disable")) {
2742 enable = false;
2743 arg = "--en" + arg.substr(5);
2744 }
2745 if (arg == "--enable-software") {
2746 do_software = enable;
2747 } else if (arg == "--enable-opengl" || arg == "--enable-gl") {
2748 do_opengl = enable;
2749 } else if (arg == "--enable-metal") {
2750 do_metal = enable;
2751 } else if (arg == "--enable-impeller") {
2753 }
2754 }
2755 // Multiple test suites use this test base. Make sure that they don't
2756 // double-register the supported providers.
2758 if (do_software) {
2759 CanvasCompareTester::AddProvider(BackendType::kSoftwareBackend);
2760 }
2761 if (do_opengl) {
2762 CanvasCompareTester::AddProvider(BackendType::kOpenGlBackend);
2763 }
2764 if (do_metal) {
2765 CanvasCompareTester::AddProvider(BackendType::kMetalBackend);
2766 }
2767 std::string providers = "";
2768 for (auto& back_end : CanvasCompareTester::TestBackends) {
2769 providers += " " + DlSurfaceProvider::BackendName(back_end);
2770 }
2771 std::string libraries = " Skia";
2774 libraries += " Impeller";
2775 }
2776 FML_LOG(INFO) << "Running tests on [" << providers //
2777 << " ], and [" << libraries << " ]";
2778 }
static float next(float f)
static std::vector< BackendType > TestBackends
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:82

◆ StartsWith()

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

Definition at line 2714 of file dl_rendering_unittests.cc.

2714 {
2715 if (prefix.length() > str.length()) {
2716 return false;
2717 }
2718 for (size_t i = 0; i < prefix.length(); i++) {
2719 if (str[i] != prefix[i]) {
2720 return false;
2721 }
2722 }
2723 return true;
2724 }

◆ TearDownTestSuite()

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

Definition at line 2780 of file dl_rendering_unittests.cc.

2780 {
2782 FML_LOG(INFO);
2784 << " images saved in "
2786 for (const auto& filename : CanvasCompareTester::ImpellerFailureImages) {
2787 FML_LOG(INFO) << " " << filename;
2788 }
2789 FML_LOG(INFO);
2790 }
2791 }
static std::vector< std::string > ImpellerFailureImages
it will be possible to load the file into Perfetto s trace viewer 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
Definition: switches.h:259

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