Flutter Engine
The Flutter Engine
Namespaces | Macros | Typedefs | Functions
raster_cache_unittests.cc File Reference
#include "flutter/display_list/benchmarking/dl_complexity.h"
#include "flutter/display_list/display_list.h"
#include "flutter/display_list/dl_builder.h"
#include "flutter/display_list/testing/dl_test_snippets.h"
#include "flutter/flow/layers/container_layer.h"
#include "flutter/flow/layers/display_list_layer.h"
#include "flutter/flow/layers/image_filter_layer.h"
#include "flutter/flow/layers/layer_tree.h"
#include "flutter/flow/layers/transform_layer.h"
#include "flutter/flow/raster_cache.h"
#include "flutter/flow/raster_cache_item.h"
#include "flutter/flow/testing/layer_test.h"
#include "flutter/flow/testing/mock_raster_cache.h"
#include "flutter/testing/assertions_skia.h"
#include "gtest/gtest.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkPoint.h"

Go to the source code of this file.

Namespaces

namespace  flutter
 
namespace  flutter::testing
 

Macros

#define EXPECT_EQ_WITH_TRANSLATE(test, expected, expected_tx, expected_ty)
 
#define EXPECT_NON_INTEGER_TRANSLATION(matrix)
 
#define EXPECT_EQ_WITH_TRANSLATE(test, expected, tx, ty, label)
 
#define EXPECT_NON_INTEGER_TRANSLATION(matrix)
 

Typedefs

using flutter::testing::RasterCacheTest = LayerTest
 

Functions

 flutter::testing::TEST (RasterCache, SimpleInitialization)
 
 flutter::testing::TEST (RasterCache, MetricsOmitUnpopulatedEntries)
 
 flutter::testing::TEST (RasterCache, ThresholdIsRespectedForDisplayList)
 
 flutter::testing::TEST (RasterCache, AccessThresholdOfZeroDisablesCachingForDisplayList)
 
 flutter::testing::TEST (RasterCache, PictureCacheLimitPerFrameIsRespectedWhenZeroForDisplayList)
 
 flutter::testing::TEST (RasterCache, EvictUnusedCacheEntries)
 
 flutter::testing::TEST (RasterCache, ComputeDeviceRectBasedOnFractionalTranslation)
 
 flutter::testing::TEST (RasterCache, DeviceRectRoundOutForDisplayList)
 
 flutter::testing::TEST (RasterCache, NestedOpCountMetricUsedForDisplayList)
 
 flutter::testing::TEST (RasterCache, NaiveComplexityScoringDisplayList)
 
 flutter::testing::TEST (RasterCache, DisplayListWithSingularMatrixIsNotCached)
 
 flutter::testing::TEST (RasterCache, PrepareLayerTransform)
 
 flutter::testing::TEST (RasterCache, RasterCacheKeyHashFunction)
 
 flutter::testing::TEST (RasterCache, RasterCacheKeySameID)
 
 flutter::testing::TEST (RasterCache, RasterCacheKeySameType)
 
 flutter::testing::TEST (RasterCache, RasterCacheKeyIDEqual)
 
 flutter::testing::TEST (RasterCache, RasterCacheKeyIDHashCode)
 
 flutter::testing::TEST_F (RasterCacheTest, RasterCacheKeyIDLayerChildrenIds)
 
 flutter::testing::TEST (RasterCacheUtilsTest, SkMatrixIntegralTransCTM)
 
 flutter::testing::TEST (RasterCacheUtilsTest, SkM44IntegralTransCTM)
 

Macro Definition Documentation

◆ EXPECT_EQ_WITH_TRANSLATE [1/2]

