5#ifndef FLUTTER_FLOW_TESTING_MOCK_LAYER_H_
6#define FLUTTER_FLOW_TESTING_MOCK_LAYER_H_
32 return std::make_shared<MockLayer>(
path, std::move(paint));
36 auto mock_layer = std::make_shared<MockLayer>(
path,
DlPaint());
37 mock_layer->set_fake_opacity_compatible(
true);
53 return mock_flags_ & kParentHasPlatformView;
57 return mock_flags_ & kParentHasTextureLayer;
65 return mock_flags_ & kFakeOpacityCompatible;
71 flag ? (mock_flags_ |= kParentHasPlatformView)
72 : (mock_flags_ &= ~(kParentHasPlatformView));
77 flag ? (mock_flags_ |= kParentHasTextureLayer)
78 : (mock_flags_ &= ~(kParentHasTextureLayer));
83 flag ? (mock_flags_ |= kFakeHasPlatformView)
84 : (mock_flags_ &= ~(kFakeHasPlatformView));
89 flag ? (mock_flags_ |= kFakeReadsSurface)
90 : (mock_flags_ &= ~(kFakeReadsSurface));
95 flag ? (mock_flags_ |= kFakeOpacityCompatible)
96 : (mock_flags_ &= ~(kFakeOpacityCompatible));
101 flag ? (mock_flags_ |= kFakeHasTextureLayer)
102 : (mock_flags_ &= ~(kFakeHasTextureLayer));
107 expected_paint_matrix_ = matrix;
116 std::optional<DlMatrix> expected_paint_matrix_;
118 static constexpr int kParentHasPlatformView = 1 << 0;
119 static constexpr int kParentHasTextureLayer = 1 << 1;
120 static constexpr int kFakeHasPlatformView = 1 << 2;
121 static constexpr int kFakeReadsSurface = 1 << 3;
122 static constexpr int kFakeOpacityCompatible = 1 << 4;
123 static constexpr int kFakeHasTextureLayer = 1 << 5;
135 return std::make_shared<MockCacheableContainerLayer>(
true);
141 return std::make_shared<MockCacheableContainerLayer>();
158 int render_limit = 3)
161 std::make_unique<MockLayerCacheableItem>(
this, render_limit);
165 return raster_cache_item_.get();
171 std::unique_ptr<LayerRasterCacheItem> raster_cache_item_;
LayerRasterCacheItem(Layer *layer, int layer_cached_threshold=1, bool can_cache_children=false)
static std::shared_ptr< MockCacheableContainerLayer > CacheLayerOnly()
MockCacheableContainerLayer(bool cache_children=false)
void Preroll(PrerollContext *context) override
static std::shared_ptr< MockCacheableContainerLayer > CacheLayerOrChildren()
MockCacheableLayer(const DlPath &path, DlPaint paint=DlPaint(), int render_limit=3)
const LayerRasterCacheItem * raster_cache_item() const
void Preroll(PrerollContext *context) override
bool IsReplacing(DiffContext *context, const Layer *layer) const override
bool parent_has_platform_view()
static std::shared_ptr< MockLayer > Make(const DlPath &path, DlPaint paint=DlPaint())
bool fake_reads_surface()
const MockLayer * as_mock_layer() const override
bool fake_has_platform_view()
MockLayer & set_parent_has_platform_view(bool flag)
void set_expected_paint_matrix(const DlMatrix &matrix)
static std::shared_ptr< MockLayer > MakeOpacityCompatible(const DlPath &path)
const DlMatrix & parent_matrix()
MockLayer & set_parent_has_texture_layer(bool flag)
MockLayer & set_fake_has_texture_layer(bool flag)
const DlRect & parent_cull_rect()
MockLayer & set_fake_has_platform_view(bool flag)
void Diff(DiffContext *context, const Layer *old_layer) override
void Preroll(PrerollContext *context) override
MockLayer & set_fake_reads_surface(bool flag)
bool parent_has_texture_layer()
bool fake_opacity_compatible()
bool fake_has_texture_layer()
MockLayer & set_fake_opacity_compatible(bool flag)
const MutatorsStack & parent_mutators()
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
A 4x4 matrix using column-major storage.