Flutter Engine
The Flutter Engine
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
8#include "flutter/fml/macros.h"
9#include "flutter/shell/common/shell_test_platform_view.h"
10#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
11
12namespace flutter {
13namespace testing {
14
15class DarwinContextMetal;
16
19 public:
21 const TaskRunners& task_runners,
22 std::shared_ptr<ShellTestVsyncClock> vsync_clock,
23 CreateVsyncWaiter create_vsync_waiter,
24 std::shared_ptr<ShellTestExternalViewEmbedder>
25 shell_test_external_view_embedder,
26 const std::shared_ptr<const fml::SyncSwitch>&
27 is_gpu_disabled_sync_switch);
28
29 // |ShellTestPlatformView|
30 virtual ~ShellTestPlatformViewMetal() override;
31
32 private:
33 const std::unique_ptr<DarwinContextMetal> metal_context_;
34 const CreateVsyncWaiter create_vsync_waiter_;
35 const std::shared_ptr<ShellTestVsyncClock> vsync_clock_;
36 const std::shared_ptr<ShellTestExternalViewEmbedder>
37 shell_test_external_view_embedder_;
38
39 // |ShellTestPlatformView|
40 virtual void SimulateVSync() override;
41
42 // |PlatformView|
43 std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override;
44
45 // |PlatformView|
46 std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override;
47
48 // |PlatformView|
49 PointerDataDispatcherMaker GetDispatcherMaker() override;
50
51 // |PlatformView|
52 std::unique_ptr<Surface> CreateRenderingSurface() override;
53
54 // |PlatformView|
55 std::shared_ptr<impeller::Context> GetImpellerContext() const override;
56
57 // |GPUSurfaceMetalDelegate|
58 GPUCAMetalLayerHandle GetCAMetalLayer(
59 const SkISize& frame_info) const override;
60
61 // |GPUSurfaceMetalDelegate|
62 bool PresentDrawable(GrMTLHandle drawable) const override;
63
64 // |GPUSurfaceMetalDelegate|
65 GPUMTLTextureInfo GetMTLTexture(const SkISize& frame_info) const override;
66
67 // |GPUSurfaceMetalDelegate|
68 bool PresentTexture(GPUMTLTextureInfo texture) const override;
69
70 FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewMetal);
71};
72
73} // namespace testing
74} // namespace flutter
75
76#endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_METAL_H_
const void * GrMTLHandle
Definition: GrMtlTypes.h:20
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...
Definition: platform_view.h:60
ShellTestPlatformViewMetal(PlatformView::Delegate &delegate, const TaskRunners &task_runners, std::shared_ptr< ShellTestVsyncClock > vsync_clock, CreateVsyncWaiter create_vsync_waiter, std::shared_ptr< ShellTestExternalViewEmbedder > shell_test_external_view_embedder, const std::shared_ptr< const fml::SyncSwitch > &is_gpu_disabled_sync_switch)
FlTexture * texture
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
Definition: SkSize.h:16