diff --git a/ChangeLog b/ChangeLog index aaef4b3..6610518 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-09-16 16:36 Alexander Malmberg + + * Source/art/ARTGState.h, Source/art/ARTContext.m, + Source/art/image.m, Source/art/composite.m, Source/art/path.m: + Handle NSBackingStoreNonretained. + 2002-09-14 13:39 Alexander Malmberg * Source/art/ftfont.m: Keep track of the family name in FTFaceInfo diff --git a/Source/art/ARTContext.m b/Source/art/ARTContext.m index d018a19..d409768 100644 --- a/Source/art/ARTContext.m +++ b/Source/art/ARTContext.m @@ -211,25 +211,26 @@ very expensive - (void) DPSshow: (const char*)s { - NSPoint p; - int x,y; + NSPoint p; + int x, y; - if (!wi || !wi->data) return; - if (all_clipped) - return; + if (!wi || !wi->data) return; + if (all_clipped) + return; - if ([path isEmpty]) return; - p=[path currentPoint]; + if ([path isEmpty]) return; + p = [path currentPoint]; - x=p.x; - y=wi->sy-p.y; - [(id)[font fontInfo] - drawString: s - at: x:y - to: clip_x0:clip_y0:clip_x1:clip_y1:CLIP_DATA:wi->bytes_per_line - color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] - transform: ctm - drawinfo: &DI]; + x = p.x; + y = wi->sy - p.y; + [(id)[font fontInfo] + drawString: s + at: x:y + to: clip_x0:clip_y0:clip_x1:clip_y1 : CLIP_DATA : wi->bytes_per_line + color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] + transform: ctm + drawinfo: &DI]; + UPDATE_UNBUFFERED } - (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s @@ -239,71 +240,74 @@ very expensive - (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size { - NSPoint p; - int x,y; + NSPoint p; + int x, y; - if (!wi || !wi->data) return; - if (all_clipped) - return; + if (!wi || !wi->data) return; + if (all_clipped) + return; - if ([path isEmpty]) return; - p=[path currentPoint]; + if ([path isEmpty]) return; + p = [path currentPoint]; - x=p.x; - y=wi->sy-p.y; - [(id)[font fontInfo] - drawString: s - at: x:y - to: clip_x0:clip_y0:clip_x1:clip_y1:CLIP_DATA:wi->bytes_per_line - color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] - transform: ctm - deltas: numarray : size : 1]; + x = p.x; + y = wi->sy - p.y; + [(id)[font fontInfo] + drawString: s + at: x:y + to: clip_x0:clip_y0:clip_x1:clip_y1 : CLIP_DATA : wi->bytes_per_line + color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] + transform: ctm + deltas: numarray : size : 1]; + UPDATE_UNBUFFERED } - (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size { - NSPoint p; - int x,y; + NSPoint p; + int x, y; - if (!wi || !wi->data) return; - if (all_clipped) - return; + if (!wi || !wi->data) return; + if (all_clipped) + return; - if ([path isEmpty]) return; - p=[path currentPoint]; + if ([path isEmpty]) return; + p = [path currentPoint]; - x=p.x; - y=wi->sy-p.y; - [(id)[font fontInfo] - drawString: s - at: x:y - to: clip_x0:clip_y0:clip_x1:clip_y1:CLIP_DATA:wi->bytes_per_line - color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] - transform: ctm - deltas: numarray : size : 3]; + x = p.x; + y = wi->sy - p.y; + [(id)[font fontInfo] + drawString: s + at: x:y + to: clip_x0:clip_y0:clip_x1:clip_y1 : CLIP_DATA : wi->bytes_per_line + color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] + transform: ctm + deltas: numarray : size : 3]; + UPDATE_UNBUFFERED } - (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size { - NSPoint p; - int x,y; + NSPoint p; + int x, y; - if (!wi || !wi->data) return; - if (all_clipped) - return; + if (!wi || !wi->data) return; + if (all_clipped) + return; - if ([path isEmpty]) return; - p=[path currentPoint]; + if ([path isEmpty]) return; + p = [path currentPoint]; - x=p.x; - y=wi->sy-p.y; - [(id)[font fontInfo] - drawString: s - at: x:y - to: clip_x0:clip_y0:clip_x1:clip_y1:CLIP_DATA:wi->bytes_per_line - color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] - transform: ctm - deltas: numarray : size : 2]; + x = p.x; + y = wi->sy - p.y; + [(id)[font fontInfo] + drawString: s + at: x:y + to: clip_x0:clip_y0:clip_x1:clip_y1 : CLIP_DATA : wi->bytes_per_line + color: fill_color[0]:fill_color[1]:fill_color[2]:fill_color[3] + transform: ctm + deltas: numarray : size : 2]; + UPDATE_UNBUFFERED } diff --git a/Source/art/ARTGState.h b/Source/art/ARTGState.h index 8073f52..1244538 100644 --- a/Source/art/ARTGState.h +++ b/Source/art/ARTGState.h @@ -84,6 +84,14 @@ @end +#define UPDATE_UNBUFFERED \ + if (wi->window->type==NSBackingStoreNonretained) \ + { \ + [wi _exposeRect: NSMakeRect(clip_x0,clip_y0,clip_sx,clip_sy)]; \ + } + + + extern struct draw_info_s ART_DI; #define DI ART_DI diff --git a/Source/art/composite.m b/Source/art/composite.m index cda7adb..493141f 100644 --- a/Source/art/composite.m +++ b/Source/art/composite.m @@ -818,6 +818,7 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1) } } } + UPDATE_UNBUFFERED } @@ -1016,7 +1017,6 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1) if (!DI.inline_alpha) memset(dst_alpha, 0, n); ) - return; } else if (op == NSCompositeHighlight) { @@ -1028,7 +1028,6 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1) (*d) ^= 0xff; } ) - return; } else if (op == NSCompositeCopy) { @@ -1061,7 +1060,6 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1) memset(dst_alpha, ri.a, n); } ) - return; } else if (blit_func) { @@ -1110,13 +1108,15 @@ static BOOL _rect_advance(rect_trace_t *t, int *x0, int *x1) c.dsta = dst_alpha; blit_func(&c, n); ) - return; } - - NSLog(@"unimplemented compositerect: (%g %g)+(%g %g) op: %i", - aRect.origin.x, aRect.origin.y, - aRect.size.width, aRect.size.height, - op); + else + { + NSLog(@"unimplemented compositerect: (%g %g)+(%g %g) op: %i", + aRect.origin.x, aRect.origin.y, + aRect.size.width, aRect.size.height, + op); + } + UPDATE_UNBUFFERED } @end diff --git a/Source/art/image.m b/Source/art/image.m index 0aa0e54..bfb938e 100644 --- a/Source/art/image.m +++ b/Source/art/image.m @@ -615,6 +615,7 @@ seem to cause edges to be off by a pixel } } } + UPDATE_UNBUFFERED return; } @@ -633,6 +634,7 @@ seem to cause edges to be off by a pixel (samplesPerPixel == 4 && hasAlpha))) { [self _image_do_rgb_transform: &ii : matrix : _image_get_color_rgb_8]; + UPDATE_UNBUFFERED return; } @@ -652,6 +654,7 @@ seem to cause edges to be off by a pixel { [self _image_do_rgb_transform: &ii : matrix : _image_get_color_rgb_cmyk_gray]; + UPDATE_UNBUFFERED return; } diff --git a/Source/art/path.m b/Source/art/path.m index bbdbaa6..2c48f76 100644 --- a/Source/art/path.m +++ b/Source/art/path.m @@ -866,6 +866,8 @@ static void clip_svp_callback(void *data, int y, int start, art_svp_free(svp); [path removeAllPoints]; + + UPDATE_UNBUFFERED } - (void) DPSeofill @@ -906,6 +908,7 @@ static void clip_svp_callback(void *data, int y, int start, &DI, clip_span, clip_index); art_svp_free(svp); + UPDATE_UNBUFFERED return; } @@ -977,6 +980,7 @@ static void clip_svp_callback(void *data, int y, int start, RENDER_RUN_ALPHA(&ri, x1); } } + UPDATE_UNBUFFERED } } @@ -1032,6 +1036,7 @@ static void clip_svp_callback(void *data, int y, int start, &DI, clip_span, clip_index); art_svp_free(svp); + UPDATE_UNBUFFERED } - (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h