chromium/ui/ozone/platform/wayland/host/wayland_zcr_color_manager.cc

// Copyright 2022 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/host/wayland_zcr_color_manager.h"

#include <chrome-color-management-client-protocol.h>
#include <memory>

#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "ui/base/wayland/color_manager_util.h"
#include "ui/gfx/color_space.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_output_manager.h"
#include "ui/ozone/platform/wayland/host/wayland_zcr_color_space_creator.h"
#include "ui/ozone/platform/wayland/wayland_utils.h"

namespace ui {

namespace {
constexpr uint32_t kMinVersion =;
constexpr uint32_t kMaxVersion =;
}  // namespace

// static
constexpr char WaylandZcrColorManager::kInterfaceName[];

// static
void WaylandZcrColorManager::Instantiate(WaylandConnection* connection,
                                         wl_registry* registry,
                                         uint32_t name,
                                         const std::string& interface,
                                         uint32_t version) {}

// Calling this function during Instantiate creates a copy of these colorspaces
// ahead of time on the server so they're ready when first requested.
// These are common video colorspaces you might come across browsing the web:
// Youtube, meets calls, hdr video, etc.
// Eventually the ZcrColorManager protocol needs to be extended to support
// sending colorspaces immediately (b/280388004).
void WaylandZcrColorManager::PreloadCommonColorSpaces() {}

WaylandZcrColorManager::WaylandZcrColorManager(
    zcr_color_manager_v1* zcr_color_manager,
    WaylandConnection* connection)
    :{}

WaylandZcrColorManager::~WaylandZcrColorManager() = default;

void WaylandZcrColorManager::OnColorSpaceCreated(
    gfx::ColorSpace color_space,
    scoped_refptr<WaylandZcrColorSpace> zcr_color_space,
    std::optional<uint32_t> error) {}

wl::Object<zcr_color_space_creator_v1>
WaylandZcrColorManager::CreateZcrColorSpaceCreator(
    const gfx::ColorSpace& color_space) {}

scoped_refptr<WaylandZcrColorSpace> WaylandZcrColorManager::GetColorSpace(
    const gfx::ColorSpace& color_space) {}

wl::Object<zcr_color_management_output_v1>
WaylandZcrColorManager::CreateColorManagementOutput(wl_output* output) {}

wl::Object<zcr_color_management_surface_v1>
WaylandZcrColorManager::CreateColorManagementSurface(wl_surface* surface) {}

}  // namespace ui