Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Typedefs | Functions | Variables
display_list_unittests.cc File Reference
#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_blend_mode.h"
#include "flutter/display_list/dl_builder.h"
#include "flutter/display_list/dl_paint.h"
#include "flutter/display_list/geometry/dl_rtree.h"
#include "flutter/display_list/skia/dl_sk_dispatcher.h"
#include "flutter/display_list/testing/dl_test_snippets.h"
#include "flutter/display_list/utils/dl_receiver_utils.h"
#include "flutter/fml/logging.h"
#include "flutter/fml/math.h"
#include "flutter/testing/assertions_skia.h"
#include "flutter/testing/display_list_testing.h"
#include "flutter/testing/testing.h"
#include "third_party/skia/include/core/SkBBHFactory.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/core/SkRSXform.h"
#include "third_party/skia/include/core/SkSurface.h"

Go to the source code of this file.

Classes

class  flutter::testing::DisplayListTestBase< BaseT >
 
class  flutter::testing::SaveLayerExpector
 
struct  flutter::testing::SaveLayerExpector::Expectations
 
class  flutter::testing::SaveLayerBoundsExpector
 
class  flutter::testing::DepthExpector
 
class  flutter::testing::ClipExpector
 
struct  flutter::testing::ClipExpector::Expectation
 

Namespaces

namespace  flutter
 
namespace  flutter::testing
 

Macros

#define RUN_TESTS(body)    run_tests(#body, [](DlOpReceiver& receiver) { body }, true, false)
 
#define RUN_TESTS2(body, expect)    run_tests(#body, [](DlOpReceiver& receiver) { body }, expect, expect)
 
#define TEST_RTREE(rtree, query, expected_rects, expected_indices)    test_rtree(rtree, query, expected_rects, expected_indices, __FILE__, __LINE__)
 
#define CLIP_EXPECTOR(name)   ClipExpector name(__FILE__, __LINE__)
 

Typedefs

using flutter::testing::ClipOp = DlCanvas::ClipOp
 
using flutter::testing::PointMode = DlCanvas::PointMode
 
using flutter::testing::DisplayListTest = DisplayListTestBase<::testing::Test >
 

Functions

DlOpReceiver & flutter::DisplayListBuilderTestingAccessor (DisplayListBuilder &builder)
 
DlPaint flutter::DisplayListBuilderTestingAttributes (DisplayListBuilder &builder)
 
