Still looking for bug reports and suggested patches I found this on the grx list:
Thank you, Peter. It works perfectly. But now I've run into another problem: I'm applying the pixmap to a SubContext, not to the whole screen. It seems that the function GrPatternFilledBox doesnŽt take this into account, and starts painting at left corner of the screen, not of the SubContext.
I suspect that the line (file patfbox.c, function GrPatternFilledBox):
(*bltfun)( &CURC->gc_frame,xpos,y1, &p->gp_pxp_source,xcuroff,yoff,fillw,fillh, p->gp_pxp_oper );
should be:
(*bltfun)( &CURC->gc_frame, xpos+CURC->gc_xoffset, //adding the
subcontext offset y1+CURC->gc_yoffset, //adding the subcontext offset &p->gp_pxp_source,xcuroff,yoff,fillw,fillh, p->gp_pxp_oper );
I've implemented the change, and it works. I wonder if it's a bug or it's something else I'm doing wrong.
Well, it looks like most of the pattern stuff should be fixed this way.
Anyone out there who could implement a checking tool for GRX for subcontext support ? Im thinking about something like:
create memory context (eg. 200x200x8bpp) apply some GRX drawing functions (keep a 10 pixel border !) Check 1: border must be clear create a sub context (180x180x8bpp) redo the drawing functions in the sub context using black Check 2: original context should be cleared now
Hartmut