mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-25 19:02:07 -05:00
LibVirtGPU: Port to Core::Stream
This commit is contained in:
parent
2e52de5744
commit
0ab29cffd2
2 changed files with 7 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 };
|
||||
|
|
Loading…
Add table
Reference in a new issue