int flutter::DisplayListBuilderTestingLastOpIndex (DisplayListBuilder &builder)
 
 flutter::testing::TEST_F (DisplayListTest, Defaults)
 
 flutter::testing::TEST_F (DisplayListTest, EmptyBuild)
 
 flutter::testing::TEST_F (DisplayListTest, EmptyRebuild)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderCanBeReused)
 
 flutter::testing::TEST_F (DisplayListTest, SaveRestoreRestoresTransform)
 
 flutter::testing::TEST_F (DisplayListTest, BuildRestoresTransform)
 
 flutter::testing::TEST_F (DisplayListTest, SaveRestoreRestoresClip)
 
 flutter::testing::TEST_F (DisplayListTest, BuildRestoresClip)
 
 flutter::testing::TEST_F (DisplayListTest, BuildRestoresAttributes)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderBoundsTransformComparedToSkia)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderInitialClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderInitialClipBoundsNaN)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderClipBoundsAfterClipRect)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderClipBoundsAfterClipRRect)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderClipBoundsAfterClipPath)
 
 flutter::testing::TEST_F (DisplayListTest, BuilderInitialClipBoundsNonZero)
 
 flutter::testing::TEST_F (DisplayListTest, UnclippedSaveLayerContentAccountsForFilter)
 
 flutter::testing::TEST_F (DisplayListTest, ClippedSaveLayerContentAccountsForFilter)
 
 flutter::testing::TEST_F (DisplayListTest, OOBSaveLayerContentCulledWithBlurFilter)
 
 flutter::testing::TEST_F (DisplayListTest, OOBSaveLayerContentCulledWithMatrixFilter)
 
 flutter::testing::TEST_F (DisplayListTest, SingleOpSizes)
 
 flutter::testing::TEST_F (DisplayListTest, SingleOpDisplayListsNotEqualEmpty)
 
 flutter::testing::TEST_F (DisplayListTest, SingleOpDisplayListsRecapturedAreEqual)
 
 flutter::testing::TEST_F (DisplayListTest, SingleOpDisplayListsCompareToEachOther)
 
 flutter::testing::TEST_F (DisplayListTest, SingleOpDisplayListsAreEqualWithOrWithoutRtree)
 
 flutter::testing::TEST_F (DisplayListTest, FullRotationsAreNop)
 
 flutter::testing::TEST_F (DisplayListTest, AllBlendModeNops)
 
 flutter::testing::TEST_F (DisplayListTest, DisplayListsWithVaryingOpComparisons)
 
 flutter::testing::TEST_F (DisplayListTest, DisplayListSaveLayerBoundsWithAlphaFilter)
 
 flutter::testing::TEST_F (DisplayListTest, NestedOpCountMetricsSameAsSkPicture)
 
 flutter::testing::TEST_F (DisplayListTest, DisplayListFullPerspectiveTransformHandling)
 
 flutter::testing::TEST_F (DisplayListTest, DisplayListTransformResetHandling)
 
 flutter::testing::TEST_F (DisplayListTest, SingleOpsMightSupportGroupOpacityBlendMode)
 
 flutter::testing::TEST_F (DisplayListTest, OverlappingOpsDoNotSupportGroupOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, LineOfNonOverlappingOpsSupportGroupOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, CrossOfNonOverlappingOpsSupportGroupOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerFalseSupportsGroupOpacityOverlappingChidren)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerTrueSupportsGroupOpacityOverlappingChidren)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerFalseWithSrcBlendSupportsGroupOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerTrueWithSrcBlendDoesNotSupportGroupOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerFalseSupportsGroupOpacityWithChildSrcBlend)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerTrueSupportsGroupOpacityWithChildSrcBlend)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsSnapshotsImageFilter)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerOneSimpleOpInheritsOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerNoAttributesInheritsOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerTwoOverlappingOpsDoesNotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, NestedSaveLayersMightInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, NestedSaveLayersCanBothSupportOpacityOptimization)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerImageFilterDoesNotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerColorFilterDoesNotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerSrcBlendDoesNotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerImageFilterOnChildInheritsOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerColorFilterOnChildDoesNotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerSrcBlendOnChildDoesNotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, FlutterSvgIssue661BoundsWereEmpty)
 
 flutter::testing::TEST_F (DisplayListTest, TranslateAffectsCurrentTransform)
 
 flutter::testing::TEST_F (DisplayListTest, ScaleAffectsCurrentTransform)
 
 flutter::testing::TEST_F (DisplayListTest, RotateAffectsCurrentTransform)
 
 flutter::testing::TEST_F (DisplayListTest, SkewAffectsCurrentTransform)
 
 flutter::testing::TEST_F (DisplayListTest, TransformAffectsCurrentTransform)
 
 flutter::testing::TEST_F (DisplayListTest, FullTransformAffectsCurrentTransform)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectDoAAAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectAffectsClipBoundsWithMatrix)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRRectAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRRectDoAAAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRRectAffectsClipBoundsWithMatrix)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathDoAAAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathAffectsClipBoundsWithMatrix)
 
 flutter::testing::TEST_F (DisplayListTest, DiffClipRectDoesNotAffectClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, DiffClipRRectDoesNotAffectClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, DiffClipPathDoesNotAffectClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathWithInvertFillTypeDoesNotAffectClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, DiffClipPathWithInvertFillTypeAffectsClipBounds)
 
 flutter::testing::TEST_F (DisplayListTest, FlatDrawPointsProducesBounds)
 
