chromium/ui/ozone/platform/x11/vulkan_surface_x11.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/ozone/platform/x11/vulkan_surface_x11.h"

#include "base/logging.h"
#include "gpu/vulkan/vulkan_function_pointers.h"
#include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_xrandr_interval_only_vsync_provider.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/window_event_manager.h"
#include "ui/gfx/x/xproto.h"

namespace ui {

// static
std::unique_ptr<VulkanSurfaceX11> VulkanSurfaceX11::Create(
    VkInstance vk_instance,
    x11::Window parent_window) {}

// When the screen is off or the window is offscreen, the X server keeps
// compositing windows with a 1Hz fake vblank.  However, there is an X server
// bug: the requested hardware vblanks are lost when screen turns off, which
// results in that tjh FIFO swapchain hangs.
//
// We work around the issue by setting the 2 seconds timeout for
// vkAcquireNextImageKHR().  When timeout happens, we consider the swapchain
// hang happened, and then make the surface lost, so a new swapchain will
// be created.
VulkanSurfaceX11::VulkanSurfaceX11(VkInstance vk_instance,
                                   VkSurfaceKHR vk_surface,
                                   x11::Window parent_window,
                                   x11::Window window)
    :{}

VulkanSurfaceX11::~VulkanSurfaceX11() {}

void VulkanSurfaceX11::Destroy() {}

bool VulkanSurfaceX11::Reshape(const gfx::Size& size,
                               gfx::OverlayTransform pre_transform) {}

void VulkanSurfaceX11::OnEvent(const x11::Event& event) {}

}  // namespace ui