Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell_test_platform_view_vulkan.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_VULKAN_H_
6#define FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_
7
8#include "flutter/shell/common/shell_test_external_view_embedder.h"
9#include "flutter/shell/common/shell_test_platform_view.h"
10#include "flutter/shell/gpu/gpu_surface_vulkan_delegate.h"
11#include "flutter/vulkan/vulkan_application.h"
12#include "flutter/vulkan/vulkan_device.h"
13#include "flutter/vulkan/vulkan_skia_proc_table.h"
14
15namespace flutter {
16namespace testing {
17
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
28
29 void SimulateVSync() override;
30
31 private:
32 class OffScreenSurface : public flutter::Surface {
33 public:
34 OffScreenSurface(fml::RefPtr<vulkan::VulkanProcTable> vk,
35 std::shared_ptr<ShellTestExternalViewEmbedder>
36 shell_test_external_view_embedder);
37
38 ~OffScreenSurface() override;
39
40 // |Surface|
41 bool IsValid() override;
42
43 // |Surface|
44 std::unique_ptr<SurfaceFrame> AcquireFrame(const SkISize& size) override;
45
46 // |Surface|
47 SkMatrix GetRootTransformation() const override;
48
49 // |Surface|
50 GrDirectContext* GetContext() override;
51
52 private:
53 bool valid_ = false;
55 std::shared_ptr<ShellTestExternalViewEmbedder>
56 shell_test_external_view_embedder_;
57 std::unique_ptr<vulkan::VulkanApplication> application_;
58 std::unique_ptr<vulkan::VulkanDevice> logical_device_;
61
62 bool CreateSkiaGrContext();
63 bool CreateSkiaBackendContext(GrVkBackendContext* context);
64
65 FML_DISALLOW_COPY_AND_ASSIGN(OffScreenSurface);
66 };
67
68 CreateVsyncWaiter create_vsync_waiter_;
69
70 std::shared_ptr<ShellTestVsyncClock> vsync_clock_;
71
73
74 std::shared_ptr<ShellTestExternalViewEmbedder>
75 shell_test_external_view_embedder_;
76
77 // |PlatformView|
78 std::unique_ptr<Surface> CreateRenderingSurface() override;
79
80 // |PlatformView|
81 std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder() override;
82
83 // |PlatformView|
84 std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override;
85
86 // |PlatformView|
88
90};
91
92} // namespace testing
93} // namespace flutter
94
95#endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_
Used to forward events from the platform view to interested subsystems. This forwarding is done by th...
Abstract Base Class that represents where we will be rendering content.
Definition surface.h:24
PointerDataDispatcherMaker GetDispatcherMaker() override
Returns a platform-specific PointerDataDispatcherMaker so the Engine can construct the PointerDataPac...
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
std::unique_ptr< Surface > CreateRenderingSurface() override
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259