Skip to content

Commit

Permalink
[vulkan] Fix Fuchsia build
Browse files Browse the repository at this point in the history
Stub out VulkanSwapchain.

Test:Fuchsia release *and* debug builds
  • Loading branch information
cdotstout committed Dec 14, 2018
1 parent 4f148ed commit 6c40f84
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ FILE: ../../../flutter/vulkan/vulkan_surface.cc
FILE: ../../../flutter/vulkan/vulkan_surface.h
FILE: ../../../flutter/vulkan/vulkan_swapchain.cc
FILE: ../../../flutter/vulkan/vulkan_swapchain.h
FILE: ../../../flutter/vulkan/vulkan_swapchain_stub.cc
FILE: ../../../flutter/vulkan/vulkan_utilities.cc
FILE: ../../../flutter/vulkan/vulkan_utilities.h
FILE: ../../../flutter/vulkan/vulkan_window.cc
Expand Down
5 changes: 4 additions & 1 deletion vulkan/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ source_set("vulkan") {
"vulkan_proc_table.h",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_swapchain.h",
"vulkan_utilities.cc",
"vulkan_utilities.h",
"vulkan_window.cc",
Expand All @@ -46,9 +47,11 @@ source_set("vulkan") {
"vulkan_native_surface_android.cc",
"vulkan_native_surface_android.h",
"vulkan_swapchain.cc",
"vulkan_swapchain.h",
]
}
if (is_fuchsia) {
sources += [ "vulkan_swapchain_stub.cc" ]
}

deps = [
"$flutter_root/fml",
Expand Down
2 changes: 2 additions & 0 deletions vulkan/vulkan_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class VulkanSwapchain {

SkISize GetSize() const;

#if OS_ANDROID
private:
const VulkanProcTable& vk;
const VulkanDevice& device_;
Expand Down Expand Up @@ -88,6 +89,7 @@ class VulkanSwapchain {
sk_sp<SkColorSpace> color_space) const;

VulkanBackbuffer* GetNextBackbuffer();
#endif // OS_ANDROID

FML_DISALLOW_COPY_AND_ASSIGN(VulkanSwapchain);
};
Expand Down
34 changes: 34 additions & 0 deletions vulkan/vulkan_swapchain_stub.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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/vulkan/vulkan_swapchain.h"

namespace vulkan {

VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk,
const VulkanDevice& device,
const VulkanSurface& surface,
GrContext* skia_context,
std::unique_ptr<VulkanSwapchain> old_swapchain,
uint32_t queue_family_index) {}

VulkanSwapchain::~VulkanSwapchain() = default;

bool VulkanSwapchain::IsValid() const {
return false;
}

VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() {
return {AcquireStatus::ErrorSurfaceLost, nullptr};
}

bool VulkanSwapchain::Submit() {
return false;
}

SkISize VulkanSwapchain::GetSize() const {
return SkISize::Make(0, 0);
}

} // namespace vulkan

0 comments on commit 6c40f84

Please sign in to comment.