forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_embedder.cc
52 lines (40 loc) · 1.43 KB
/
mock_embedder.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/testing/mock_embedder.h"
namespace flutter {
namespace testing {
MockViewEmbedder::MockViewEmbedder() = default;
MockViewEmbedder::~MockViewEmbedder() = default;
void MockViewEmbedder::AddCanvas(DlCanvas* canvas) {
contexts_.emplace_back(canvas);
}
// |ExternalViewEmbedder|
DlCanvas* MockViewEmbedder::GetRootCanvas() {
return nullptr;
}
// |ExternalViewEmbedder|
void MockViewEmbedder::CancelFrame() {}
// |ExternalViewEmbedder|
void MockViewEmbedder::BeginFrame(
GrDirectContext* context,
const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger) {}
// |ExternalViewEmbedder|
void MockViewEmbedder::PrepareFlutterView(int64_t flutter_view_id,
SkISize frame_size,
double device_pixel_ratio) {}
// |ExternalViewEmbedder|
void MockViewEmbedder::PrerollCompositeEmbeddedView(
int64_t view_id,
std::unique_ptr<EmbeddedViewParams> params) {
prerolled_views_.emplace_back(view_id);
}
// |ExternalViewEmbedder|
DlCanvas* MockViewEmbedder::CompositeEmbeddedView(int64_t view_id) {
painted_views_.emplace_back(view_id);
DlCanvas* canvas = contexts_.front();
contexts_.pop_front();
return canvas;
}
} // namespace testing
} // namespace flutter