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

// Copyright 2021 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_cursor_factory.h"

#include <wayland-cursor.h>

#include <cmath>

#include "base/numerics/safe_conversions.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "skia/ext/image_operations.h"
#include "ui/base/cursor/platform_cursor.h"
#include "ui/linux/linux_ui.h"
#include "ui/ozone/common/bitmap_cursor.h"
#include "ui/ozone/common/bitmap_cursor_factory.h"
#include "ui/ozone/platform/wayland/host/wayland_buffer_factory.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"

namespace ui {

namespace {

// The threshold for rounding down the final scale of the cursor image
// that gets sent to the Wayland compositor. For instance, if the
// original cursor image scale is 1.2, we'll downscale it to 1.0. On
// the other hand, if it's something like 1.5 then we'll upscale it to 2.0.
const float kCursorScaleFlooringThreshold =;

float GetRoundedScale(float scale) {}

}  // namespace

WaylandCursorFactory::ThemeData::ThemeData() = default;

WaylandCursorFactory::ThemeData::~ThemeData() = default;

void WaylandCursorFactory::ThemeData::AddThemeLoadedCallback(
    Callback callback) {}

void WaylandCursorFactory::ThemeData::SetLoadedTheme(wl_cursor_theme* theme) {}

WaylandCursorFactory::WaylandCursorFactory(WaylandConnection* connection)
    :{}

WaylandCursorFactory::~WaylandCursorFactory() {}

void WaylandCursorFactory::ObserveThemeChanges() {}

scoped_refptr<PlatformCursor> WaylandCursorFactory::CreateImageCursor(
    mojom::CursorType type,
    const SkBitmap& bitmap,
    const gfx::Point& hotspot,
    float scale) {}

scoped_refptr<PlatformCursor> WaylandCursorFactory::CreateAnimatedCursor(
    mojom::CursorType type,
    const std::vector<SkBitmap>& bitmaps,
    const gfx::Point& hotspot,
    float scale,
    base::TimeDelta frame_delay) {}

void WaylandCursorFactory::FinishCursorLoad(
    scoped_refptr<WaylandAsyncCursor> cursor,
    mojom::CursorType type,
    float scale,
    wl_cursor_theme* loaded_theme) {}

scoped_refptr<PlatformCursor> WaylandCursorFactory::GetDefaultCursor(
    mojom::CursorType type) {}

scoped_refptr<PlatformCursor> WaylandCursorFactory::GetDefaultCursor(
    mojom::CursorType type,
    float scale) {}

wl_cursor* WaylandCursorFactory::GetCursorFromTheme(wl_cursor_theme* theme,
                                                    const std::string& name) {}

void WaylandCursorFactory::OnCursorThemeNameChanged(
    const std::string& cursor_theme_name) {}

void WaylandCursorFactory::OnCursorThemeSizeChanged(int cursor_theme_size) {}

void WaylandCursorFactory::OnCursorBufferAttached(wl_cursor* cursor_data) {}

WaylandCursorFactory::ThemeData* WaylandCursorFactory::GetThemeForScale(
    float scale) {}

void WaylandCursorFactory::FlushThemeCache(bool force) {}

int WaylandCursorFactory::GetScaledSize(float scale) const {}

void WaylandCursorFactory::FinishThemeLoad(base::WeakPtr<ThemeData> cache_entry,
                                           wl_cursor_theme* loaded_theme) {}

}  // namespace ui