1
0
Fork 0
forked from wry/wry

it: use single-pixel buffer instead of shm

This commit is contained in:
Julian Orth 2024-04-02 10:23:55 +02:00
parent aaed003ec8
commit f562f887f0
17 changed files with 280 additions and 76 deletions

View file

@ -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?;