Flutter Engine
embedder_layers.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_EMBEDDER_EMBEDDER_FLUTTER_LAYERS_H_
6 #define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_FLUTTER_LAYERS_H_
7 
8 #include <memory>
9 #include <vector>
10 
11 #include "flutter/flow/embedded_views.h"
12 #include "flutter/fml/macros.h"
13 #include "flutter/shell/platform/embedder/embedder.h"
14 #include "third_party/skia/include/core/SkMatrix.h"
15 #include "third_party/skia/include/core/SkSize.h"
16 
17 namespace flutter {
18 
20  public:
21  EmbedderLayers(SkISize frame_size,
22  double device_pixel_ratio,
23  SkMatrix root_surface_transformation);
24 
26 
27  void PushBackingStoreLayer(const FlutterBackingStore* store);
28 
30  const EmbeddedViewParams& params);
31 
32  using PresentCallback =
33  std::function<bool(const std::vector<const FlutterLayer*>& layers)>;
34  void InvokePresentCallback(const PresentCallback& callback) const;
35 
36  private:
37  const SkISize frame_size_;
38  const double device_pixel_ratio_;
39  const SkMatrix root_surface_transformation_;
40  std::vector<std::unique_ptr<FlutterPlatformView>> platform_views_referenced_;
41  std::vector<std::unique_ptr<FlutterPlatformViewMutation>>
42  mutations_referenced_;
43  std::vector<std::unique_ptr<std::vector<const FlutterPlatformViewMutation*>>>
44  mutations_arrays_referenced_;
45  std::vector<FlutterLayer> presented_layers_;
46 
47  FML_DISALLOW_COPY_AND_ASSIGN(EmbedderLayers);
48 };
49 
50 } // namespace flutter
51 
52 #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_FLUTTER_LAYERS_H_
EmbedderLayers(SkISize frame_size, double device_pixel_ratio, SkMatrix root_surface_transformation)
void PushPlatformViewLayer(FlutterPlatformViewIdentifier identifier, const EmbeddedViewParams &params)
void InvokePresentCallback(const PresentCallback &callback) const
void PushBackingStoreLayer(const FlutterBackingStore *store)
int64_t FlutterPlatformViewIdentifier
Definition: embedder.h:586
std::function< bool(const std::vector< const FlutterLayer * > &layers)> PresentCallback