on panther, use new panther api to only draw rects that need it. fixes

splotchy whitespace with iframes when redraws span iframes (bug 222972)


git-svn-id: svn://10.0.0.236/trunk@156062 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton%aol.net
2004-05-07 01:16:14 +00:00
parent d49e10af13
commit f66ea0fcc3

View File

@@ -66,6 +66,8 @@
#include <unistd.h>
#include "nsCursorManager.h"
#define NSAppKitVersionNumber10_2 663
@interface ChildView(Private)
// sends gecko an ime composition event
@@ -2422,11 +2424,27 @@ nsChildView::Idle()
return;
}
// tell gecko to paint.
nsRect r;
ConvertCocoaToGeckoRect(aRect, r);
nsCOMPtr<nsIRenderingContext> rendContext = getter_AddRefs(mGeckoChild->GetRenderingContext());
mGeckoChild->UpdateWidget(r, rendContext);
// tell gecko to paint.
// If < 10.3, just paint the rect
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_2) {
nsRect r;
ConvertCocoaToGeckoRect(aRect, r);
nsCOMPtr<nsIRenderingContext> rendContext = getter_AddRefs(mGeckoChild->GetRenderingContext());
mGeckoChild->UpdateWidget(r, rendContext);
}
// If >10.3, only paint the sub-rects that need it. This avoids the
// nasty coalesced updates that result in big white areas.
else {
const NSRect *rects;
int count, i;
[self getRectsBeingDrawn:&rects count:&count];
for (i=0; i<count; ++i) {
nsRect r;
ConvertCocoaToGeckoRect(rects[i], r);
nsCOMPtr<nsIRenderingContext> rendContext = getter_AddRefs(mGeckoChild->GetRenderingContext());
mGeckoChild->UpdateWidget(r, rendContext);
}
}
}
#if USE_CLICK_HOLD_CONTEXTMENU