Flutter Engine
The Flutter Engine
mock_embedder.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_FLOW_TESTING_MOCK_EMBEDDER_H_
6#define FLUTTER_FLOW_TESTING_MOCK_EMBEDDER_H_
7
8#include "flutter/flow/embedded_views.h"
9
10namespace flutter {
11namespace testing {
12
14 public:
16
18
19 void AddCanvas(DlCanvas* canvas);
20
21 // |ExternalViewEmbedder|
22 DlCanvas* GetRootCanvas() override;
23
24 // |ExternalViewEmbedder|
25 void CancelFrame() override;
26
27 // |ExternalViewEmbedder|
28 void BeginFrame(GrDirectContext* context,
30 raster_thread_merger) override;
31
32 // |ExternalViewEmbedder|
33 void PrepareFlutterView(SkISize frame_size,
34 double device_pixel_ratio) override;
35
36 // |ExternalViewEmbedder|
38 int64_t view_id,
39 std::unique_ptr<EmbeddedViewParams> params) override;
40
41 // |ExternalViewEmbedder|
42 DlCanvas* CompositeEmbeddedView(int64_t view_id) override;
43
44 std::vector<int64_t> prerolled_views() const { return prerolled_views_; }
45 std::vector<int64_t> painted_views() const { return painted_views_; }
46
47 private:
48 std::deque<DlCanvas*> contexts_;
49 std::vector<int64_t> prerolled_views_;
50 std::vector<int64_t> painted_views_;
51};
52
53} // namespace testing
54} // namespace flutter
55
56#endif // FLUTTER_FLOW_TESTING_MOCK_EMBEDDER_H_
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38
void PrepareFlutterView(SkISize frame_size, double device_pixel_ratio) override
std::vector< int64_t > prerolled_views() const
Definition: mock_embedder.h:44
void BeginFrame(GrDirectContext *context, const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger) override
void PrerollCompositeEmbeddedView(int64_t view_id, std::unique_ptr< EmbeddedViewParams > params) override
void AddCanvas(DlCanvas *canvas)
DlCanvas * CompositeEmbeddedView(int64_t view_id) override
DlCanvas * GetRootCanvas() override
std::vector< int64_t > painted_views() const
Definition: mock_embedder.h:45
const EmbeddedViewParams * params
Definition: SkSize.h:16