summaryrefslogtreecommitdiff
path: root/atari/plot/plotter.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-03-13 21:46:59 +0000
committerOle Loots <ole@monochrom.net>2011-03-13 21:46:59 +0000
commitf2c97c39200d0d167e17d41f703bb91732901302 (patch)
treee897b91ac5e2bc36592f31ed545aaf400b1bd135 /atari/plot/plotter.c
parent0410a8ea557eeedc604b95bfcd251c4846e52cef (diff)
downloadnetsurf-f2c97c39200d0d167e17d41f703bb91732901302.tar.gz
netsurf-f2c97c39200d0d167e17d41f703bb91732901302.tar.bz2
init_mfdb() is now able to handle bitmaps with less than 8 bits per pixel.
(needed for monochrom glyph rendering) svn path=/trunk/netsurf/; revision=12038
Diffstat (limited to 'atari/plot/plotter.c')
-rwxr-xr-xatari/plot/plotter.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/atari/plot/plotter.c b/atari/plot/plotter.c
index 62fb10918..d9f46e8a8 100755
--- a/atari/plot/plotter.c
+++ b/atari/plot/plotter.c
@@ -682,7 +682,29 @@ short rgb_to_666_index(unsigned char r, unsigned char g, unsigned char b)
return( tval[2]*36+tval[1]*6+tval[0] );
}
-/* Shared (static in object oriented slang) plotter functions: */
+
+int init_mfdb(int bpp, int w, int h, bool stand, MFDB * out )
+{
+ int dststride;
+ dststride = MFDB_STRIDE( w );
+ if( bpp > 0 ) {
+ out->fd_addr = malloc( ((dststride >> 3) * h) * bpp );
+ if( out->fd_addr == NULL ){
+ return( 0 );
+ }
+ out->fd_stand = stand;
+ out->fd_nplanes = (short)bpp;
+ out->fd_r1 = out->fd_r2 = out->fd_r3 = 0;
+ } else {
+ memset( out, 0, sizeof(MFDB) );
+ }
+ out->fd_w = dststride;
+ out->fd_h = h;
+ out->fd_wdwidth = dststride >> 4;
+ return( 1 );
+}
+
+
int plotter_get_clip( GEM_PLOTTER self, struct rect * out )
{
out->x0 = self->clipping.x0;
@@ -692,6 +714,7 @@ int plotter_get_clip( GEM_PLOTTER self, struct rect * out )
return( 1 );
}
+
int plotter_std_clip(GEM_PLOTTER self, const struct rect * clip)
{
self->clipping.x0 = clip->x0;
@@ -701,7 +724,7 @@ int plotter_std_clip(GEM_PLOTTER self, const struct rect * clip)
return ( 1 );
}
-/* this converts framebuffer clipping to vdi clipping and sets it */
+
void plotter_vdi_clip( GEM_PLOTTER self, bool set)
{
return;