diff options
| author | Jason Rumney | 2002-01-24 20:41:46 +0000 |
|---|---|---|
| committer | Jason Rumney | 2002-01-24 20:41:46 +0000 |
| commit | 4d6e81995c424e3a6e7b6c53258a031fe3fe3aff (patch) | |
| tree | 9626077f2edc15936ad0c13db54b92aa82ce3815 /src | |
| parent | bfabe8828eeaf438f36a1f4eb2d861b53f66eb2a (diff) | |
| download | emacs-4d6e81995c424e3a6e7b6c53258a031fe3fe3aff.tar.gz emacs-4d6e81995c424e3a6e7b6c53258a031fe3fe3aff.zip | |
(x_scroll_run): Use ScrollWindowEx in place of BitBlt.
If region left to draw is not what was expected, mark the frame as
garbaged.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32term.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/w32term.c b/src/w32term.c index b7b2c96e553..119e77b2a73 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5453,7 +5453,8 @@ x_scroll_run (w, run) | |||
| 5453 | { | 5453 | { |
| 5454 | struct frame *f = XFRAME (w->frame); | 5454 | struct frame *f = XFRAME (w->frame); |
| 5455 | int x, y, width, height, from_y, to_y, bottom_y; | 5455 | int x, y, width, height, from_y, to_y, bottom_y; |
| 5456 | HDC hdc = get_frame_dc (f); | 5456 | HWND hwnd = FRAME_W32_WINDOW (f); |
| 5457 | HRGN expect_dirty; | ||
| 5457 | 5458 | ||
| 5458 | /* Get frame-relative bounding box of the text display area of W, | 5459 | /* Get frame-relative bounding box of the text display area of W, |
| 5459 | without mode lines. Include in this box the left and right | 5460 | without mode lines. Include in this box the left and right |
| @@ -5474,6 +5475,7 @@ x_scroll_run (w, run) | |||
| 5474 | height = bottom_y - from_y; | 5475 | height = bottom_y - from_y; |
| 5475 | else | 5476 | else |
| 5476 | height = run->height; | 5477 | height = run->height; |
| 5478 | expect_dirty = CreateRectRgn (x, y + height, x + width, bottom_y); | ||
| 5477 | } | 5479 | } |
| 5478 | else | 5480 | else |
| 5479 | { | 5481 | { |
| @@ -5483,6 +5485,7 @@ x_scroll_run (w, run) | |||
| 5483 | height = bottom_y - to_y; | 5485 | height = bottom_y - to_y; |
| 5484 | else | 5486 | else |
| 5485 | height = run->height; | 5487 | height = run->height; |
| 5488 | expect_dirty = CreateRectRgn (x, y, x + width, to_y); | ||
| 5486 | } | 5489 | } |
| 5487 | 5490 | ||
| 5488 | BLOCK_INPUT; | 5491 | BLOCK_INPUT; |
| @@ -5491,10 +5494,32 @@ x_scroll_run (w, run) | |||
| 5491 | updated_window = w; | 5494 | updated_window = w; |
| 5492 | x_clear_cursor (w); | 5495 | x_clear_cursor (w); |
| 5493 | 5496 | ||
| 5494 | BitBlt (hdc, x, to_y, width, height, hdc, x, from_y, SRCCOPY); | 5497 | { |
| 5495 | 5498 | RECT from; | |
| 5499 | RECT to; | ||
| 5500 | HRGN dirty = CreateRectRgn (0, 0, 0, 0); | ||
| 5501 | HRGN combined = CreateRectRgn (0, 0, 0, 0); | ||
| 5502 | |||
| 5503 | from.left = to.left = x; | ||
| 5504 | from.right = to.right = x + width; | ||
| 5505 | from.top = from_y; | ||
| 5506 | from.bottom = from_y + height; | ||
| 5507 | to.top = y; | ||
| 5508 | to.bottom = bottom_y; | ||
| 5509 | |||
| 5510 | ScrollWindowEx (hwnd, 0, to_y - from_y, &from, &to, dirty, | ||
| 5511 | NULL, SW_INVALIDATE); | ||
| 5512 | |||
| 5513 | /* Combine this with what we expect to be dirty. This covers the | ||
| 5514 | case where not all of the region we expect is actually dirty. */ | ||
| 5515 | CombineRgn (combined, dirty, expect_dirty, RGN_OR); | ||
| 5516 | |||
| 5517 | /* If the dirty region is not what we expected, redraw the entire frame. */ | ||
| 5518 | if (!EqualRgn (combined, expect_dirty)) | ||
| 5519 | SET_FRAME_GARBAGED (f); | ||
| 5520 | } | ||
| 5521 | |||
| 5496 | UNBLOCK_INPUT; | 5522 | UNBLOCK_INPUT; |
| 5497 | release_frame_dc (f, hdc); | ||
| 5498 | } | 5523 | } |
| 5499 | 5524 | ||
| 5500 | 5525 | ||
| @@ -10464,7 +10489,7 @@ x_make_frame_visible (f) | |||
| 10464 | 10489 | ||
| 10465 | f->output_data.w32->asked_for_visible = 1; | 10490 | f->output_data.w32->asked_for_visible = 1; |
| 10466 | 10491 | ||
| 10467 | // my_show_window (f, FRAME_W32_WINDOW (f), f->async_iconified ? SW_RESTORE : SW_SHOW); | 10492 | /* my_show_window (f, FRAME_W32_WINDOW (f), f->async_iconified ? SW_RESTORE : SW_SHOW); */ |
| 10468 | my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); | 10493 | my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); |
| 10469 | } | 10494 | } |
| 10470 | 10495 | ||