#include <mock_layer.h>
Definition at line 26 of file mock_layer.h.
◆ MockLayer()
Definition at line 15 of file mock_layer.cc.
16 : fake_paint_path_(
path), fake_paint_(std::move(
paint)) {}
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
◆ as_mock_layer()
const MockLayer * flutter::testing::MockLayer::as_mock_layer |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ Diff()
void flutter::testing::MockLayer::Diff |
( |
DiffContext * |
context, |
|
|
const Layer * |
old_layer |
|
) |
| |
|
overridevirtual |
Reimplemented from flutter::Layer.
Definition at line 27 of file mock_layer.cc.
27 {
28 DiffContext::AutoSubtreeRestore subtree(context);
29 context->AddLayerBounds(fake_paint_path_.
getBounds());
30 context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
31}
const SkRect & getBounds() const
◆ fake_has_platform_view()
bool flutter::testing::MockLayer::fake_has_platform_view |
( |
| ) |
|
|
inline |
Definition at line 60 of file mock_layer.h.
60{ return mock_flags_ & kFakeHasPlatformView; }
◆ fake_has_texture_layer()
bool flutter::testing::MockLayer::fake_has_texture_layer |
( |
| ) |
|
|
inline |
Definition at line 68 of file mock_layer.h.
68{ return mock_flags_ & kFakeHasTextureLayer; }
◆ fake_opacity_compatible()
bool flutter::testing::MockLayer::fake_opacity_compatible |
( |
| ) |
|
|
inline |
Definition at line 64 of file mock_layer.h.
64 {
65 return mock_flags_ & kFakeOpacityCompatible;
66 }
◆ fake_reads_surface()
bool flutter::testing::MockLayer::fake_reads_surface |
( |
| ) |
|
|
inline |
Definition at line 62 of file mock_layer.h.
62{ return mock_flags_ & kFakeReadsSurface; }
◆ IsReplacing()
bool flutter::testing::MockLayer::IsReplacing |
( |
DiffContext * |
context, |
|
|
const Layer * |
layer |
|
) |
| const |
|
overridevirtual |
Reimplemented from flutter::Layer.
Definition at line 18 of file mock_layer.cc.
18 {
19
20
21
22 auto mock_layer = layer->as_mock_layer();
23 return mock_layer && mock_layer->fake_paint_ == fake_paint_ &&
24 mock_layer->fake_paint_path_ == fake_paint_path_;
25}
◆ Make()
Definition at line 30 of file mock_layer.h.
31 {
32 return std::make_shared<MockLayer>(
path, std::move(
paint));
33 }
◆ MakeOpacityCompatible()
static std::shared_ptr< MockLayer > flutter::testing::MockLayer::MakeOpacityCompatible |
( |
const SkPath & |
path | ) |
|
|
inlinestatic |
Definition at line 35 of file mock_layer.h.
35 {
36 auto mock_layer = std::make_shared<MockLayer>(
path,
DlPaint());
37 mock_layer->set_fake_opacity_compatible(true);
38 return mock_layer;
39 }
◆ Paint()
void flutter::testing::MockLayer::Paint |
( |
PaintContext & |
context | ) |
const |
|
overridevirtual |
Implements flutter::Layer.
Definition at line 52 of file mock_layer.cc.
52 {
54
55 if (expected_paint_matrix_.has_value()) {
57
58 EXPECT_EQ(
matrix, expected_paint_matrix_.value());
59 }
60
62 context.state_stack.fill(
paint);
63 context.canvas->DrawPath(fake_paint_path_,
paint);
64}
bool needs_painting(PaintContext &context) const
#define FML_DCHECK(condition)
unsigned useCenter Optional< SkMatrix > matrix
◆ parent_cull_rect()
const SkRect & flutter::testing::MockLayer::parent_cull_rect |
( |
| ) |
|
|
inline |
Definition at line 46 of file mock_layer.h.
46{ return parent_cull_rect_; }
◆ parent_has_platform_view()
bool flutter::testing::MockLayer::parent_has_platform_view |
( |
| ) |
|
|
inline |
Definition at line 52 of file mock_layer.h.
52 {
53 return mock_flags_ & kParentHasPlatformView;
54 }
◆ parent_has_texture_layer()
bool flutter::testing::MockLayer::parent_has_texture_layer |
( |
| ) |
|
|
inline |
Definition at line 56 of file mock_layer.h.
56 {
57 return mock_flags_ & kParentHasTextureLayer;
58 }
◆ parent_matrix()
const SkMatrix & flutter::testing::MockLayer::parent_matrix |
( |
| ) |
|
|
inline |
Definition at line 45 of file mock_layer.h.
45{ return parent_matrix_; }
◆ parent_mutators()
const MutatorsStack & flutter::testing::MockLayer::parent_mutators |
( |
| ) |
|
|
inline |
Definition at line 44 of file mock_layer.h.
44{ return parent_mutators_; }
◆ Preroll()
Implements flutter::Layer.
Reimplemented in flutter::testing::MockCacheableLayer.
Definition at line 33 of file mock_layer.cc.
33 {
34 context->state_stack.fill(&parent_mutators_);
35 parent_matrix_ = context->state_stack.transform_3x3();
36 parent_cull_rect_ = context->state_stack.local_cull_rect();
37
40
45 context->surface_needs_readback = true;
46 }
49 }
50}
static constexpr int kCallerCanApplyOpacity
void set_paint_bounds(const SkRect &paint_bounds)
bool fake_reads_surface()
bool fake_has_platform_view()
MockLayer & set_parent_has_platform_view(bool flag)
MockLayer & set_parent_has_texture_layer(bool flag)
bool fake_opacity_compatible()
bool fake_has_texture_layer()
◆ set_expected_paint_matrix()
void flutter::testing::MockLayer::set_expected_paint_matrix |
( |
const SkMatrix & |
matrix | ) |
|
|
inline |
◆ set_fake_has_platform_view()
MockLayer & flutter::testing::MockLayer::set_fake_has_platform_view |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 82 of file mock_layer.h.
82 {
83 flag ? (mock_flags_ |= kFakeHasPlatformView)
84 : (mock_flags_ &= ~(kFakeHasPlatformView));
85 return *this;
86 }
FlutterSemanticsFlag flag
◆ set_fake_has_texture_layer()
MockLayer & flutter::testing::MockLayer::set_fake_has_texture_layer |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 100 of file mock_layer.h.
100 {
101 flag ? (mock_flags_ |= kFakeHasTextureLayer)
102 : (mock_flags_ &= ~(kFakeHasTextureLayer));
103 return *this;
104 }
◆ set_fake_opacity_compatible()
MockLayer & flutter::testing::MockLayer::set_fake_opacity_compatible |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 94 of file mock_layer.h.
94 {
95 flag ? (mock_flags_ |= kFakeOpacityCompatible)
96 : (mock_flags_ &= ~(kFakeOpacityCompatible));
97 return *this;
98 }
◆ set_fake_reads_surface()
MockLayer & flutter::testing::MockLayer::set_fake_reads_surface |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 88 of file mock_layer.h.
88 {
89 flag ? (mock_flags_ |= kFakeReadsSurface)
90 : (mock_flags_ &= ~(kFakeReadsSurface));
91 return *this;
92 }
◆ set_parent_has_platform_view()
MockLayer & flutter::testing::MockLayer::set_parent_has_platform_view |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 70 of file mock_layer.h.
70 {
71 flag ? (mock_flags_ |= kParentHasPlatformView)
72 : (mock_flags_ &= ~(kParentHasPlatformView));
73 return *this;
74 }
◆ set_parent_has_texture_layer()
MockLayer & flutter::testing::MockLayer::set_parent_has_texture_layer |
( |
bool |
flag | ) |
|
|
inline |
Definition at line 76 of file mock_layer.h.
76 {
77 flag ? (mock_flags_ |= kParentHasTextureLayer)
78 : (mock_flags_ &= ~(kParentHasTextureLayer));
79 return *this;
80 }
The documentation for this class was generated from the following files: