Public Types | |
| enum class | DirectoryStatus { kExisted , kCreated , kFailed } |
Static Public Member Functions | |
| static void | EnableSaveImagesOnFailures () |
| static void | PrintFailureImageFileNames () |
| static void | RenderAll (const std::unique_ptr< DlSurfaceProvider > &provider, const TestParameters ¶ms, const BoundsTolerance &tolerance=DefaultTolerance) |
| static void | RenderWithSaveRestore (const TestParameters &testP, const RenderEnvironment &env, const BoundsTolerance &tolerance) |
| static void | RenderWithAttributes (const TestParameters &testP, const RenderEnvironment &env, const BoundsTolerance &tolerance) |
| static void | RenderWithStrokes (const TestParameters &testP, const RenderEnvironment &env, const BoundsTolerance &tolerance_in) |
| static void | RenderWithTransforms (const TestParameters &testP, const RenderEnvironment &env, const BoundsTolerance &tolerance) |
| static void | RenderWithClips (const TestParameters &testP, const RenderEnvironment &env, const BoundsTolerance &diff_tolerance) |
| static DirectoryStatus | CheckDir (const std::string &dir) |
| static void | SetupFailureImageDirectory () |
| static void | save_to_png (const RenderResult &result, const std::string &op_desc, const std::string &reason) |
| static void | RenderWith (const TestParameters &testP, const RenderEnvironment &env, const BoundsTolerance &tolerance_in, const CaseParameters &caseP) |
| static bool | fuzzyCompare (uint32_t pixel_a, uint32_t pixel_b, int fudge) |
| static int | groupOpacityFudgeFactor (const RenderEnvironment &env) |
| static void | checkGroupOpacity (const RenderEnvironment &env, const sk_sp< DisplayList > &display_list, const RenderResult &ref_result, const std::string &info, DlColor bg) |
| static bool | checkPixels (const RenderResult &ref_result, const DlRect ref_bounds, const std::string &info, const DlColor bg=DlColor::kTransparent()) |
| static int | countModifiedTransparentPixels (const RenderResult &ref_result, const RenderResult &test_result) |
| static bool | quickCompareToReference (const RenderResult &ref_result, const RenderResult &test_result, bool should_match, const std::string &info) |
| static void | compareToReference (const RenderResult &test_result, const RenderResult &ref_result, const std::string &info, const DlRect *bounds, const BoundsTolerance *tolerance, const DlColor bg, bool fuzzyCompares=false, uint32_t width=kTestWidth, uint32_t height=kTestHeight, bool printMismatches=false) |
| static void | showBoundsOverflow (const std::string &info, DlIRect &bounds, const BoundsTolerance *tolerance, int pixLeft, int pixTop, int pixRight, int pixBottom) |
Static Public Attributes | |
| static BoundsTolerance | DefaultTolerance |
Definition at line 908 of file dl_rendering_unittests.cc.
|
strong |
| Enumerator | |
|---|---|
| kExisted | |
| kCreated | |
| kFailed | |
Definition at line 1804 of file dl_rendering_unittests.cc.
|
inlinestatic |
Definition at line 1810 of file dl_rendering_unittests.cc.
References FML_LOG, fml::UniqueObject< T, Traits >::get(), fml::UniqueObject< T, Traits >::is_valid(), kCreated, kExisted, kFailed, fml::kRead, fml::kReadWrite, and fml::OpenDirectory().
Referenced by SetupFailureImageDirectory().
|
inlinestatic |
Definition at line 2004 of file dl_rendering_unittests.cc.
References flutter::DlColor::argb(), flutter::testing::RenderJobInfo::bg, FML_LOG, flutter::testing::RenderEnvironment::GetResult(), groupOpacityFudgeFactor(), i, flutter::testing::kTestHeight, flutter::testing::kTestWidth, flutter::testing::RenderResult::pixel_data, x, and y.
Referenced by RenderWith().
|
inlinestatic |
Definition at line 2072 of file dl_rendering_unittests.cc.
References impeller::TRect< T >::Contains(), flutter::testing::kTestHeight, flutter::testing::kTestWidth, flutter::testing::RenderResult::pixel_data, impeller::TRect< T >::RoundOut(), x, and y.
Referenced by RenderWith().
|
inlinestatic |
Definition at line 2145 of file dl_rendering_unittests.cc.
References impeller::TRect< T >::Contains(), FML_LOG, fuzzyCompare(), height, impeller::TRect< T >::MakeLTRB(), impeller::TRect< T >::MakeWH(), flutter::testing::RenderResult::pixel_data, impeller::TRect< T >::RoundOut(), showBoundsOverflow(), width, x, and y.
Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
inlinestatic |
Definition at line 2098 of file dl_rendering_unittests.cc.
References flutter::testing::kTestHeight, flutter::testing::kTestWidth, flutter::testing::RenderResult::pixel_data, x, and y.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
inlinestatic |
Definition at line 915 of file dl_rendering_unittests.cc.
Referenced by flutter::testing::DisplayListRendering::SetUpTestSuite().
|
inlinestatic |
Definition at line 1981 of file dl_rendering_unittests.cc.
References i.
Referenced by compareToReference().
|
inlinestatic |
Definition at line 1992 of file dl_rendering_unittests.cc.
References flutter::testing::DlSurfaceProvider::GetBackendType(), flutter::testing::RenderEnvironment::GetPixelFormat(), and flutter::testing::RenderEnvironment::GetProvider().
Referenced by checkGroupOpacity().
|
inlinestatic |
Definition at line 917 of file dl_rendering_unittests.cc.
References FML_LOG.
Referenced by flutter::testing::DisplayListRendering::TearDownTestSuite().
|
inlinestatic |
Definition at line 2115 of file dl_rendering_unittests.cc.
References FML_LOG, flutter::h, flutter::testing::RenderResult::pixel_data, x, and y.
Referenced by RenderWith(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
inlinestatic |
Definition at line 932 of file dl_rendering_unittests.cc.
References flutter::testing::RenderEnvironment::InitializeReference(), flutter::testing::kEmptyDlSetup, flutter::testing::RenderEnvironment::MakeN32(), params, RenderWithAttributes(), RenderWithClips(), RenderWithSaveRestore(), and RenderWithTransforms().
Referenced by flutter::testing::DisplayListRendering::RenderAll().
|
inlinestatic |
Run a suite of tests on the indicated parameters to determine if the output matches various expectations, including:
testP - The parameters of the basic rendering operation being tested such as DrawRect, DrawPath, DrawText, etc. env - The parameters of the test environment for this suite of tests such as the Surface Provider that determines which backend is being used. tolerance_in - A first approximation of how tight the bounds might be for the indicated test and case parameters. Some issues that might require a higher bounds tolerance would include the fact that text glyphs do not consume most of their measured bounds, or that antialiasing is enabled which allows pixels outside the theoretical bounds of the operation's geometry to be rendered. caseP - The parameters under which the test is being rendered, which includes information such as transform, clip, and attributes.
Definition at line 1900 of file dl_rendering_unittests.cc.
References flutter::testing::RenderJobInfo::bg, flutter::testing::CaseParameters::bg(), checkGroupOpacity(), checkPixels(), flutter::testing::TestParameters::dl_renderer(), flutter::testing::CaseParameters::dl_restore(), flutter::testing::CaseParameters::dl_setup(), FML_LOG, flutter::testing::RenderEnvironment::GetBackendName(), flutter::testing::RenderEnvironment::GetReferenceResult(), flutter::testing::RenderEnvironment::GetResult(), flutter::testing::DlJobRenderer::GetSetupPaint(), flutter::testing::CaseParameters::info(), flutter::testing::kTestHeight, flutter::testing::kTestWidth, flutter::testing::DlJobRenderer::MakeDisplayList(), flutter::testing::RenderResult::pixel_data, quickCompareToReference(), save_to_png(), and flutter::testing::TestParameters::should_match().
Referenced by RenderWithAttributes(), RenderWithClips(), RenderWithSaveRestore(), RenderWithStrokes(), RenderWithTransforms(), and flutter::testing::TEST_F().
|
inlinestatic |
Definition at line 1171 of file dl_rendering_unittests.cc.
References flutter::testing::BoundsTolerance::addBoundsPadding(), flutter::testing::DlSetupContext::canvas, flutter::testing::TestParameters::dl_renderer(), flutter::testing::DlSetupContext::env, impeller::TRect< T >::GetLeftTop(), flutter::testing::RenderEnvironment::GetProvider(), impeller::TRect< T >::GetRightBottom(), flutter::testing::RenderEnvironment::GetTestImage(), flutter::testing::RenderEnvironment::InitializeReference(), flutter::DlColor::kBlue(), flutter::kClamp, flutter::DlColor::kCyan(), flutter::kDecal, flutter::DlColor::kGreen(), flutter::kMirror, flutter::kNormal, flutter::testing::kRenderBounds, flutter::DlColor::kWhite(), flutter::DlColor::kYellow(), flutter::testing::MakeColorSource(), flutter::DlColorSource::MakeLinear(), flutter::DlColorFilter::MakeMatrix(), flutter::testing::RenderEnvironment::MakeN32(), flutter::testing::DlSetupContext::paint, RenderWith(), RenderWithStrokes(), flutter::DlPaint::setAntiAlias(), flutter::DlPaint::setBlendMode(), flutter::DlPaint::setColor(), flutter::DlPaint::setColorFilter(), flutter::DlPaint::setColorSource(), flutter::DlPaint::setImageFilter(), flutter::DlPaint::setInvertColors(), flutter::DlPaint::setMaskFilter(), flutter::DlPaint::setStrokeWidth(), flutter::DlCanvas::Translate(), and flutter::DlColor::withAlpha().
Referenced by RenderAll().
|
inlinestatic |
Definition at line 1681 of file dl_rendering_unittests.cc.
References flutter::DlPathBuilder::AddCircle(), flutter::testing::BoundsTolerance::addPostClipPadding(), flutter::DlPathBuilder::AddRect(), flutter::testing::DlSetupContext::canvas, flutter::testing::BoundsTolerance::clip(), flutter::DlCanvas::ClipOval(), flutter::DlCanvas::ClipPath(), flutter::DlCanvas::ClipRect(), flutter::DlCanvas::ClipRoundRect(), impeller::TRect< T >::Expand(), flutter::kDifference, flutter::kIntersect, flutter::testing::kRenderBounds, flutter::testing::kRenderCenterX, flutter::testing::kRenderCenterY, impeller::RoundRect::MakeRectXY(), RenderWith(), flutter::DlPathBuilder::SetFillType(), and flutter::DlPathBuilder::TakePath().
Referenced by RenderAll().
|
inlinestatic |
Definition at line 947 of file dl_rendering_unittests.cc.
References flutter::testing::DlSetupContext::canvas, flutter::DlCanvas::ClipRect(), flutter::testing::TestParameters::dl_renderer(), flutter::DlCanvas::DrawPaint(), flutter::DlCanvas::DrawRect(), flutter::testing::DlSetupContext::env, impeller::TRect< T >::Expand(), flutter::DlPaint::getAlpha(), flutter::testing::RenderEnvironment::GetProvider(), flutter::testing::RenderEnvironment::GetTestImage(), flutter::testing::RenderEnvironment::InitializeReference(), flutter::DlColor::kCyan(), flutter::kDecal, flutter::kIntersect, flutter::testing::kRenderBounds, flutter::testing::kRenderCenterX, flutter::testing::kRenderCenterY, flutter::DlImageFilter::MakeColorFilter(), flutter::testing::MakeColorSource(), flutter::DlColorFilter::MakeMatrix(), flutter::testing::RenderEnvironment::MakeN32(), impeller::TRect< Scalar >::MakeXYWH(), p2, flutter::testing::DlSetupContext::paint, RenderWith(), flutter::DlCanvas::Restore(), flutter::DlCanvas::Save(), flutter::DlCanvas::SaveLayer(), flutter::DlPaint::setAlpha(), flutter::DlPaint::setColor(), flutter::DlPaint::setColorFilter(), flutter::DlPaint::setColorSource(), flutter::DlPaint::setImageFilter(), flutter::DlPaint::setStrokeWidth(), and flutter::DlColor::withAlpha().
Referenced by RenderAll().
|
inlinestatic |
Definition at line 1449 of file dl_rendering_unittests.cc.
References flutter::testing::BoundsTolerance::addBoundsPadding(), flutter::testing::TestParameters::dl_renderer(), flutter::testing::DlSurfaceProvider::GetBackendType(), flutter::testing::RenderEnvironment::GetProvider(), flutter::testing::RenderEnvironment::InitializeReference(), flutter::testing::TestParameters::is_draw_path(), flutter::kBevel, flutter::kFill, flutter::kMiter, flutter::kRound, flutter::kSquare, flutter::kStroke, flutter::testing::RenderEnvironment::MakeN32(), flutter::testing::DlSetupContext::paint, RenderWith(), flutter::DlPaint::setDrawStyle(), flutter::DlPaint::setStrokeCap(), flutter::DlPaint::setStrokeJoin(), flutter::DlPaint::setStrokeMiter(), and flutter::DlPaint::setStrokeWidth().
Referenced by RenderWithAttributes().
|
inlinestatic |
Definition at line 1582 of file dl_rendering_unittests.cc.
References flutter::testing::DlSetupContext::canvas, flutter::testing::kRenderCenterX, flutter::testing::kRenderCenterY, impeller::Matrix::MakeRotationX(), impeller::Matrix::MakeRotationY(), impeller::Matrix::MakeRow(), flutter::testing::BoundsTolerance::mulScale(), RenderWith(), flutter::DlCanvas::Rotate(), flutter::DlCanvas::Scale(), flutter::DlCanvas::Skew(), flutter::DlCanvas::Transform(), flutter::DlCanvas::Transform2DAffine(), flutter::DlCanvas::TransformFullPerspective(), impeller::Matrix::Translate(), and flutter::DlCanvas::Translate().
Referenced by RenderAll().
|
inlinestatic |
Definition at line 1851 of file dl_rendering_unittests.cc.
References FML_LOG, flutter::testing::RenderResult::pixel_data, and SetupFailureImageDirectory().
Referenced by RenderWith().
|
inlinestatic |
Definition at line 1827 of file dl_rendering_unittests.cc.
References CheckDir(), FML_LOG, i, kCreated, kExisted, and kFailed.
Referenced by save_to_png().
|
inlinestatic |
Definition at line 2212 of file dl_rendering_unittests.cc.
References impeller::TRect< T >::Area(), impeller::TSize< T >::Area(), FML_LOG, impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetSize(), impeller::TRect< T >::GetTop(), impeller::TSize< T >::height, impeller::TRect< T >::MakeLTRB(), flutter::testing::BoundsTolerance::overflows(), and impeller::TSize< T >::width.
Referenced by compareToReference().
|
static |
Definition at line 930 of file dl_rendering_unittests.cc.
Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().