Flutter Engine
ios_external_view_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_SHELL_PLATFORM_DARWIN_IOS_IOS_EXTERNAL_VIEW_EMBEDDER_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_EXTERNAL_VIEW_EMBEDDER_H_
7 
8 #include "flutter/flow/embedded_views.h"
9 #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h"
10 
11 namespace flutter {
12 
14  public:
15  IOSExternalViewEmbedder(const std::shared_ptr<FlutterPlatformViewsController>&
16  platform_views_controller,
17  std::shared_ptr<IOSContext> context);
18 
19  // |ExternalViewEmbedder|
20  virtual ~IOSExternalViewEmbedder() override;
21 
22  private:
23  const std::shared_ptr<FlutterPlatformViewsController>&
24  platform_views_controller_;
25  std::shared_ptr<IOSContext> ios_context_;
26 
27  // |ExternalViewEmbedder|
28  SkCanvas* GetRootCanvas() override;
29 
30  // |ExternalViewEmbedder|
31  void CancelFrame() override;
32 
33  // |ExternalViewEmbedder|
34  void BeginFrame(
35  SkISize frame_size,
36  GrDirectContext* context,
37  double device_pixel_ratio,
38  fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override;
39 
40  // |ExternalViewEmbedder|
41  void PrerollCompositeEmbeddedView(
42  int view_id,
43  std::unique_ptr<flutter::EmbeddedViewParams> params) override;
44 
45  // |ExternalViewEmbedder|
46  PostPrerollResult PostPrerollAction(
47  fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override;
48 
49  // |ExternalViewEmbedder|
50  std::vector<SkCanvas*> GetCurrentCanvases() override;
51 
52  // |ExternalViewEmbedder|
53  SkCanvas* CompositeEmbeddedView(int view_id) override;
54 
55  // |ExternalViewEmbedder|
56  void SubmitFrame(GrDirectContext* context,
57  std::unique_ptr<SurfaceFrame> frame) override;
58 
59  // |ExternalViewEmbedder|
60  void EndFrame(
61  bool should_resubmit_frame,
62  fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override;
63 
64  // |ExternalViewEmbedder|
65  bool SupportsDynamicThreadMerging() override;
66 
67  FML_DISALLOW_COPY_AND_ASSIGN(IOSExternalViewEmbedder);
68 };
69 
70 } // namespace flutter
71 
72 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_EXTERNAL_VIEW_EMBEDDER_H_
virtual ~IOSExternalViewEmbedder() override
IOSExternalViewEmbedder(const std::shared_ptr< FlutterPlatformViewsController > &platform_views_controller, std::shared_ptr< IOSContext > context)