Direct rendering. Testing only; has problems with inline image placement, grey

background for all text, won't work with Cairo renderer, may crash with certain
gfx lib operations (AreaFill).  However, seems to be much faster in 16-bit mode than
off-screen buffered rendering.

svn path=/trunk/netsurf/; revision=11913
This commit is contained in:
Chris Young 2011-03-05 14:36:55 +00:00
parent 912b3bcde8
commit f892e59d76
4 changed files with 154 additions and 102 deletions

View File

@ -165,6 +165,8 @@ void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG *ys);
ULONG ami_set_border_gadget_balance(struct gui_window_2 *gwin); ULONG ami_set_border_gadget_balance(struct gui_window_2 *gwin);
ULONG ami_get_border_gadget_balance(struct gui_window_2 *gwin, ULONG *size1, ULONG *size2); ULONG ami_get_border_gadget_balance(struct gui_window_2 *gwin, ULONG *size1, ULONG *size2);
void ami_try_quit(void); void ami_try_quit(void);
void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
int x0, int y0, int x1, int y1);
STRPTR ami_locale_langs(void) STRPTR ami_locale_langs(void)
{ {
@ -2852,9 +2854,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
glob = &browserglob; glob = &browserglob;
if(locked_screen) UnlockPubScreen(NULL,scrn); if(locked_screen) UnlockPubScreen(NULL,scrn);
search_web_retrieve_ico(false);
//if (search_web_ico() == NULL)
search_web_retrieve_ico(false);
return gwin; return gwin;
} }
@ -3097,6 +3097,8 @@ void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
ULONG cur_tab = 0; ULONG cur_tab = 0;
ULONG sx, sy; ULONG sx, sy;
struct rect clip; struct rect clip;
struct RastPort *temprp;
int posx, posy;
if(!g) return; if(!g) return;
if(browser_window_redraw_ready(bw) == false) return; if(browser_window_redraw_ready(bw) == false) return;
@ -3121,29 +3123,47 @@ void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
xoffset=bbox->Left; xoffset=bbox->Left;
yoffset=bbox->Top; yoffset=bbox->Top;
plot=amiplot;
glob = &browserglob;
if((y1<sy) || (y0>sy+height)) return; if((y1<sy) || (y0>sy+height)) return;
if((x1<sx) || (x0>sx+width)) return; if((x1<sx) || (x0>sx+width)) return;
if((x0-(int)sx)<0) x0 = sx; if((x0-(int)sx)<0) x0 = sx;
if((y0-(int)sy)<0) y0 = sy; if((y0-(int)sy)<0) y0 = sy;
/* Check this - xoffset/yoffset are window-relative, not bitmap-relative */
if((x1-x0)+(xoffset+x0-sx)>(width)) x1 = (width-(x0-sx)+x0); if((x1-x0)+(xoffset+x0-sx)>(width)) x1 = (width-(x0-sx)+x0);
if((y1-y0)+(yoffset+y0-sy)>(height)) y1 = (height-(y0-sy)+y0); if((y1-y0)+(yoffset+y0-sy)>(height)) y1 = (height-(y0-sy)+y0);
plot = amiplot;
glob = &browserglob;
glob->scale = bw->scale; glob->scale = bw->scale;
clip.x0 = (x0 - sx); if(option_direct_render == false)
clip.y0 = (y0 - sy); {
clip.x1 = (x1 - sx); clip.x0 = (x0 - sx);
clip.y1 = (y1 - sy); clip.y0 = (y0 - sy);
clip.x1 = (x1 - sx);
clip.y1 = (y1 - sy);
posx = - sx;
posy = - sy;
}
else
{
temprp = browserglob.rp;
browserglob.rp = g->shared->win->RPort;
clip.x0 = (x0 - sx) + bbox->Left;
clip.y0 = (y0 - sy) + bbox->Top;
clip.x1 = (x1 - sx) + bbox->Left;
clip.y1 = (y1 - sy) + bbox->Top;
posx = bbox->Left - sx; /* wrong */
posy = bbox->Top - sy; /* wrong */
}
if(browser_window_redraw(bw, -sx, -sy, &clip)) if(browser_window_redraw(bw, posx, posy, &clip))
{ {
ami_clearclipreg(&browserglob); ami_clearclipreg(&browserglob);
if(option_direct_render == false)
{
/* This is identical to the below, but for some reason doesn't blit anything. /* This is identical to the below, but for some reason doesn't blit anything.
* Probably some values are wrong and BltBitMapTags is fussier. * Probably some values are wrong and BltBitMapTags is fussier.
@ -3169,6 +3189,11 @@ void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
(x1 - x0) * g->shared->bw->scale, (x1 - x0) * g->shared->bw->scale,
(y1 - y0) * g->shared->bw->scale, (y1 - y0) * g->shared->bw->scale,
0x0C0); 0x0C0);
}
else
{
browserglob.rp = temprp;
}
} }
current_redraw_browser = NULL; current_redraw_browser = NULL;
@ -3209,6 +3234,7 @@ void ami_do_redraw(struct gui_window_2 *g)
struct IBox *bbox; struct IBox *bbox;
ULONG oldh=g->oldh,oldv=g->oldv; ULONG oldh=g->oldh,oldv=g->oldv;
bool morescroll = false; bool morescroll = false;
struct RastPort *temprp;
if(browser_window_redraw_ready(g->bw) == false) return; if(browser_window_redraw_ready(g->bw) == false) return;
@ -3224,8 +3250,6 @@ void ami_do_redraw(struct gui_window_2 *g)
height=bbox->Height; height=bbox->Height;
xoffset=bbox->Left; xoffset=bbox->Left;
yoffset=bbox->Top; yoffset=bbox->Top;
plot = amiplot;
glob = &browserglob;
if(g->bw->reformat_pending) if(g->bw->reformat_pending)
{ {
@ -3287,28 +3311,49 @@ void ami_do_redraw(struct gui_window_2 *g)
{ {
struct rect clip; struct rect clip;
clip.x0 = 0; plot = amiplot;
clip.y0 = 0; glob = &browserglob;
clip.x1 = width + hcurrent;
clip.y1 = height + vcurrent;
glob->scale = g->bw->scale; glob->scale = g->bw->scale;
if(browser_window_redraw(g->bw, -hcurrent, -vcurrent, &clip)) if(option_direct_render == false)
{
clip.x0 = 0;
clip.y0 = 0;
clip.x1 = width + hcurrent;
clip.y1 = height + vcurrent;
}
else
{
temprp = browserglob.rp;
browserglob.rp = g->win->RPort;
clip.x0 = bbox->Left;
clip.y0 = bbox->Top;
clip.x1 = bbox->Left + bbox->Width;
clip.y1 = bbox->Top + bbox->Height;
}
if(browser_window_redraw(g->bw, clip.x0 - hcurrent, clip.y0 - vcurrent, &clip))
{ {
ami_clearclipreg(&browserglob); ami_clearclipreg(&browserglob);
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP, if(option_direct_render == false)
BLITA_Source, browserglob.bm, {
BLITA_SrcX, 0, BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_SrcY, 0, BLITA_Source, browserglob.bm,
BLITA_DestType, BLITT_RASTPORT, BLITA_SrcX, 0,
BLITA_Dest, g->win->RPort, BLITA_SrcY, 0,
BLITA_DestX, bbox->Left, BLITA_DestType, BLITT_RASTPORT,
BLITA_DestY, bbox->Top, BLITA_Dest, g->win->RPort,
BLITA_Width, bbox->Width, BLITA_DestX, bbox->Left,
BLITA_Height, bbox->Height, BLITA_DestY, bbox->Top,
TAG_DONE); BLITA_Width, bbox->Width,
BLITA_Height, bbox->Height,
TAG_DONE);
}
else
{
browserglob.rp = temprp;
}
} }
} }

View File

@ -64,6 +64,7 @@ extern int option_cookies_window_ypos;
extern int option_cookies_window_xsize; extern int option_cookies_window_xsize;
extern int option_cookies_window_ysize; extern int option_cookies_window_ysize;
extern int option_cairo_renderer; extern int option_cairo_renderer;
extern bool option_direct_render;
#define EXTRA_OPTION_DEFINE \ #define EXTRA_OPTION_DEFINE \
char *option_url_file = 0; \ char *option_url_file = 0; \
@ -110,6 +111,7 @@ int option_cookies_window_ypos = 0; \
int option_cookies_window_xsize = 0; \ int option_cookies_window_xsize = 0; \
int option_cookies_window_ysize = 0; \ int option_cookies_window_ysize = 0; \
int option_cairo_renderer = 1; \ int option_cairo_renderer = 1; \
bool option_direct_render = false; \
#define EXTRA_OPTION_TABLE \ #define EXTRA_OPTION_TABLE \
{ "url_file", OPTION_STRING, &option_url_file }, \ { "url_file", OPTION_STRING, &option_url_file }, \
@ -155,5 +157,6 @@ int option_cairo_renderer = 1; \
{ "cookies_window_ypos", OPTION_INTEGER, &option_cookies_window_ypos}, \ { "cookies_window_ypos", OPTION_INTEGER, &option_cookies_window_ypos}, \
{ "cookies_window_xsize", OPTION_INTEGER, &option_cookies_window_xsize}, \ { "cookies_window_xsize", OPTION_INTEGER, &option_cookies_window_xsize}, \
{ "cookies_window_ysize", OPTION_INTEGER, &option_cookies_window_ysize}, \ { "cookies_window_ysize", OPTION_INTEGER, &option_cookies_window_ysize}, \
{ "cairo_renderer", OPTION_INTEGER, &option_cairo_renderer}, { "cairo_renderer", OPTION_INTEGER, &option_cairo_renderer}, \
{ "direct_render", OPTION_BOOL, &option_direct_render},
#endif #endif

View File

@ -130,33 +130,36 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->tmprasbuf = AllocVec(width*height,MEMF_PRIVATE | MEMF_CLEAR); gg->tmprasbuf = AllocVec(width*height,MEMF_PRIVATE | MEMF_CLEAR);
gg->bm = p96AllocBitMap(width, height, 32, gg->bm = p96AllocBitMap(width, height, 32,
BMF_INTERLEAVED, friend, RGBFB_A8R8G8B8); BMF_INTERLEAVED, friend, RGBFB_A8R8G8B8);
if(!gg->bm) warn_user("NoMemory",""); if(!gg->bm) warn_user("NoMemory","");
InitRastPort(&gg->rp); gg->rp = AllocVec(sizeof(struct RastPort), MEMF_PRIVATE | MEMF_CLEAR);
gg->rp.BitMap = gg->bm; if(!gg->rp) warn_user("NoMemory","");
SetDrMd(&gg->rp,BGBACKFILL); InitRastPort(gg->rp);
gg->rp->BitMap = gg->bm;
gg->rp.Layer = CreateUpfrontLayer(gg->layerinfo,gg->rp.BitMap,0,0, /* Is all this safe to do to an existing window RastPort? */
SetDrMd(gg->rp,BGBACKFILL);
gg->rp->Layer = CreateUpfrontLayer(gg->layerinfo,gg->rp->BitMap,0,0,
width-1, height-1, LAYERSIMPLE, NULL); width-1, height-1, LAYERSIMPLE, NULL);
InstallLayerHook(gg->rp.Layer,LAYERS_NOBACKFILL); InstallLayerHook(gg->rp->Layer,LAYERS_NOBACKFILL);
gg->rp.AreaInfo = AllocVec(sizeof(struct AreaInfo),MEMF_PRIVATE | MEMF_CLEAR); gg->rp->AreaInfo = AllocVec(sizeof(struct AreaInfo),MEMF_PRIVATE | MEMF_CLEAR);
if((!gg->areabuf) || (!gg->rp.AreaInfo)) warn_user("NoMemory",""); if((!gg->areabuf) || (!gg->rp->AreaInfo)) warn_user("NoMemory","");
InitArea(gg->rp.AreaInfo,gg->areabuf,100/5); InitArea(gg->rp->AreaInfo,gg->areabuf,100/5);
gg->rp.TmpRas = AllocVec(sizeof(struct TmpRas),MEMF_PRIVATE | MEMF_CLEAR); gg->rp->TmpRas = AllocVec(sizeof(struct TmpRas),MEMF_PRIVATE | MEMF_CLEAR);
if((!gg->tmprasbuf) || (!gg->rp.TmpRas)) warn_user("NoMemory",""); if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) warn_user("NoMemory","");
InitTmpRas(gg->rp.TmpRas, gg->tmprasbuf, width*height); InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height);
#ifdef NS_AMIGA_CAIRO #ifdef NS_AMIGA_CAIRO
gg->surface = cairo_amigaos_surface_create(gg->rp.BitMap); gg->surface = cairo_amigaos_surface_create(gg->rp->BitMap);
gg->cr = cairo_create(gg->surface); gg->cr = cairo_create(gg->surface);
#endif #endif
} }
@ -167,21 +170,22 @@ void ami_free_layers(struct gui_globals *gg)
cairo_destroy(gg->cr); cairo_destroy(gg->cr);
cairo_surface_destroy(gg->surface); cairo_surface_destroy(gg->surface);
#endif #endif
DeleteLayer(0,gg->rp.Layer); DeleteLayer(0,gg->rp->Layer);
FreeVec(gg->rp.TmpRas); FreeVec(gg->rp->TmpRas);
FreeVec(gg->rp.AreaInfo); FreeVec(gg->rp->AreaInfo);
DisposeLayerInfo(gg->layerinfo);
p96FreeBitMap(gg->bm);
FreeVec(gg->tmprasbuf); FreeVec(gg->tmprasbuf);
FreeVec(gg->areabuf); FreeVec(gg->areabuf);
DisposeLayerInfo(gg->layerinfo);
FreeVec(gg->rp);
p96FreeBitMap(gg->bm);
} }
void ami_clearclipreg(struct gui_globals *gg) void ami_clearclipreg(struct gui_globals *gg)
{ {
struct Region *reg = NULL; struct Region *reg = NULL;
reg = InstallClipRegion(gg->rp.Layer,NULL); reg = InstallClipRegion(gg->rp->Layer,NULL);
if(reg) DisposeRegion(reg); if(reg) DisposeRegion(reg);
gg->rect.MinX = 0; gg->rect.MinX = 0;
@ -200,10 +204,10 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
if(option_cairo_renderer < 2) if(option_cairo_renderer < 2)
{ {
SetRPAttrs(&glob->rp, RPTAG_APenColor, SetRPAttrs(glob->rp, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
TAG_DONE); TAG_DONE);
RectFill(&glob->rp, x0, y0, x1-1, y1-1); RectFill(glob->rp, x0, y0, x1-1, y1-1);
} }
else else
{ {
@ -222,37 +226,37 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
if (style->stroke_type != PLOT_OP_TYPE_NONE) { if (style->stroke_type != PLOT_OP_TYPE_NONE) {
if(option_cairo_renderer < 2) if(option_cairo_renderer < 2)
{ {
glob->rp.PenWidth = style->stroke_width; glob->rp->PenWidth = style->stroke_width;
glob->rp.PenHeight = style->stroke_width; glob->rp->PenHeight = style->stroke_width;
switch (style->stroke_type) { switch (style->stroke_type) {
case PLOT_OP_TYPE_SOLID: /**< Solid colour */ case PLOT_OP_TYPE_SOLID: /**< Solid colour */
default: default:
glob->rp.LinePtrn = PATT_LINE; glob->rp->LinePtrn = PATT_LINE;
break; break;
case PLOT_OP_TYPE_DOT: /**< Doted plot */ case PLOT_OP_TYPE_DOT: /**< Doted plot */
glob->rp.LinePtrn = PATT_DOT; glob->rp->LinePtrn = PATT_DOT;
break; break;
case PLOT_OP_TYPE_DASH: /**< dashed plot */ case PLOT_OP_TYPE_DASH: /**< dashed plot */
glob->rp.LinePtrn = PATT_DASH; glob->rp->LinePtrn = PATT_DASH;
break; break;
} }
SetRPAttrs(&glob->rp, SetRPAttrs(glob->rp,
RPTAG_APenColor, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour),
TAG_DONE); TAG_DONE);
Move(&glob->rp, x0,y0); Move(glob->rp, x0,y0);
Draw(&glob->rp, x1, y0); Draw(glob->rp, x1, y0);
Draw(&glob->rp, x1, y1); Draw(glob->rp, x1, y1);
Draw(&glob->rp, x0, y1); Draw(glob->rp, x0, y1);
Draw(&glob->rp, x0, y0); Draw(glob->rp, x0, y0);
glob->rp.PenWidth = 1; glob->rp->PenWidth = 1;
glob->rp.PenHeight = 1; glob->rp->PenHeight = 1;
glob->rp.LinePtrn = PATT_LINE; glob->rp->LinePtrn = PATT_LINE;
} }
else else
{ {
@ -295,34 +299,34 @@ bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
if(option_cairo_renderer < 2) if(option_cairo_renderer < 2)
{ {
glob->rp.PenWidth = style->stroke_width; glob->rp->PenWidth = style->stroke_width;
glob->rp.PenHeight = style->stroke_width; glob->rp->PenHeight = style->stroke_width;
switch (style->stroke_type) { switch (style->stroke_type) {
case PLOT_OP_TYPE_SOLID: /**< Solid colour */ case PLOT_OP_TYPE_SOLID: /**< Solid colour */
default: default:
glob->rp.LinePtrn = PATT_LINE; glob->rp->LinePtrn = PATT_LINE;
break; break;
case PLOT_OP_TYPE_DOT: /**< Doted plot */ case PLOT_OP_TYPE_DOT: /**< Doted plot */
glob->rp.LinePtrn = PATT_DOT; glob->rp->LinePtrn = PATT_DOT;
break; break;
case PLOT_OP_TYPE_DASH: /**< dashed plot */ case PLOT_OP_TYPE_DASH: /**< dashed plot */
glob->rp.LinePtrn = PATT_DASH; glob->rp->LinePtrn = PATT_DASH;
break; break;
} }
SetRPAttrs(&glob->rp, SetRPAttrs(glob->rp,
RPTAG_APenColor, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour),
TAG_DONE); TAG_DONE);
Move(&glob->rp,x0,y0); Move(glob->rp,x0,y0);
Draw(&glob->rp,x1,y1); Draw(glob->rp,x1,y1);
glob->rp.PenWidth = 1; glob->rp->PenWidth = 1;
glob->rp.PenHeight = 1; glob->rp->PenHeight = 1;
glob->rp.LinePtrn = PATT_LINE; glob->rp->LinePtrn = PATT_LINE;
} }
else else
{ {
@ -373,7 +377,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
{ {
ULONG cx,cy; ULONG cx,cy;
SetRPAttrs(&glob->rp, SetRPAttrs(glob->rp,
RPTAG_APenColor, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
RPTAG_OPenColor, RPTAG_OPenColor,
@ -381,15 +385,15 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
// RPTAG_OPenColor,0xffffffff, // RPTAG_OPenColor,0xffffffff,
TAG_DONE); TAG_DONE);
AreaMove(&glob->rp,p[0],p[1]); AreaMove(glob->rp,p[0],p[1]);
for(k=1;k<n;k++) for(k=1;k<n;k++)
{ {
AreaDraw(&glob->rp,p[k*2],p[(k*2)+1]); AreaDraw(glob->rp,p[k*2],p[(k*2)+1]);
} }
AreaEnd(&glob->rp); AreaEnd(glob->rp);
BNDRYOFF(&glob->rp); BNDRYOFF(glob->rp);
} }
else else
{ {
@ -418,7 +422,7 @@ bool ami_clip(const struct rect *clip)
struct Region *reg = NULL; struct Region *reg = NULL;
if(glob->rp.Layer) if(glob->rp->Layer)
{ {
reg = NewRegion(); reg = NewRegion();
@ -429,7 +433,7 @@ bool ami_clip(const struct rect *clip)
OrRectRegion(reg,&glob->rect); OrRectRegion(reg,&glob->rect);
reg = InstallClipRegion(glob->rp.Layer,reg); reg = InstallClipRegion(glob->rp->Layer,reg);
if(reg) DisposeRegion(reg); if(reg) DisposeRegion(reg);
} }
@ -454,7 +458,7 @@ bool ami_text(int x, int y, const char *text, size_t length,
LOG(("[ami_plotter] Entered ami_text()")); LOG(("[ami_plotter] Entered ami_text()"));
#endif #endif
ami_unicode_text(&glob->rp,text,length,fstyle,x,y); ami_unicode_text(glob->rp,text,length,fstyle,x,y);
return true; return true;
} }
@ -467,21 +471,21 @@ bool ami_disc(int x, int y, int radius, const plot_style_t *style)
if(option_cairo_renderer < 2) if(option_cairo_renderer < 2)
{ {
if (style->fill_type != PLOT_OP_TYPE_NONE) { if (style->fill_type != PLOT_OP_TYPE_NONE) {
SetRPAttrs(&glob->rp, SetRPAttrs(glob->rp,
RPTAG_APenColor, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
TAG_DONE); TAG_DONE);
AreaCircle(&glob->rp,x,y,radius); AreaCircle(glob->rp,x,y,radius);
AreaEnd(&glob->rp); AreaEnd(glob->rp);
} }
if (style->stroke_type != PLOT_OP_TYPE_NONE) { if (style->stroke_type != PLOT_OP_TYPE_NONE) {
SetRPAttrs(&glob->rp, SetRPAttrs(glob->rp,
RPTAG_APenColor, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour),
TAG_DONE); TAG_DONE);
DrawEllipse(&glob->rp,x,y,radius,radius); DrawEllipse(glob->rp,x,y,radius,radius);
} }
} }
else else
@ -536,12 +540,12 @@ bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_
/* http://www.crbond.com/primitives.htm /* http://www.crbond.com/primitives.htm
CommonFuncsPPC.lha */ CommonFuncsPPC.lha */
SetRPAttrs(&glob->rp, SetRPAttrs(glob->rp,
RPTAG_APenColor, RPTAG_APenColor,
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour), p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
TAG_DONE); TAG_DONE);
// DrawArc(&glob->rp,x,y,(float)angle1,(float)angle2,radius); // DrawArc(glob->rp,x,y,(float)angle1,(float)angle2,radius);
} }
return true; return true;
} }
@ -562,7 +566,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
(y > glob->rect.MaxY)) (y > glob->rect.MaxY))
return true; return true;
tbm = ami_getcachenativebm(bitmap,width,height,glob->rp.BitMap); tbm = ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
if(!tbm) return true; if(!tbm) return true;
@ -576,7 +580,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
if(!bitmap->opaque) if(!bitmap->opaque)
comptype = COMPOSITE_Src_Over_Dest; comptype = COMPOSITE_Src_Over_Dest;
CompositeTags(comptype,tbm,glob->rp.BitMap, CompositeTags(comptype,tbm,glob->rp->BitMap,
COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha, COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha,
COMPTAG_DestX,glob->rect.MinX, COMPTAG_DestX,glob->rect.MinX,
COMPTAG_DestY,glob->rect.MinY, COMPTAG_DestY,glob->rect.MinY,
@ -593,7 +597,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
BltBitMapTags(BLITA_Width,width, BltBitMapTags(BLITA_Width,width,
BLITA_Height,height, BLITA_Height,height,
BLITA_Source,tbm, BLITA_Source,tbm,
BLITA_Dest,&glob->rp, BLITA_Dest,glob->rp,
BLITA_DestX,x, BLITA_DestX,x,
BLITA_DestY,y, BLITA_DestY,y,
BLITA_SrcType,BLITT_BITMAP, BLITA_SrcType,BLITT_BITMAP,
@ -635,7 +639,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height == 1)) if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height == 1))
return true; return true;
tbm = ami_getcachenativebm(bitmap,width,height,glob->rp.BitMap); tbm = ami_getcachenativebm(bitmap,width,height,glob->rp->BitMap);
if(!tbm) return true; if(!tbm) return true;
@ -697,11 +701,11 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
bfh->h_Data = &bfbm; bfh->h_Data = &bfbm;
} }
InstallLayerHook(glob->rp.Layer,bfh); InstallLayerHook(glob->rp->Layer,bfh);
EraseRect(&glob->rp,xm,ym,xf,yf); EraseRect(glob->rp,xm,ym,xf,yf);
InstallLayerHook(glob->rp.Layer,LAYERS_NOBACKFILL); InstallLayerHook(glob->rp->Layer,LAYERS_NOBACKFILL);
if(bitmap->opaque) DeleteBackFillHook(bfh); if(bitmap->opaque) DeleteBackFillHook(bfh);
else FreeVec(bfh); else FreeVec(bfh);

View File

@ -28,7 +28,7 @@
struct gui_globals struct gui_globals
{ {
struct BitMap *bm; struct BitMap *bm;
struct RastPort rp; struct RastPort *rp;
struct Layer_Info *layerinfo; struct Layer_Info *layerinfo;
APTR areabuf; APTR areabuf;
APTR tmprasbuf; APTR tmprasbuf;