This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable shell_unittests on Fuchsia with Vulkan dependencies. (flutter#…
…16376) This also adds a dependency on SwiftShader's Vulkan frontend.
- Loading branch information
George Wright
authored
Feb 6, 2020
1 parent
de7022b
commit d2aab27
Showing
16 changed files
with
327 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "flutter/shell/common/shell_test_platform_view_vulkan.h" | ||
#include "flutter/shell/gpu/gpu_surface_vulkan.h" | ||
|
||
namespace flutter { | ||
namespace testing { | ||
|
||
ShellTestPlatformViewVulkan::ShellTestPlatformViewVulkan( | ||
PlatformView::Delegate& delegate, | ||
TaskRunners task_runners, | ||
std::shared_ptr<ShellTestVsyncClock> vsync_clock, | ||
CreateVsyncWaiter create_vsync_waiter) | ||
: ShellTestPlatformView(delegate, std::move(task_runners)), | ||
create_vsync_waiter_(std::move(create_vsync_waiter)), | ||
vsync_clock_(vsync_clock), | ||
proc_table_(fml::MakeRefCounted<vulkan::VulkanProcTable>()) {} | ||
|
||
ShellTestPlatformViewVulkan::~ShellTestPlatformViewVulkan() = default; | ||
|
||
std::unique_ptr<VsyncWaiter> ShellTestPlatformViewVulkan::CreateVSyncWaiter() { | ||
return create_vsync_waiter_(); | ||
} | ||
|
||
void ShellTestPlatformViewVulkan::SimulateVSync() { | ||
vsync_clock_->SimulateVSync(); | ||
} | ||
|
||
// |PlatformView| | ||
std::unique_ptr<Surface> ShellTestPlatformViewVulkan::CreateRenderingSurface() { | ||
return std::make_unique<GPUSurfaceVulkan>(this, nullptr, true); | ||
} | ||
|
||
// |PlatformView| | ||
PointerDataDispatcherMaker ShellTestPlatformViewVulkan::GetDispatcherMaker() { | ||
return [](DefaultPointerDataDispatcher::Delegate& delegate) { | ||
return std::make_unique<SmoothPointerDataDispatcher>(delegate); | ||
}; | ||
} | ||
|
||
// |GPUSurfaceVulkanDelegate| | ||
fml::RefPtr<vulkan::VulkanProcTable> ShellTestPlatformViewVulkan::vk() { | ||
return proc_table_; | ||
} | ||
|
||
} // namespace testing | ||
} // namespace flutter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_ | ||
#define FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_ | ||
|
||
#include "flutter/shell/common/shell_test_platform_view.h" | ||
#include "flutter/shell/gpu/gpu_surface_vulkan_delegate.h" | ||
|
||
namespace flutter { | ||
namespace testing { | ||
|
||
class ShellTestPlatformViewVulkan : public ShellTestPlatformView, | ||
public GPUSurfaceVulkanDelegate { | ||
public: | ||
ShellTestPlatformViewVulkan(PlatformView::Delegate& delegate, | ||
TaskRunners task_runners, | ||
std::shared_ptr<ShellTestVsyncClock> vsync_clock, | ||
CreateVsyncWaiter create_vsync_waiter); | ||
|
||
~ShellTestPlatformViewVulkan() override; | ||
|
||
void SimulateVSync() override; | ||
|
||
private: | ||
CreateVsyncWaiter create_vsync_waiter_; | ||
|
||
std::shared_ptr<ShellTestVsyncClock> vsync_clock_; | ||
|
||
fml::RefPtr<vulkan::VulkanProcTable> proc_table_; | ||
|
||
// |PlatformView| | ||
std::unique_ptr<Surface> CreateRenderingSurface() override; | ||
|
||
// |PlatformView| | ||
std::unique_ptr<VsyncWaiter> CreateVSyncWaiter() override; | ||
|
||
// |PlatformView| | ||
PointerDataDispatcherMaker GetDispatcherMaker() override; | ||
|
||
// |GPUSurfaceVulkanDelegate| | ||
fml::RefPtr<vulkan::VulkanProcTable> vk() override; | ||
|
||
FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewVulkan); | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace flutter | ||
|
||
#endif // FLUTTER_SHELL_COMMON_SHELL_TEST_PLATFORM_VIEW_VULKAN_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.