1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:47:34 +00:00

LibCore: Move Stream-based file into the Core namespace

This commit is contained in:
Tim Schumacher 2023-02-09 03:02:46 +01:00 committed by Linus Groh
parent a96339b72b
commit 606a3982f3
218 changed files with 748 additions and 643 deletions

View file

@ -8,6 +8,7 @@
#include <AK/NonnullOwnPtr.h>
#include <Kernel/API/VirGL.h>
#include <LibCore/File.h>
#include <LibCore/System.h>
#include <LibVirtGPU/CommandBufferBuilder.h>
#include <LibVirtGPU/Device.h>
@ -38,14 +39,14 @@ static constexpr auto vert_shader = "VERT\n"
" 4: MOV_SAT OUT[1], IN[1]\n"
" 5: END\n"sv;
Device::Device(NonnullOwnPtr<Core::Stream::File> gpu_file)
Device::Device(NonnullOwnPtr<Core::File> gpu_file)
: m_gpu_file { move(gpu_file) }
{
}
ErrorOr<NonnullOwnPtr<Device>> Device::create(Gfx::IntSize min_size)
{
auto file = TRY(Core::Stream::File::open("/dev/gpu/render0"sv, Core::Stream::OpenMode::ReadWrite));
auto file = TRY(Core::File::open("/dev/gpu/render0"sv, Core::File::OpenMode::ReadWrite));
auto device = make<Device>(move(file));
TRY(device->initialize_context(min_size));
return device;

View file

@ -18,7 +18,7 @@ namespace VirtGPU {
class Device final : public GPU::Device {
public:
Device(NonnullOwnPtr<Core::Stream::File>);
Device(NonnullOwnPtr<Core::File>);
static ErrorOr<NonnullOwnPtr<Device>> create(Gfx::IntSize min_size);
@ -66,7 +66,7 @@ private:
ErrorOr<Protocol::ResourceID> create_virgl_resource(VirGL3DResourceSpec&);
ErrorOr<void> upload_command_buffer(Vector<u32> const&);
NonnullOwnPtr<Core::Stream::File> m_gpu_file;
NonnullOwnPtr<Core::File> m_gpu_file;
Protocol::ResourceID m_vbo_resource_id { 0 };
Protocol::ResourceID m_drawtarget { 0 };