static void flutter::testing::test_rtree (const sk_sp< const DlRTree > &rtree, const SkRect &query, std::vector< SkRect > expected_rects, const std::vector< int > &expected_indices, const std::string &file, int line)
 
 flutter::testing::TEST_F (DisplayListTest, RTreeOfSimpleScene)
 
 flutter::testing::TEST_F (DisplayListTest, RTreeOfSaveRestoreScene)
 
 flutter::testing::TEST_F (DisplayListTest, RTreeOfSaveLayerFilterScene)
 
 flutter::testing::TEST_F (DisplayListTest, NestedDisplayListRTreesAreSparse)
 
 flutter::testing::TEST_F (DisplayListTest, RemoveUnnecessarySaveRestorePairs)
 
 flutter::testing::TEST_F (DisplayListTest, CollapseMultipleNestedSaveRestore)
 
 flutter::testing::TEST_F (DisplayListTest, CollapseNestedSaveAndSaveLayerRestore)
 
 flutter::testing::TEST_F (DisplayListTest, RemoveUnnecessarySaveRestorePairsInSetPaint)
 
 flutter::testing::TEST_F (DisplayListTest, TransformTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, Transform2DTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, TransformPerspectiveTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, ResetTransformTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, SkewTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, TranslateTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, ScaleTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRRectTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathTriggersDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPTranslateDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPScaleDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPRotationDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPSkewDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPTransformDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPTransform2DDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPTransformFullPerspectiveDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, NOPClipDoesNotTriggerDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, RTreeOfClippedSaveLayerFilterScene)
 
 flutter::testing::TEST_F (DisplayListTest, RTreeRenderCulling)
 
 flutter::testing::TEST_F (DisplayListTest, DrawSaveDrawCannotInheritOpacity)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedRect)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedRoundRect)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedOval)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedRectangularPath)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedOvalPath)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedRoundRectPathCW)
 
 flutter::testing::TEST_F (DisplayListTest, DrawUnorderedRoundRectPathCCW)
 
 flutter::testing::TEST_F (DisplayListTest, NopOperationsOmittedFromRecords)
 
 flutter::testing::TEST_F (DisplayListTest, ImpellerPathPreferenceIsHonored)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfMaskBlurredRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfImageBlurredRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfStrokedRect)
 
 flutter::testing::TEST_F (DisplayListTest, TranslatedSaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, ScaledSaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, RotatedSaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, TransformResetSaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfTranslatedSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfScaledSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfRotatedSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfNestedSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, FloodingSaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, NestedFloodingSaveLayerBoundsComputationOfSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfFloodingImageFilter)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsComputationOfFloodingColorFilter)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsClipDetectionSimpleUnclippedRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveLayerBoundsClipDetectionSimpleClippedRect)
 
 flutter::testing::TEST_F (DisplayListTest, SaveContentDepthTest)
 
 flutter::testing::TEST_F (DisplayListTest, FloodingFilteredLayerPushesRestoreOpIndex)
 
 flutter::testing::TEST_F (DisplayListTest, TransformingFilterSaveLayerSimpleContentBounds)
 
 flutter::testing::TEST_F (DisplayListTest, TransformingFilterSaveLayerFloodedContentBounds)
 
 flutter::testing::TEST_F (DisplayListTest, OpacityIncompatibleRenderOpInsideDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeEmptyDisplayList)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeInsideNonDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeInsideDeferredSave)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeInsideSaveLayer)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeInsideNonDefaultBlendedSaveLayer)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeInsideComplexDeferredSaves)
 
 flutter::testing::TEST_F (DisplayListTest, MaxBlendModeInsideComplexSaveLayers)
 
 flutter::testing::TEST_F (DisplayListTest, BackdropDetectionEmptyDisplayList)
 
 flutter::testing::TEST_F (DisplayListTest, BackdropDetectionSimpleRect)
 
 flutter::testing::TEST_F (DisplayListTest, BackdropDetectionSimpleSaveLayer)
 
 flutter::testing::TEST_F (DisplayListTest, BackdropDetectionNestedSaveLayer)
 
 flutter::testing::TEST_F (DisplayListTest, DrawDisplayListForwardsMaxBlend)
 
 flutter::testing::TEST_F (DisplayListTest, DrawDisplayListForwardsBackdropFlag)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectCullingPixel6a)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectNonCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectNestedCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectNestedNonCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectNestedCullingComplex)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRectNestedNonCullingComplex)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRRectCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipRRectNonCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathNonCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathRectCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathRectNonCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathRRectCulling)
 
 flutter::testing::TEST_F (DisplayListTest, ClipPathRRectNonCulling)
 

Variables

static std::vector< testing::DisplayListInvocationGroup > flutter::testing::allGroups
 

Macro Definition Documentation

◆ CLIP_EXPECTOR

#define CLIP_EXPECTOR (   name)    ClipExpector name(__FILE__, __LINE__)

Definition at line 4334 of file display_list_unittests.cc.

◆ RUN_TESTS

#define RUN_TESTS (   body)     run_tests(#body, [](DlOpReceiver& receiver) { body }, true, false)

◆ RUN_TESTS2

#define RUN_TESTS2 (   body,
  expect 
)     run_tests(#body, [](DlOpReceiver& receiver) { body }, expect, expect)

◆ TEST_RTREE

#define TEST_RTREE (   rtree,
  query,
  expected_rects,
  expected_indices 
)     test_rtree(rtree, query, expected_rects, expected_indices, __FILE__, __LINE__)

Definition at line 2255 of file display_list_unittests.cc.