Changeset 202:3313d5e8d23c
- Timestamp:
- 03/08/08 10:32:26
(7 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
removed some heap allocs
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r200 |
r202 |
|
| 396 | 396 | GdkRectangle* rects; |
|---|
| 397 | 397 | OS.gdk_region_get_rectangles(rgn, &rects, &nRects); |
|---|
| 398 | | GdkRectangle* rect = new GdkRectangle(); |
|---|
| 399 | | int[] pointArray = new int[8]; |
|---|
| | 398 | GdkRectangle* rect; |
|---|
| | 399 | int[8] pointArray; |
|---|
| 400 | 400 | double x, y; |
|---|
| 401 | 401 | for (int i=0; i<nRects; i++) { |
|---|
| 402 | | *rect = rects[i]; |
|---|
| | 402 | rect = rects +i; |
|---|
| 403 | 403 | x = rect.x; |
|---|
| 404 | 404 | y = rect.y; |
|---|
| … | … | |
| 504 | 504 | OS.gdk_gc_set_exposures(handle, false); |
|---|
| 505 | 505 | bool disjoint = (destX + width < srcX) || (srcX + width < destX) || (destY + height < srcY) || (srcY + height < destY); |
|---|
| 506 | | GdkRectangle* rect = new GdkRectangle (); |
|---|
| | 506 | GdkRectangle rect; |
|---|
| 507 | 507 | if (disjoint) { |
|---|
| 508 | 508 | rect.x = srcX; |
|---|
| … | … | |
| 510 | 510 | rect.width = width; |
|---|
| 511 | 511 | rect.height = height; |
|---|
| 512 | | OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, rect, false); |
|---|
| | 512 | OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, &rect, false); |
|---|
| 513 | 513 | // OS.gdk_window_clear_area_e(drawable, srcX, srcY, width, height); |
|---|
| 514 | 514 | } else { |
|---|
| … | … | |
| 520 | 520 | rect.width = Math.abs(deltaX); |
|---|
| 521 | 521 | rect.height = height; |
|---|
| 522 | | OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, rect, false); |
|---|
| | 522 | OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, &rect, false); |
|---|
| 523 | 523 | // OS.gdk_window_clear_area_e(drawable, newX, srcY, Math.abs(deltaX), height); |
|---|
| 524 | 524 | } |
|---|
| … | … | |
| 530 | 530 | rect.width = width; |
|---|
| 531 | 531 | rect.height = Math.abs(deltaY); |
|---|
| 532 | | OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, rect, false); |
|---|
| | 532 | OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, &rect, false); |
|---|
| 533 | 533 | // OS.gdk_window_clear_area_e(drawable, srcX, newY, width, Math.abs(deltaY)); |
|---|
| 534 | 534 | } |
|---|
| … | … | |
| 1102 | 1102 | GdkRectangle* rects; |
|---|
| 1103 | 1103 | OS.gdk_region_get_rectangles(clipping, &rects, &nRects); |
|---|
| 1104 | | GdkRectangle* rect = new GdkRectangle(); |
|---|
| | 1104 | GdkRectangle* rect; |
|---|
| 1105 | 1105 | short[] xRects = new short[nRects * 4]; |
|---|
| 1106 | 1106 | for (int i=0, j=0; i<nRects; i++, j+=4) { |
|---|
| 1107 | | *rect = rects[i]; |
|---|
| 1108 | | xRects[j] = cast(short)rect.x; |
|---|
| | 1107 | rect = rects +i; |
|---|
| | 1108 | xRects[j ] = cast(short)rect.x; |
|---|
| 1109 | 1109 | xRects[j+1] = cast(short)rect.y; |
|---|
| 1110 | 1110 | xRects[j+2] = cast(short)rect.width; |
|---|
| … | … | |
| 2294 | 2294 | if (clipRgn !is null || damageRgn !is null || cairo !is null) { |
|---|
| 2295 | 2295 | auto rgn = OS.gdk_region_new(); |
|---|
| 2296 | | GdkRectangle* rect = new GdkRectangle(); |
|---|
| | 2296 | GdkRectangle rect; |
|---|
| 2297 | 2297 | rect.width = width; |
|---|
| 2298 | 2298 | rect.height = height; |
|---|
| 2299 | | OS.gdk_region_union_with_rect(rgn, rect); |
|---|
| | 2299 | OS.gdk_region_union_with_rect(rgn, &rect); |
|---|
| 2300 | 2300 | if (damageRgn !is null) { |
|---|
| 2301 | 2301 | OS.gdk_region_intersect (rgn, damageRgn); |
|---|
| … | … | |
| 2321 | 2321 | rgn = clipRgn; |
|---|
| 2322 | 2322 | } |
|---|
| 2323 | | OS.gdk_region_get_clipbox(rgn, rect); |
|---|
| | 2323 | OS.gdk_region_get_clipbox(rgn, &rect); |
|---|
| 2324 | 2324 | OS.gdk_region_destroy(rgn); |
|---|
| 2325 | 2325 | x = rect.x; |
|---|
| … | … | |
| 2356 | 2356 | int width,height; |
|---|
| 2357 | 2357 | OS.gdk_drawable_get_size(data.drawable, &width, &height); |
|---|
| 2358 | | GdkRectangle* rect = new GdkRectangle(); |
|---|
| | 2358 | GdkRectangle rect; |
|---|
| 2359 | 2359 | rect.width = width; |
|---|
| 2360 | 2360 | rect.height = height; |
|---|
| 2361 | | OS.gdk_region_union_with_rect(clipping, rect); |
|---|
| | 2361 | OS.gdk_region_union_with_rect(clipping, &rect); |
|---|
| 2362 | 2362 | } else { |
|---|
| 2363 | 2363 | /* Convert clipping to device space if needed */ |
|---|
| … | … | |
| 3080 | 3080 | GdkRectangle * rects; |
|---|
| 3081 | 3081 | OS.gdk_region_get_rectangles(clipRgn, &rects, &nRects); |
|---|
| 3082 | | GdkRectangle* rect = new GdkRectangle(); |
|---|
| | 3082 | //GdkRectangle* rect = new GdkRectangle(); |
|---|
| 3083 | 3083 | for (int i=0; i<nRects; i++) { |
|---|
| 3084 | 3084 | Cairo.cairo_rectangle(cairo, rects[i].x, rects[i].y, rects[i].width, rects[i].height); |
|---|
| … | … | |
| 3157 | 3157 | height = -height; |
|---|
| 3158 | 3158 | } |
|---|
| 3159 | | GdkRectangle* rect = new GdkRectangle(); |
|---|
| | 3159 | GdkRectangle rect; |
|---|
| 3160 | 3160 | rect.x = x; |
|---|
| 3161 | 3161 | rect.y = y; |
|---|
| … | … | |
| 3163 | 3163 | rect.height = height; |
|---|
| 3164 | 3164 | auto clipRgn = OS.gdk_region_new(); |
|---|
| 3165 | | OS.gdk_region_union_with_rect(clipRgn, rect); |
|---|
| | 3165 | OS.gdk_region_union_with_rect(clipRgn, &rect); |
|---|
| 3166 | 3166 | setClipping(clipRgn); |
|---|
| 3167 | 3167 | OS.gdk_region_destroy(clipRgn); |
|---|