Flutter Engine
The 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
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|
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|
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
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...
std::shared_ptr< impeller::Context > GetImpellerContext() const override
GPUMTLTextureInfo GetMTLTexture(const SkISize &frame_info) const override
Returns the handle to the MTLTexture to render to. This is only called when the specified render targ...
GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize &frame_info) const override
Returns the handle to the CAMetalLayer to render to. This is only called when the specified render ta...
std::unique_ptr< VsyncWaiter > CreateVSyncWaiter() override
Invoked by the shell to obtain a platform specific vsync waiter. It is optional for platforms to over...
std::shared_ptr< ExternalViewEmbedder > CreateExternalViewEmbedder() override
PointerDataDispatcherMaker GetDispatcherMaker() override
Returns a platform-specific PointerDataDispatcherMaker so the Engine can construct the PointerDataPac...
bool PresentTexture(GPUMTLTextureInfo texture) const override
Presents the texture with texture_id to the "screen". texture_id corresponds to a texture that has be...
bool PresentDrawable(GrMTLHandle drawable) const override
Presents the drawable to the "screen". The drawable is obtained from the CAMetalLayer that given by G...
std::unique_ptr< Surface > CreateRenderingSurface() override
#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.