chromium/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc

// Copyright 2018 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/wayland/gpu/gbm_surfaceless_wayland.h"

#include <sync/sync.h>

#include <cmath>
#include <cstdint>
#include <memory>
#include <utility>

#include "base/check.h"
#include "base/functional/bind.h"
#include "base/ranges/algorithm.h"
#include "base/task/thread_pool.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "ui/gfx/gpu_fence.h"
#include "ui/gfx/gpu_fence_handle.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_display.h"
#include "ui/ozone/common/egl_util.h"
#include "ui/ozone/platform/wayland/gpu/wayland_buffer_manager_gpu.h"
#include "ui/ozone/platform/wayland/mojom/wayland_overlay_config.mojom.h"

namespace ui {

namespace {

// A test run showed only 9 inflight solid color buffers at the same time. Thus,
// allow to store max 12 buffers (including some margin) of solid color buffers
// and remove the rest.
static constexpr size_t kMaxSolidColorBuffers =;

static constexpr gfx::Size kSolidColorBufferSize{};

void WaitForGpuFences(std::vector<std::unique_ptr<gfx::GpuFence>> fences) {}

}  // namespace

GbmSurfacelessWayland::SolidColorBufferHolder::SolidColorBufferHolder() =
    default;
GbmSurfacelessWayland::SolidColorBufferHolder::~SolidColorBufferHolder() =
    default;

BufferId
GbmSurfacelessWayland::SolidColorBufferHolder::GetOrCreateSolidColorBuffer(
    SkColor4f color,
    WaylandBufferManagerGpu* buffer_manager) {}

void GbmSurfacelessWayland::SolidColorBufferHolder::OnSubmission(
    BufferId buffer_id,
    WaylandBufferManagerGpu* buffer_manager) {}

void GbmSurfacelessWayland::SolidColorBufferHolder::EraseBuffers(
    WaylandBufferManagerGpu* buffer_manager) {}

GbmSurfacelessWayland::GbmSurfacelessWayland(
    gl::GLDisplayEGL* display,
    WaylandBufferManagerGpu* buffer_manager,
    gfx::AcceleratedWidget widget)
    :{}

void GbmSurfacelessWayland::QueueWaylandOverlayConfig(
    wl::WaylandOverlayConfig config) {}

bool GbmSurfacelessWayland::ScheduleOverlayPlane(
    gl::OverlayImage image,
    std::unique_ptr<gfx::GpuFence> gpu_fence,
    const gfx::OverlayPlaneData& overlay_plane_data) {}
void GbmSurfacelessWayland::Present(SwapCompletionCallback completion_callback,
                                    PresentationCallback presentation_callback,
                                    gfx::FrameData data) {}

void GbmSurfacelessWayland::SetRelyOnImplicitSync() {}

bool GbmSurfacelessWayland::SupportsPlaneGpuFences() const {}

bool GbmSurfacelessWayland::SupportsOverridePlatformSize() const {}

bool GbmSurfacelessWayland::SupportsViewporter() const {}

bool GbmSurfacelessWayland::Resize(const gfx::Size& size,
                                   float scale_factor,
                                   const gfx::ColorSpace& color_space,
                                   bool has_alpha) {}

GbmSurfacelessWayland::~GbmSurfacelessWayland() {}

GbmSurfacelessWayland::PendingFrame::PendingFrame(uint32_t frame_id)
    :{}

GbmSurfacelessWayland::PendingFrame::~PendingFrame() = default;

void GbmSurfacelessWayland::MaybeSubmitFrames() {}

void GbmSurfacelessWayland::FenceRetired(PendingFrame* frame) {}

void GbmSurfacelessWayland::SetNoGLFlushForTests() {}

void GbmSurfacelessWayland::OnSubmission(uint32_t frame_id,
                                         const gfx::SwapResult& swap_result,
                                         gfx::GpuFenceHandle release_fence) {}

void GbmSurfacelessWayland::OnPresentation(
    uint32_t frame_id,
    const gfx::PresentationFeedback& feedback) {}

EGLDisplay GbmSurfacelessWayland::GetEGLDisplay() {}

}  // namespace ui