Commit d9f29b5f authored by Vikas Soni's avatar Vikas Soni Committed by Commit Bot

New build target for VulkanContextProvider.

Remove VulkanContextProvider from viz common build target and create a
new target. This is required so that the files which needs to only use
VulkanContextProvider can depend on this new target rather than
depending on whole viz common.

Bug: 891060
Change-Id: Iddff176837a43f029b6466c4b31fedb508d1fb79
Reviewed-on: https://chromium-review.googlesource.com/c/1313114Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605130}
parent 68a3b425
...@@ -39,6 +39,28 @@ viz_component("resource_format_utils") { ...@@ -39,6 +39,28 @@ viz_component("resource_format_utils") {
] ]
} }
if (enable_vulkan) {
viz_component("vulkan_context_provider") {
output_name = "viz_vulkan_context_provider"
defines = [ "VIZ_VULKAN_CONTEXT_PROVIDER_IMPLEMENTATION" ]
sources = [
"gpu/vulkan_context_provider.h",
"gpu/vulkan_in_process_context_provider.cc",
"gpu/vulkan_in_process_context_provider.h",
"viz_vulkan_context_provider_export.h",
]
configs = [ "//third_party/vulkan:vulkan_config" ]
deps = [
"//base",
"//gpu/vulkan",
"//gpu/vulkan:buildflags",
"//skia",
]
}
}
viz_component("common") { viz_component("common") {
output_name = "viz_common" output_name = "viz_common"
...@@ -184,16 +206,6 @@ viz_component("common") { ...@@ -184,16 +206,6 @@ viz_component("common") {
"//ui/latency", "//ui/latency",
] ]
if (enable_vulkan) {
sources += [
"gpu/vulkan_context_provider.h",
"gpu/vulkan_in_process_context_provider.cc",
"gpu/vulkan_in_process_context_provider.h",
]
configs = [ "//third_party/vulkan:vulkan_config" ]
deps += [ "//gpu/vulkan" ]
}
if (is_win) { if (is_win) {
sources += [ sources += [
"display/use_layered_window.cc", "display/use_layered_window.cc",
...@@ -210,6 +222,9 @@ viz_component("common") { ...@@ -210,6 +222,9 @@ viz_component("common") {
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//skia", "//skia",
] ]
if (enable_vulkan) {
public_deps += [ ":vulkan_context_provider" ]
}
} }
viz_source_set("unit_tests") { viz_source_set("unit_tests") {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define COMPONENTS_VIZ_COMMON_GPU_VULKAN_CONTEXT_PROVIDER_H_ #define COMPONENTS_VIZ_COMMON_GPU_VULKAN_CONTEXT_PROVIDER_H_
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "components/viz/common/viz_common_export.h" #include "components/viz/common/viz_vulkan_context_provider_export.h"
class GrContext; class GrContext;
...@@ -18,7 +18,7 @@ class VulkanImplementation; ...@@ -18,7 +18,7 @@ class VulkanImplementation;
namespace viz { namespace viz {
// The VulkanContextProvider groups sharing of vulkan objects synchronously. // The VulkanContextProvider groups sharing of vulkan objects synchronously.
class VIZ_COMMON_EXPORT VulkanContextProvider class VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT VulkanContextProvider
: public base::RefCountedThreadSafe<VulkanContextProvider> { : public base::RefCountedThreadSafe<VulkanContextProvider> {
public: public:
virtual gpu::VulkanImplementation* GetVulkanImplementation() = 0; virtual gpu::VulkanImplementation* GetVulkanImplementation() = 0;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <memory> #include <memory>
#include "components/viz/common/gpu/vulkan_context_provider.h" #include "components/viz/common/gpu/vulkan_context_provider.h"
#include "components/viz/common/viz_common_export.h" #include "components/viz/common/viz_vulkan_context_provider_export.h"
#include "gpu/vulkan/buildflags.h" #include "gpu/vulkan/buildflags.h"
#if BUILDFLAG(ENABLE_VULKAN) #if BUILDFLAG(ENABLE_VULKAN)
#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h"
...@@ -21,7 +21,7 @@ class VulkanDeviceQueue; ...@@ -21,7 +21,7 @@ class VulkanDeviceQueue;
namespace viz { namespace viz {
class VIZ_COMMON_EXPORT VulkanInProcessContextProvider class VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT VulkanInProcessContextProvider
: public VulkanContextProvider { : public VulkanContextProvider {
public: public:
static scoped_refptr<VulkanInProcessContextProvider> Create( static scoped_refptr<VulkanInProcessContextProvider> Create(
......
// Copyright 2018 The Chromium 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 COMPONENTS_VIZ_COMMON_VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT_H_
#define COMPONENTS_VIZ_COMMON_VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(VIZ_VULKAN_CONTEXT_PROVIDER_IMPLEMENTATION)
#define VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT __declspec(dllexport)
#else
#define VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT __declspec(dllimport)
#endif // defined(VIZ_VULKAN_CONTEXT_PROVIDER_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(VIZ_VULKAN_CONTEXT_PROVIDER_IMPLEMENTATION)
#define VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT \
__attribute__((visibility("default")))
#else
#define VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT
#endif
#endif // COMPONENTS_VIZ_COMMON_VIZ_VULKAN_CONTEXT_PROVIDER_EXPORT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment