mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
43 lines
872 B
C
43 lines
872 B
C
|
/*
|
||
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||
|
*
|
||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <AK/Forward.h>
|
||
|
#include <AK/Noncopyable.h>
|
||
|
#include <LibCore/MachPort.h>
|
||
|
|
||
|
namespace Core {
|
||
|
|
||
|
class IOSurfaceHandle {
|
||
|
AK_MAKE_NONCOPYABLE(IOSurfaceHandle);
|
||
|
|
||
|
public:
|
||
|
IOSurfaceHandle(IOSurfaceHandle&& other);
|
||
|
IOSurfaceHandle& operator=(IOSurfaceHandle&& other);
|
||
|
|
||
|
static IOSurfaceHandle create(int width, int height);
|
||
|
static IOSurfaceHandle from_mach_port(MachPort const& port);
|
||
|
|
||
|
MachPort create_mach_port() const;
|
||
|
|
||
|
size_t width() const;
|
||
|
size_t height() const;
|
||
|
size_t bytes_per_element() const;
|
||
|
void* data() const;
|
||
|
|
||
|
~IOSurfaceHandle();
|
||
|
|
||
|
private:
|
||
|
struct IOSurfaceRefWrapper;
|
||
|
|
||
|
IOSurfaceHandle(OwnPtr<IOSurfaceRefWrapper>&&);
|
||
|
|
||
|
OwnPtr<IOSurfaceRefWrapper> m_ref_wrapper;
|
||
|
};
|
||
|
|
||
|
}
|