mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-26 20:32:05 +03:00
Adjusted clipping rect changes for atari fronted.
svn path=/trunk/netsurf/; revision=11875
This commit is contained in:
parent
ca73991ef5
commit
58ad73bfc8
@ -683,7 +683,7 @@ short rgb_to_666_index(unsigned char r, unsigned char g, unsigned char b)
|
||||
}
|
||||
|
||||
/* Shared (static in object oriented slang) plotter functions: */
|
||||
int plotter_get_clip( GEM_PLOTTER self, struct s_clipping * out )
|
||||
int plotter_get_clip( GEM_PLOTTER self, struct rect * out )
|
||||
{
|
||||
out->x0 = self->clipping.x0;
|
||||
out->y0 = self->clipping.y0;
|
||||
@ -692,12 +692,12 @@ int plotter_get_clip( GEM_PLOTTER self, struct s_clipping * out )
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
int plotter_std_clip(GEM_PLOTTER self,int x0, int y0, int x1, int y1)
|
||||
int plotter_std_clip(GEM_PLOTTER self, const struct rect * clip)
|
||||
{
|
||||
self->clipping.x0 = x0;
|
||||
self->clipping.y0 = y0;
|
||||
self->clipping.x1 = x1;
|
||||
self->clipping.y1 = y1;
|
||||
self->clipping.x0 = clip->x0;
|
||||
self->clipping.y0 = clip->y0;
|
||||
self->clipping.x1 = clip->x1;
|
||||
self->clipping.y1 = clip->y1;
|
||||
return ( 1 );
|
||||
}
|
||||
|
||||
@ -706,7 +706,7 @@ void plotter_vdi_clip( GEM_PLOTTER self, bool set)
|
||||
{
|
||||
return;
|
||||
if( set == true ) {
|
||||
struct s_clipping * c = &self->clipping;
|
||||
struct rect * c = &self->clipping;
|
||||
short vdiflags[58];
|
||||
short newclip[4];
|
||||
vq_extnd( self->vdi_handle, 1, (short*)&vdiflags);
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <string.h>
|
||||
#include <windom.h>
|
||||
|
||||
#include "desktop/plotters.h"
|
||||
#include "desktop/plot_style.h"
|
||||
#include "image/bitmap.h"
|
||||
#include "atari/bitmap.h"
|
||||
@ -103,12 +104,7 @@ struct s_font_plotter
|
||||
};
|
||||
|
||||
|
||||
struct s_clipping {
|
||||
short x0;
|
||||
short y0;
|
||||
short x1;
|
||||
short y1;
|
||||
};
|
||||
struct rect;
|
||||
|
||||
struct s_vdi_sysinfo {
|
||||
short vdi_handle; /* vdi handle */
|
||||
@ -162,7 +158,7 @@ typedef int (*_pmf_update_screen_region)( GEM_PLOTTER self, GRECT region );
|
||||
typedef int (*_pmf_update_screen)(GEM_PLOTTER self);
|
||||
typedef int (*_pmf_put_pixel)(GEM_PLOTTER self, int x, int y, int color );
|
||||
typedef int (*_pmf_copy_rect)(GEM_PLOTTER self, GRECT src, GRECT dst );
|
||||
typedef int (*_pmf_clip)(GEM_PLOTTER self, int x0, int y0, int x1, int y1);
|
||||
typedef int (*_pmf_clip)(GEM_PLOTTER self, const struct rect * clip );
|
||||
typedef int (*_pmf_arc)(GEM_PLOTTER self, int x, int y, int radius, int angle1, int angle2, const plot_style_t * pstyle);
|
||||
typedef int (*_pmf_disc)(GEM_PLOTTER self, int x, int y, int radius, const plot_style_t * pstyle);
|
||||
typedef int (*_pmf_line)(GEM_PLOTTER self, int x0, int y0, int x1, int y1, const plot_style_t * pstyle);
|
||||
@ -185,7 +181,7 @@ struct s_gem_plotter
|
||||
struct s_vdi_sysinfo * scr;
|
||||
void * priv_data;
|
||||
int bpp_virt; /* bit depth of framebuffer */
|
||||
struct s_clipping clipping;
|
||||
struct rect clipping;
|
||||
struct s_frame_buf fbuf[MAX_FRAMEBUFS];
|
||||
int cfbi; /* current framebuffer index */
|
||||
|
||||
@ -296,8 +292,8 @@ void rgb_to_vdi1000( unsigned char * in, unsigned short * out );
|
||||
short rgb_to_666_index(unsigned char r, unsigned char g, unsigned char b);
|
||||
|
||||
/* shared / static methods ... */
|
||||
int plotter_get_clip( GEM_PLOTTER self, struct s_clipping * out );
|
||||
int plotter_std_clip(GEM_PLOTTER self,int x0, int y0, int x1, int y1);
|
||||
int plotter_get_clip( GEM_PLOTTER self, struct rect * out );
|
||||
int plotter_std_clip(GEM_PLOTTER self, const struct rect * clip);
|
||||
void plotter_vdi_clip( GEM_PLOTTER self, bool set);
|
||||
|
||||
#define PLOTTER_IS_LOCKED(plotter) ( plotter->private_flags & PLOTTER_FLAG_LOCKED )
|
||||
|
@ -122,6 +122,8 @@ int ctor_plotter_vdi(GEM_PLOTTER self )
|
||||
{
|
||||
int retval = 0;
|
||||
int i;
|
||||
struct rect clip;
|
||||
|
||||
self->dtor = dtor;
|
||||
self->resize= resize;
|
||||
self->move = move;
|
||||
@ -167,7 +169,12 @@ int ctor_plotter_vdi(GEM_PLOTTER self )
|
||||
/* offscreen: FIRSTFB(self).mem = malloc( FIRSTFB(self).size ); */
|
||||
FIRSTFB(self).mem = NULL;
|
||||
update_visible_rect( self );
|
||||
self->clip( self, 0, 0, FIRSTFB(self).w, FIRSTFB(self).h );
|
||||
|
||||
clip.x0 = 0;
|
||||
clip.y0 = 0;
|
||||
clip.x1 = FIRSTFB(self).w;
|
||||
clip.y1 = FIRSTFB(self).h;
|
||||
self->clip( self, &clip );
|
||||
/* store system palette & setup the new (web) palette: */
|
||||
i = 0;
|
||||
if( app.nplanes <= 8 ){
|
||||
@ -601,7 +608,7 @@ static int polygon(GEM_PLOTTER self,const int *p, unsigned int n, const plot_st
|
||||
unsigned int i=0;
|
||||
short d[4];
|
||||
if( vdi_sysinfo.maxpolycoords > 0 )
|
||||
assert( n < vdi_sysinfo.maxpolycoords );
|
||||
assert( (signed int)n < vdi_sysinfo.maxpolycoords );
|
||||
/*
|
||||
Does this double check make sense?
|
||||
else
|
||||
@ -1041,11 +1048,8 @@ static int bitmap( GEM_PLOTTER self, struct bitmap * bmp, int x, int y,
|
||||
|
||||
static int text(GEM_PLOTTER self, int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle)
|
||||
{
|
||||
self->font_plotter->text( self->font_plotter,
|
||||
x,
|
||||
y,
|
||||
text, length,
|
||||
fstyle
|
||||
self->font_plotter->text( self->font_plotter, x, y,
|
||||
text, length, fstyle
|
||||
);
|
||||
return ( 1 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user