Flutter Engine
compositor_context.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_FUCHSIA_COMPOSITOR_CONTEXT_H_
6 #define FLUTTER_SHELL_PLATFORM_FUCHSIA_COMPOSITOR_CONTEXT_H_
7 
8 #include <memory>
9 
10 #include "flutter/flow/compositor_context.h"
11 #include "flutter/flow/embedded_views.h"
12 #include "flutter/flow/scene_update_context.h"
13 #include "flutter/fml/macros.h"
14 
15 #include "session_connection.h"
17 
18 namespace flutter_runner {
19 
20 // Holds composition specific state and bindings specific to composition on
21 // Fuchsia.
23  public:
24  CompositorContext(SessionConnection& session_connection,
25  VulkanSurfaceProducer& surface_producer,
26  flutter::SceneUpdateContext& scene_update_context);
27 
28  ~CompositorContext() override;
29 
30  private:
31  SessionConnection& session_connection_;
32  VulkanSurfaceProducer& surface_producer_;
33  flutter::SceneUpdateContext& scene_update_context_;
34 
35  // |flutter::CompositorContext|
36  std::unique_ptr<ScopedFrame> AcquireFrame(
37  GrDirectContext* gr_context,
38  SkCanvas* canvas,
39  flutter::ExternalViewEmbedder* view_embedder,
40  const SkMatrix& root_surface_transformation,
41  bool instrumentation_enabled,
42  bool surface_supports_readback,
43  fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override;
44 
45  FML_DISALLOW_COPY_AND_ASSIGN(CompositorContext);
46 };
47 
48 } // namespace flutter_runner
49 
50 #endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_COMPOSITOR_CONTEXT_H_
CompositorContext(SessionConnection &session_connection, VulkanSurfaceProducer &surface_producer, flutter::SceneUpdateContext &scene_update_context)