diff options
| author | YAMAMOTO Mitsuharu | 2006-03-16 08:06:16 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-03-16 08:06:16 +0000 |
| commit | e09ce637d3709b6a90a87b857387b2a60be10071 (patch) | |
| tree | 75db4e1cc8ed02695ed0cb5a85904b62dba1310a /src | |
| parent | c7fea3257f7198b8381dc4ec39c1a306042610ce (diff) | |
| download | emacs-e09ce637d3709b6a90a87b857387b2a60be10071.tar.gz emacs-e09ce637d3709b6a90a87b857387b2a60be10071.zip | |
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
Create GWorld in ARGB pixel format.
(mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]: Remove
functions.
(x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image
instead of mac_copy_area/mac_copy_area_with_mask.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/macterm.c | 29 |
2 files changed, 39 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b53b7937d86..9950dc20e50 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2006-03-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * image.c [MAC_OS] (XPutPixel, XGetPixel) | ||
| 4 | [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: Don't use specialized | ||
| 5 | version when depth is 32. | ||
| 6 | (mac_create_cg_image_from_image) [MAC_OS && USE_CG_DRAWING]: New | ||
| 7 | function. | ||
| 8 | (prepare_image_for_display) [MAC_OS && USE_CG_DRAWING]: Use it. | ||
| 9 | (x_clear_image_1) [MAC_OS && USE_CG_DRAWING]: Release CGImage. | ||
| 10 | |||
| 11 | * macterm.c (XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: | ||
| 12 | Create GWorld in ARGB pixel format. | ||
| 13 | (mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]: Remove | ||
| 14 | functions. | ||
| 15 | (x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image | ||
| 16 | instead of mac_copy_area/mac_copy_area_with_mask. | ||
| 17 | |||
| 1 | 2006-03-15 Kim F. Storm <storm@cua.dk> | 18 | 2006-03-15 Kim F. Storm <storm@cua.dk> |
| 2 | 19 | ||
| 3 | * xdisp.c (extend_face_to_end_of_line): Always add space glyph to | 20 | * xdisp.c (extend_face_to_end_of_line): Always add space glyph to |
diff --git a/src/macterm.c b/src/macterm.c index 6bb50bef6ca..b78c01e129e 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -653,7 +653,15 @@ XCreatePixmap (display, w, width, height, depth) | |||
| 653 | SetPortWindowPort (w); | 653 | SetPortWindowPort (w); |
| 654 | 654 | ||
| 655 | SetRect (&r, 0, 0, width, height); | 655 | SetRect (&r, 0, 0, width, height); |
| 656 | err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0); | 656 | #if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING |
| 657 | if (depth == 1) | ||
| 658 | #endif | ||
| 659 | err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0); | ||
| 660 | #if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING | ||
| 661 | else | ||
| 662 | /* CreateCGImageFromPixMaps requires ARGB format. */ | ||
| 663 | err = QTNewGWorld (&pixmap, k32ARGBPixelFormat, &r, NULL, NULL, 0); | ||
| 664 | #endif | ||
| 657 | if (err != noErr) | 665 | if (err != noErr) |
| 658 | return NULL; | 666 | return NULL; |
| 659 | return pixmap; | 667 | return pixmap; |
| @@ -1336,6 +1344,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width) | |||
| 1336 | #endif | 1344 | #endif |
| 1337 | 1345 | ||
| 1338 | 1346 | ||
| 1347 | #if !USE_CG_DRAWING | ||
| 1339 | /* Mac replacement for XCopyArea: dest must be window. */ | 1348 | /* Mac replacement for XCopyArea: dest must be window. */ |
| 1340 | 1349 | ||
| 1341 | static void | 1350 | static void |
| @@ -1349,9 +1358,6 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y) | |||
| 1349 | { | 1358 | { |
| 1350 | Rect src_r, dest_r; | 1359 | Rect src_r, dest_r; |
| 1351 | 1360 | ||
| 1352 | #if USE_CG_DRAWING | ||
| 1353 | mac_prepare_for_quickdraw (f); | ||
| 1354 | #endif | ||
| 1355 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); | 1361 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
| 1356 | 1362 | ||
| 1357 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); | 1363 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
| @@ -1396,9 +1402,6 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y, | |||
| 1396 | { | 1402 | { |
| 1397 | Rect src_r, dest_r; | 1403 | Rect src_r, dest_r; |
| 1398 | 1404 | ||
| 1399 | #if USE_CG_DRAWING | ||
| 1400 | mac_prepare_for_quickdraw (f); | ||
| 1401 | #endif | ||
| 1402 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); | 1405 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
| 1403 | 1406 | ||
| 1404 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); | 1407 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
| @@ -1431,6 +1434,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y, | |||
| 1431 | 1434 | ||
| 1432 | RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); | 1435 | RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
| 1433 | } | 1436 | } |
| 1437 | #endif /* !USE_CG_DRAWING */ | ||
| 1434 | 1438 | ||
| 1435 | 1439 | ||
| 1436 | /* Mac replacement for XCopyArea: used only for scrolling. */ | 1440 | /* Mac replacement for XCopyArea: used only for scrolling. */ |
| @@ -3285,15 +3289,26 @@ x_draw_image_foreground (s) | |||
| 3285 | { | 3289 | { |
| 3286 | x_set_glyph_string_clipping (s); | 3290 | x_set_glyph_string_clipping (s); |
| 3287 | 3291 | ||
| 3292 | #if USE_CG_DRAWING | ||
| 3293 | mac_draw_cg_image (s->img->data.ptr_val, | ||
| 3294 | s->f, s->gc, s->slice.x, s->slice.y, | ||
| 3295 | s->slice.width, s->slice.height, x, y, 1); | ||
| 3296 | #endif | ||
| 3288 | if (s->img->mask) | 3297 | if (s->img->mask) |
| 3298 | #if !USE_CG_DRAWING | ||
| 3289 | mac_copy_area_with_mask (s->img->pixmap, s->img->mask, | 3299 | mac_copy_area_with_mask (s->img->pixmap, s->img->mask, |
| 3290 | s->f, s->gc, s->slice.x, s->slice.y, | 3300 | s->f, s->gc, s->slice.x, s->slice.y, |
| 3291 | s->slice.width, s->slice.height, x, y); | 3301 | s->slice.width, s->slice.height, x, y); |
| 3302 | #else | ||
| 3303 | ; | ||
| 3304 | #endif | ||
| 3292 | else | 3305 | else |
| 3293 | { | 3306 | { |
| 3307 | #if !USE_CG_DRAWING | ||
| 3294 | mac_copy_area (s->img->pixmap, | 3308 | mac_copy_area (s->img->pixmap, |
| 3295 | s->f, s->gc, s->slice.x, s->slice.y, | 3309 | s->f, s->gc, s->slice.x, s->slice.y, |
| 3296 | s->slice.width, s->slice.height, x, y); | 3310 | s->slice.width, s->slice.height, x, y); |
| 3311 | #endif | ||
| 3297 | 3312 | ||
| 3298 | /* When the image has a mask, we can expect that at | 3313 | /* When the image has a mask, we can expect that at |
| 3299 | least part of a mouse highlight or a block cursor will | 3314 | least part of a mouse highlight or a block cursor will |