Flutter Engine
 
Loading...
Searching...
No Matches
shell_test_platform_view_metal.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_COMMON_SHELL_TEST_PLATFORM_VIEW_METAL_H_
6#define FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_METAL_H_
7
9
10#import <Metal/Metal.h>
11
12#include "flutter/fml/macros.h"
16
17namespace flutter::testing {
18
21 public:
23 const TaskRunners& task_runners,
24 std::shared_ptr<ShellTestVsyncClock> vsync_clock,
25 CreateVsyncWaiter create_vsync_waiter,
26 std::shared_ptr<ShellTestExternalViewEmbedder>
27 shell_test_external_view_embedder,
28 const std::shared_ptr<const fml::SyncSwitch>&
29 is_gpu_disabled_sync_switch);
30
31 // |ShellTestPlatformView|
32 virtual ~ShellTestPlatformViewMetal() override;
33
34 private:
35 FlutterDarwinContextMetalSkia* skia_context_;
36 FlutterDarwinContextMetalImpeller* impeller_context_;
37 id<MTLTexture> offscreen_texture_;
38 const CreateVsyncWaiter create_vsync_waiter_;
39 const std::shared_ptr<ShellTestVsyncClock> vsync_clock_;
40 const std::shared_ptr<ShellTestExternalViewEmbedder>
41 shell_test_external_view_embedder_;
42
43 // |ShellTestPlatformView|
44 virtual void SimulateVSync() override;
45
46 // |PlatformView|
47 std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override;
48
49 // |PlatformView|
50 std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override;
51
52 // |PlatformView|
53 PointerDataDispatcherMaker GetDispatcherMaker() override;
54
55 // |PlatformView|
56 std::unique_ptr<Surface> CreateRenderingSurface() override;
57
58 // |PlatformView|
59 std::shared_ptr<impeller::Context> GetImpellerContext() const override;
60
61 // |GPUSurfaceMetalDelegate|
62 GPUCAMetalLayerHandle GetCAMetalLayer(
63 const DlISize& frame_info) const override;
64
65 // |GPUSurfaceMetalDelegate|
66 bool PresentDrawable(GrMTLHandle drawable) const override;
67
68 // |GPUSurfaceMetalDelegate|
69 GPUMTLTextureInfo GetMTLTexture(const DlISize& frame_info) const override;
70
71 // |GPUSurfaceMetalDelegate|
72 bool PresentTexture(GPUMTLTextureInfo texture) const override;
73
75};
76
77} // namespace flutter::testing
78
79#endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_METAL_H_
Interface implemented by all platform surfaces that can present a metal backing store to the "screen"...
Used to forward events from the platform view to interested subsystems. This forwarding is done by th...
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
FlTexture * texture
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.