Skip to content

Commit

Permalink
refs #119: rewrite the test #20 as the font chosen was too small
Browse files Browse the repository at this point in the history
and vncserver on aarch64 was not doing a good job with glyph
rasterization on such small grid.
  • Loading branch information
dk committed Aug 21, 2024
1 parent 2272c0d commit 4198302
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions t/Object/GP.t
Original file line number Diff line number Diff line change
Expand Up @@ -296,34 +296,23 @@ $image-> destroy;
sub text_out_test
{
my $x = shift;
$x-> color( cl::White);
$x-> bar( 0, 0, 7, 7);
$x-> color( cl::Black);
$x-> font-> height( 8);
$x-> bar( 0, 0, $x->size);
$x-> color( cl::White);
$x-> font-> height( 20 );
$x-> text_out( "xyz", 0, 0);
my $xi = $x-> image;
$xi->type(im::BW);
my ( $i, $j);
my ( $wh, $bl) = ( 0, 0);
for ( $i = 0; $i < 8; $i++) {
for ( $j = 0; $j < 8; $j++) {
$xi-> pixel( $i,$j) == 0 ?
$bl++ : $wh++;
}
}
return $bl;
$xi->type(im::Byte);
return $xi->sum / 255;
}

my $bl = text_out_test($x);
if ( $bl == 0 ) {
# did we hit this bug? https://gitlab.freedesktop.org/xorg/xserver/issues/87
my $x = Prima::DeviceBitmap-> create( type => dbt::Pixmap, width => 8, height => 8);
$bl = text_out_test($x);
{
my $x = Prima::DeviceBitmap-> create( type => dbt::Pixmap, width => 20, height => 20);
my $bl = text_out_test($x);
cmp_ok( $bl, '>', 25, "text_out");
}


cmp_ok( $bl, '>', 5, "text_out");

# 21
my $y = Prima::DeviceBitmap-> create( type => dbt::Bitmap, width => 2, height => 2);
$y-> clear;
Expand Down

0 comments on commit 4198302

Please sign in to comment.