Use GetUpdateRgn() on Windows Mobile

RESOLVED FIXED

Status

Fennec Graveyard
General
--
major
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Brian Crowder, Assigned: Brian Crowder)

Tracking

Trunk
ARM
Windows Mobile 6 Professional

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

8 years ago
Created attachment 423566 [details]
One big fix

+++ This bug was initially created as a clone of Bug #540668 +++

I see this issue primarily when scrolling chrome windows, such as the awesomepanel.  Whenever are are using a ::Invalidate*() GDI call, we should be adding the same region to our mInvalidatedRegion member.  Without doing so, we end not blitting enough to properly redraw in WM_PAINT.

Alternatively, we should experiment with using ::GetUpdateRgn() or something comparable as a replacement for ::GetRandomRgn() -- which doesn't exist on WinCE apparently -- instead of manually tracking our invalidated region.
(Assignee)

Comment 1

8 years ago
Comment on attachment 423566 [details]
One big fix

This patch helps a lot, but isn't the whole fix.  I'm going to experiment with ::GetUpdateRgn() next.
(Assignee)

Comment 2

8 years ago
Created attachment 423634 [details] [diff] [review]
w00t

This works well and rips out entirely the code that maintains a "duplicate" invalidated region.
Assignee: nobody → crowderbt
Attachment #423566 - Attachment is obsolete: true
Comment on attachment 423634 [details] [diff] [review]
w00t

The latest patch works well. It seems to solve the issues I've seen with panning the awesome panel.  

>@@ -1028,21 +1031,10 @@ PRBool nsWindow::OnPaintImageDDraw16()
>     SetLastError(0); // See http://msdn.microsoft.com/en-us/library/dd145046%28VS.85%29.aspx
>     if (MapWindowPoints(mWnd, 0, (LPPOINT)&renderRect, 2) || 0 == (hr = GetLastError()))
>       hr = glpDDPrimary->Blt(&renderRect, glpDDSecondary, &r, 0, NULL);
>-#ifdef WINCE_WINDOWS_MOBILE
>-    if (FAILED(hr))
>-      // add this rect back to the invalidated region so we'll attempt paint it next time around
>-      mInvalidatedRegion->Union(rects->mRects[i].x, rects->mRects[i].y,
>-                                rects->mRects[i].width, rects->mRects[i].height);
>-#endif
>   }
>   result = PR_TRUE;
> 
> cleanup:
>-#ifdef WINCE_WINDOWS_MOBILE
>-  // re-invalidate the region if we failed.
>-  if (!result)
>-    mInvalidatedRegion->Union(*paintRgnWin.get());
>-#endif
>   ::EndPaint(mWnd, &ps);
>   mPaintDC = nsnull;
>   mPainting = PR_FALSE;

I think we still want to re-invalidate the region or rect if we fail to paint it.
Blocks: 540668
No longer depends on: 540668
(Assignee)

Updated

8 years ago
Summary: need to update mInvalidateRegion correctly for Windows Mobile → Use GetUpdateRgn() on Windows Mobile
(Assignee)

Comment 4

8 years ago
Created attachment 424026 [details] [diff] [review]
the one to review
Attachment #423634 - Attachment is obsolete: true
Attachment #424026 - Flags: review?(bugmail)
Attachment #424026 - Flags: review?(bugmail) → review+
Comment on attachment 424026 [details] [diff] [review]
the one to review


>+  paintRgn = ::CreateRectRgn(0, 0, 0, 0);
you shouldn't need to initialize it here, just drop this line

> cleanup:
>-#ifdef WINCE_WINDOWS_MOBILE
>-  // re-invalidate the region if we failed.
>-  if (!result)
>-    mInvalidatedRegion->Union(*paintRgnWin.get());
>-#endif
if result is false, have an NS_ERROR() saying so
(Assignee)

Comment 6

8 years ago
Created attachment 424120 [details] [diff] [review]
argh
Attachment #424026 - Attachment is obsolete: true
(Assignee)

Comment 7

8 years ago
http://hg.mozilla.org/mozilla-central/rev/2c5af96a439b
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
(Assignee)

Updated

8 years ago
Attachment #424120 - Flags: approval1.9.2.1?
tracking-fennec: 1.0-wm+ → 1.0a4-wm+
Attachment #424120 - Flags: approval1.9.2.2?

Updated

8 years ago
Component: Windows Mobile → General
QA Contact: mobile-windows → general
You need to log in before you can comment on or make changes to this bug.