#define EXPECT_EQ_WITH_TRANSLATE (   test,
  expected,
  expected_tx,
  expected_ty 
)
Value:
do { \
EXPECT_EQ(test[SkMatrix::kMScaleX], expected[SkMatrix::kMScaleX]); \
EXPECT_EQ(test[SkMatrix::kMSkewX], expected[SkMatrix::kMSkewX]); \
EXPECT_EQ(test[SkMatrix::kMScaleY], expected[SkMatrix::kMScaleY]); \
EXPECT_EQ(test[SkMatrix::kMSkewY], expected[SkMatrix::kMSkewY]); \
EXPECT_EQ(test[SkMatrix::kMSkewX], expected[SkMatrix::kMSkewX]); \
EXPECT_EQ(test[SkMatrix::kMPersp0], expected[SkMatrix::kMPersp0]); \
EXPECT_EQ(test[SkMatrix::kMPersp1], expected[SkMatrix::kMPersp1]); \
EXPECT_EQ(test[SkMatrix::kMPersp2], expected[SkMatrix::kMPersp2]); \
EXPECT_EQ(test[SkMatrix::kMTransX], expected_tx); \
EXPECT_EQ(test[SkMatrix::kMTransY], expected_ty); \
} while (0)
static constexpr int kMScaleX
horizontal scale factor
Definition: SkMatrix.h:353
static constexpr int kMTransY
vertical translation
Definition: SkMatrix.h:358
static constexpr int kMPersp1
input y perspective factor
Definition: SkMatrix.h:360
static constexpr int kMPersp0
input x perspective factor
Definition: SkMatrix.h:359
static constexpr int kMPersp2
perspective bias
Definition: SkMatrix.h:361
static constexpr int kMTransX
horizontal translation
Definition: SkMatrix.h:355
static constexpr int kMSkewY
vertical skew factor
Definition: SkMatrix.h:356
static constexpr int kMScaleY
vertical scale factor
Definition: SkMatrix.h:357
static constexpr int kMSkewX
horizontal skew factor
Definition: SkMatrix.h:354

◆ EXPECT_EQ_WITH_TRANSLATE [2/2]

#define EXPECT_EQ_WITH_TRANSLATE (   test,
  expected,
  tx,
  ty,
  label 
)
Value:
do { \
EXPECT_EQ(test.rc(0, 0), expected.rc(0, 0)) << label; \
EXPECT_EQ(test.rc(0, 1), expected.rc(0, 1)) << label; \
EXPECT_EQ(test.rc(0, 2), expected.rc(0, 2)) << label; \
EXPECT_EQ(test.rc(0, 3), tx) << label; \
EXPECT_EQ(test.rc(1, 0), expected.rc(1, 0)) << label; \
EXPECT_EQ(test.rc(1, 1), expected.rc(1, 1)) << label; \
EXPECT_EQ(test.rc(1, 2), expected.rc(1, 2)) << label; \
EXPECT_EQ(test.rc(1, 3), ty) << label; \
EXPECT_EQ(test.rc(2, 0), expected.rc(2, 0)) << label; \
EXPECT_EQ(test.rc(2, 1), expected.rc(2, 1)) << label; \
EXPECT_EQ(test.rc(2, 2), expected.rc(2, 2)) << label; \
EXPECT_EQ(test.rc(2, 3), expected.rc(2, 3)) << label; \
EXPECT_EQ(test.rc(3, 0), expected.rc(3, 0)) << label; \
EXPECT_EQ(test.rc(3, 1), expected.rc(3, 1)) << label; \
EXPECT_EQ(test.rc(3, 2), expected.rc(3, 2)) << label; \
EXPECT_EQ(test.rc(3, 3), expected.rc(3, 3)) << label; \
} while (0)

◆ EXPECT_NON_INTEGER_TRANSLATION [1/2]

#define EXPECT_NON_INTEGER_TRANSLATION (   matrix)
Value:
static SkScalar SkScalarFraction(SkScalar x)
Definition: SkScalar.h:67
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
#define EXPECT_TRUE(handle)
Definition: unit_test.h:678

◆ EXPECT_NON_INTEGER_TRANSLATION [2/2]

#define EXPECT_NON_INTEGER_TRANSLATION (   matrix)
Value:
EXPECT_TRUE(SkScalarFraction(matrix.rc(0, 3)) != 0.0f || \
SkScalarFraction(matrix.rc(1, 3)) != 0.0f)