graphics: Rename the legacy graphics API to the v1 graphics API
It is quite likely that the next graphics API won't be the last one and as such would become a legacy API too. Consistently using version numbers makes it easier to refer to the exact version you mean.
This commit is contained in:
@@ -4,7 +4,7 @@ use std::collections::{BTreeSet, VecDeque};
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
use std::{cmp, ptr};
|
||||
|
||||
use graphics_ipc::legacy::Damage;
|
||||
use graphics_ipc::v1::Damage;
|
||||
use orbclient::FONT;
|
||||
|
||||
pub struct DisplayMap {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::io;
|
||||
|
||||
use graphics_ipc::legacy::Damage;
|
||||
use graphics_ipc::v1::Damage;
|
||||
use inputd::{VtEvent, VtEventKind};
|
||||
use libredox::errno::EOPNOTSUPP;
|
||||
use libredox::Fd;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use event::{user_data, EventQueue};
|
||||
use graphics_ipc::legacy::{Damage, LegacyGraphicsHandle};
|
||||
use graphics_ipc::v1::{Damage, V1GraphicsHandle};
|
||||
use inputd::ConsumerHandle;
|
||||
use libredox::errno::ESTALE;
|
||||
use orbclient::Event;
|
||||
@@ -22,7 +22,7 @@ fn read_to_slice<T: Copy>(
|
||||
}
|
||||
}
|
||||
|
||||
fn display_fd_map(display_handle: LegacyGraphicsHandle) -> io::Result<DisplayMap> {
|
||||
fn display_fd_map(display_handle: V1GraphicsHandle) -> io::Result<DisplayMap> {
|
||||
let display_map = display_handle.map_display()?;
|
||||
Ok(DisplayMap {
|
||||
display_handle: Arc::new(display_handle),
|
||||
@@ -31,8 +31,8 @@ fn display_fd_map(display_handle: LegacyGraphicsHandle) -> io::Result<DisplayMap
|
||||
}
|
||||
|
||||
pub struct DisplayMap {
|
||||
display_handle: Arc<LegacyGraphicsHandle>,
|
||||
pub inner: graphics_ipc::legacy::DisplayMap,
|
||||
display_handle: Arc<V1GraphicsHandle>,
|
||||
pub inner: graphics_ipc::v1::DisplayMap,
|
||||
}
|
||||
|
||||
enum DisplayCommand {
|
||||
@@ -50,7 +50,7 @@ impl Display {
|
||||
|
||||
let map = match input_handle.open_display() {
|
||||
Ok(display) => {
|
||||
let display_handle = LegacyGraphicsHandle::from_file(display)?;
|
||||
let display_handle = V1GraphicsHandle::from_file(display)?;
|
||||
Arc::new(Mutex::new(Some(
|
||||
display_fd_map(display_handle)
|
||||
.unwrap_or_else(|e| panic!("failed to map display: {e}")),
|
||||
@@ -102,7 +102,7 @@ impl Display {
|
||||
eprintln!("fbbootlogd: handoff requested");
|
||||
|
||||
let new_display_handle = match input_handle.open_display() {
|
||||
Ok(display) => LegacyGraphicsHandle::from_file(display).unwrap(),
|
||||
Ok(display) => V1GraphicsHandle::from_file(display).unwrap(),
|
||||
Err(err) => {
|
||||
println!("fbbootlogd: No display present yet: {err}");
|
||||
continue;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use graphics_ipc::legacy::{Damage, LegacyGraphicsHandle};
|
||||
use graphics_ipc::v1::{Damage, V1GraphicsHandle};
|
||||
use inputd::ConsumerHandle;
|
||||
use std::io;
|
||||
|
||||
@@ -8,8 +8,8 @@ pub struct Display {
|
||||
}
|
||||
|
||||
pub struct DisplayMap {
|
||||
display_handle: LegacyGraphicsHandle,
|
||||
pub inner: graphics_ipc::legacy::DisplayMap,
|
||||
display_handle: V1GraphicsHandle,
|
||||
pub inner: graphics_ipc::v1::DisplayMap,
|
||||
}
|
||||
|
||||
impl Display {
|
||||
@@ -63,10 +63,10 @@ impl Display {
|
||||
}
|
||||
}
|
||||
|
||||
fn open_display(input_handle: &ConsumerHandle) -> io::Result<LegacyGraphicsHandle> {
|
||||
fn open_display(input_handle: &ConsumerHandle) -> io::Result<V1GraphicsHandle> {
|
||||
let display_file = input_handle.open_display()?;
|
||||
|
||||
LegacyGraphicsHandle::from_file(display_file)
|
||||
V1GraphicsHandle::from_file(display_file)
|
||||
}
|
||||
|
||||
pub fn sync_rects(&mut self, sync_rects: Vec<Damage>) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
pub mod legacy;
|
||||
pub mod v1;
|
||||
|
||||
@@ -4,17 +4,17 @@ use std::{cmp, io, mem, ptr, slice};
|
||||
|
||||
use libredox::flag;
|
||||
|
||||
/// A graphics handle using the legacy graphics API.
|
||||
/// A graphics handle using the v1 graphics API.
|
||||
///
|
||||
/// The legacy graphics API only allows a single framebuffer for each VT and supports neither page
|
||||
/// The v1 graphics API only allows a single framebuffer for each VT and supports neither page
|
||||
/// flipping nor cursor planes.
|
||||
pub struct LegacyGraphicsHandle {
|
||||
pub struct V1GraphicsHandle {
|
||||
file: File,
|
||||
}
|
||||
|
||||
impl LegacyGraphicsHandle {
|
||||
impl V1GraphicsHandle {
|
||||
pub fn from_file(file: File) -> io::Result<Self> {
|
||||
Ok(LegacyGraphicsHandle { file })
|
||||
Ok(V1GraphicsHandle { file })
|
||||
}
|
||||
|
||||
pub fn map_display(&self) -> io::Result<DisplayMap> {
|
||||
@@ -3,7 +3,7 @@ use std::convert::TryInto;
|
||||
use std::ptr::{self, NonNull};
|
||||
|
||||
use driver_graphics::{GraphicsAdapter, Resource};
|
||||
use graphics_ipc::legacy::Damage;
|
||||
use graphics_ipc::v1::Damage;
|
||||
use syscall::PAGE_SIZE;
|
||||
|
||||
use crate::framebuffer::FrameBuffer;
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use common::{dma::Dma, sgl};
|
||||
use driver_graphics::{GraphicsAdapter, GraphicsScheme, Resource};
|
||||
use graphics_ipc::legacy::Damage;
|
||||
use graphics_ipc::v1::Damage;
|
||||
use inputd::DisplayHandle;
|
||||
|
||||
use syscall::PAGE_SIZE;
|
||||
|
||||
Reference in New Issue
Block a user