зеркало из https://github.com/mozilla/pjs.git
Bug 542280 - use GetUpdateRgn() on Windows mobile, r=blassey
This commit is contained in:
Родитель
cc720f03d5
Коммит
aca201ec7f
|
@ -404,11 +404,6 @@ nsWindow::nsWindow() : nsBaseWidget()
|
|||
mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground));
|
||||
mForeground = ::GetSysColor(COLOR_WINDOWTEXT);
|
||||
|
||||
#ifdef WINCE_WINDOWS_MOBILE
|
||||
mInvalidatedRegion = do_CreateInstance(kRegionCID);
|
||||
mInvalidatedRegion->Init();
|
||||
#endif
|
||||
|
||||
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_WIN7
|
||||
mTaskbarPreview = nsnull;
|
||||
mHasTaskbarIconBeenCreated = PR_FALSE;
|
||||
|
@ -2097,12 +2092,7 @@ NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous)
|
|||
nsCAutoString("noname"),
|
||||
(PRInt32) mWnd);
|
||||
#endif // WIDGET_DEBUG_OUTPUT
|
||||
#ifdef WINCE_WINDOWS_MOBILE
|
||||
// We need to keep track of our own invalidated region for Windows CE
|
||||
RECT r;
|
||||
GetClientRect(mWnd, &r);
|
||||
AddRECTToRegion(r, mInvalidatedRegion);
|
||||
#endif
|
||||
|
||||
VERIFY(::InvalidateRect(mWnd, NULL, FALSE));
|
||||
|
||||
if (aIsSynchronous) {
|
||||
|
@ -2133,10 +2123,6 @@ NS_METHOD nsWindow::Invalidate(const nsIntRect & aRect, PRBool aIsSynchronous)
|
|||
rect.right = aRect.x + aRect.width;
|
||||
rect.bottom = aRect.y + aRect.height;
|
||||
|
||||
#ifdef WINCE_WINDOWS_MOBILE
|
||||
// We need to keep track of our own invalidated region for Windows CE
|
||||
AddRECTToRegion(rect, mInvalidatedRegion);
|
||||
#endif
|
||||
VERIFY(::InvalidateRect(mWnd, &rect, FALSE));
|
||||
|
||||
if (aIsSynchronous) {
|
||||
|
@ -6199,11 +6185,6 @@ HBRUSH nsWindow::OnControlColor()
|
|||
// Can be overriden. Controls auto-erase of background.
|
||||
PRBool nsWindow::AutoErase(HDC dc)
|
||||
{
|
||||
#ifdef WINCE_WINDOWS_MOBILE
|
||||
RECT wrect;
|
||||
GetClipBox(dc, &wrect);
|
||||
AddRECTToRegion(wrect, mInvalidatedRegion);
|
||||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -429,9 +429,6 @@ protected:
|
|||
nsPopupType mPopupType;
|
||||
PRPackedBool mDisplayPanFeedback;
|
||||
WindowHook mWindowHook;
|
||||
#ifdef WINCE_WINDOWS_MOBILE
|
||||
nsCOMPtr<nsIRegion> mInvalidatedRegion;
|
||||
#endif
|
||||
static PRUint32 sInstanceCount;
|
||||
static TriStateBool sCanQuit;
|
||||
static nsWindow* sCurrentWindow;
|
||||
|
|
|
@ -283,13 +283,16 @@ nsCOMPtr<nsIRegion> nsWindow::GetRegionToPaint(PRBool aForceFullRepaint,
|
|||
}
|
||||
#else
|
||||
# ifdef WINCE_WINDOWS_MOBILE
|
||||
if (!mInvalidatedRegion->IsEmpty()) {
|
||||
// XXX: we may not recieve invalidates when an OS dialog obsures out window
|
||||
// and dismisses, so mInvalidatedRegion may not be complete
|
||||
paintRgnWin = mInvalidatedRegion.forget();
|
||||
mInvalidatedRegion = do_CreateInstance(kRegionCID);
|
||||
mInvalidatedRegion->Init();
|
||||
return paintRgnWin;
|
||||
paintRgn = ::CreateRectRgn(0, 0, 0, 0);
|
||||
if (paintRgn != NULL) {
|
||||
int result = GetUpdateRgn(mWnd, paintRgn, FALSE);
|
||||
if (result == 1) {
|
||||
POINT pt = {0,0};
|
||||
::MapWindowPoints(NULL, mWnd, &pt, 1);
|
||||
::OffsetRgn(paintRgn, pt.x, pt.y);
|
||||
}
|
||||
paintRgnWin = nsWindowGfx::ConvertHRGNToRegion(paintRgn);
|
||||
::DeleteObject(paintRgn);
|
||||
}
|
||||
# endif
|
||||
paintRgn = ::CreateRectRgn(ps.rcPaint.left, ps.rcPaint.top,
|
||||
|
@ -1044,23 +1047,17 @@ PRBool nsWindow::OnPaintImageDDraw16()
|
|||
r.bottom = rects->mRects[i].height + rects->mRects[i].y;
|
||||
RECT renderRect = r;
|
||||
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
|
||||
MapWindowPoints(mWnd, 0, (LPPOINT)&renderRect, 2);
|
||||
hr = glpDDPrimary->Blt(&renderRect, glpDDSecondary, &r, 0, NULL);
|
||||
if (FAILED(hr)) {
|
||||
NS_ERROR("this blt should never fail!");
|
||||
printf("#### %s blt failed: %08lx", __FUNCTION__, hr);
|
||||
}
|
||||
}
|
||||
result = PR_TRUE;
|
||||
|
||||
cleanup:
|
||||
#ifdef WINCE_WINDOWS_MOBILE
|
||||
// re-invalidate the region if we failed.
|
||||
if (!result)
|
||||
mInvalidatedRegion->Union(*paintRgnWin.get());
|
||||
#endif
|
||||
NS_ASSERTION(result == PR_TRUE, "fatal drawing error");
|
||||
::EndPaint(mWnd, &ps);
|
||||
mPaintDC = nsnull;
|
||||
mPainting = PR_FALSE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче