summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2023-01-15 19:35:01 -0500
committerSam Atkins <atkinssj@gmail.com>2023-01-16 17:05:41 +0000
commit0ab29cffd266902ace4511a1f62289e814302eb4 (patch)
treeba45d99a46d6ed03dc31572bcf3def97e700ef1a
parent2e52de5744a437a85463860efb5c04eaecb19770 (diff)
downloadserenity-0ab29cffd266902ace4511a1f62289e814302eb4.zip
LibVirtGPU: Port to `Core::Stream`
-rw-r--r--Userland/Libraries/LibVirtGPU/Device.cpp8
-rw-r--r--Userland/Libraries/LibVirtGPU/Device.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibVirtGPU/Device.cpp b/Userland/Libraries/LibVirtGPU/Device.cpp
index f8bb98341a..f1ad713580 100644
--- a/Userland/Libraries/LibVirtGPU/Device.cpp
+++ b/Userland/Libraries/LibVirtGPU/Device.cpp
@@ -38,15 +38,15 @@ static constexpr auto vert_shader = "VERT\n"
" 4: MOV_SAT OUT[1], IN[1]\n"
" 5: END\n"sv;
-Device::Device(NonnullRefPtr<Core::File> gpu_file)
- : m_gpu_file { gpu_file }
+Device::Device(NonnullOwnPtr<Core::Stream::File> gpu_file)
+ : m_gpu_file { move(gpu_file) }
{
}
ErrorOr<NonnullOwnPtr<Device>> Device::create(Gfx::IntSize min_size)
{
- auto file = TRY(Core::File::open("/dev/gpu/render0", Core::OpenMode::ReadWrite));
- auto device = make<Device>(file);
+ auto file = TRY(Core::Stream::File::open("/dev/gpu/render0"sv, Core::Stream::OpenMode::ReadWrite));
+ auto device = make<Device>(move(file));
TRY(device->initialize_context(min_size));
return device;
}
diff --git a/Userland/Libraries/LibVirtGPU/Device.h b/Userland/Libraries/LibVirtGPU/Device.h
index ac53b89a65..8f5d130871 100644
--- a/Userland/Libraries/LibVirtGPU/Device.h
+++ b/Userland/Libraries/LibVirtGPU/Device.h
@@ -10,7 +10,7 @@
#include <AK/NonnullRefPtr.h>
#include <AK/Vector.h>
#include <Kernel/API/VirGL.h>
-#include <LibCore/File.h>
+#include <LibCore/Stream.h>
#include <LibGPU/Device.h>
#include <LibVirtGPU/VirGLProtocol.h>
@@ -18,7 +18,7 @@ namespace VirtGPU {
class Device final : public GPU::Device {
public:
- Device(NonnullRefPtr<Core::File>);
+ Device(NonnullOwnPtr<Core::Stream::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&);
- NonnullRefPtr<Core::File> m_gpu_file;
+ NonnullOwnPtr<Core::Stream::File> m_gpu_file;
Protocol::ResourceID m_vbo_resource_id { 0 };
Protocol::ResourceID m_drawtarget { 0 };