it: use single-pixel buffer instead of shm
This commit is contained in:
parent
aaed003ec8
commit
f562f887f0
17 changed files with 280 additions and 76 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use {
|
||||
crate::{
|
||||
format::ARGB8888,
|
||||
it::{test_error::TestError, testrun::TestRun},
|
||||
theme::Color,
|
||||
},
|
||||
|
|
@ -26,17 +25,20 @@ async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
|
|||
parent.set_color(0, 0, 0, 255);
|
||||
|
||||
let child = client.comp.create_surface().await?;
|
||||
let child_viewport = client.viewporter.get_viewport(&child)?;
|
||||
let sub = client
|
||||
.sub
|
||||
.get_subsurface(child.id, parent.surface.id)
|
||||
.await?;
|
||||
sub.set_position(100, 100)?;
|
||||
|
||||
let pool = client.shm.create_pool(100 * 100 * 4)?;
|
||||
let buffer = pool.create_buffer(0, 100, 100, 100 * 4, ARGB8888)?;
|
||||
buffer.fill(Color::from_rgba_straight(255, 255, 255, 255));
|
||||
let buffer = client
|
||||
.spbm
|
||||
.create_buffer(Color::from_rgba_straight(255, 255, 255, 255))?;
|
||||
|
||||
child.attach(buffer.id)?;
|
||||
child_viewport.set_source(0, 0, 1, 1)?;
|
||||
child_viewport.set_destination(100, 100)?;
|
||||
child.commit()?;
|
||||
|
||||
parent.map().await?;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ use {
|
|||
test_error::{TestErrorExt, TestResult},
|
||||
testrun::TestRun,
|
||||
},
|
||||
theme::Color,
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
|
@ -25,10 +26,13 @@ async fn test(run: Rc<TestRun>) -> TestResult {
|
|||
window.map().await?;
|
||||
|
||||
let ns = client.comp.create_surface().await?;
|
||||
let nsv = client.viewporter.get_viewport(&ns)?;
|
||||
let nss = client.sub.get_subsurface(ns.id, window.surface.id).await?;
|
||||
nss.set_position(100, 100)?;
|
||||
let buffer = client.shm.create_buffer(100, 100)?;
|
||||
let buffer = client.spbm.create_buffer(Color::SOLID_BLACK)?;
|
||||
ns.attach(buffer.id)?;
|
||||
nsv.set_source(0, 0, 1, 1)?;
|
||||
nsv.set_destination(100, 100)?;
|
||||
ns.commit()?;
|
||||
|
||||
run.cfg.set_fullscreen(ds.seat.id(), true)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue