зеркало из https://github.com/mozilla/pjs.git
Merge backout of changeset 7799cfb99362, bug 517804
This commit is contained in:
Коммит
87fa37d561
|
@ -893,7 +893,6 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
|||
break;
|
||||
}
|
||||
|
||||
case NS_WILL_PAINT:
|
||||
case NS_PAINT:
|
||||
{
|
||||
nsPaintEvent *event = static_cast<nsPaintEvent*>(aEvent);
|
||||
|
@ -906,18 +905,16 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
|||
// The rect is in device units, and it's in the coordinate space of its
|
||||
// associated window.
|
||||
nsCOMPtr<nsIRegion> region = event->region;
|
||||
if (aEvent->message == NS_PAINT) {
|
||||
if (!region) {
|
||||
if (NS_FAILED(CreateRegion(getter_AddRefs(region))))
|
||||
break;
|
||||
|
||||
const nsIntRect& damrect = *event->rect;
|
||||
region->SetTo(damrect.x, damrect.y, damrect.width, damrect.height);
|
||||
}
|
||||
|
||||
if (region->IsEmpty())
|
||||
if (!region) {
|
||||
if (NS_FAILED(CreateRegion(getter_AddRefs(region))))
|
||||
break;
|
||||
|
||||
const nsIntRect& damrect = *event->rect;
|
||||
region->SetTo(damrect.x, damrect.y, damrect.width, damrect.height);
|
||||
}
|
||||
|
||||
if (region->IsEmpty())
|
||||
break;
|
||||
|
||||
// Refresh the view
|
||||
if (IsRefreshEnabled()) {
|
||||
|
@ -988,12 +985,12 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
|||
rootVM->ProcessPendingUpdates(mRootView, PR_FALSE);
|
||||
}
|
||||
|
||||
if (view && aEvent->message == NS_PAINT) {
|
||||
if (view) {
|
||||
Refresh(view, event->renderingContext, region,
|
||||
NS_VMREFRESH_DOUBLE_BUFFER);
|
||||
}
|
||||
}
|
||||
} else if (aEvent->message == NS_PAINT) {
|
||||
} else {
|
||||
// since we got an NS_PAINT event, we need to
|
||||
// draw something so we don't get blank areas,
|
||||
// unless there's no widget or it's transparent.
|
||||
|
|
|
@ -162,8 +162,6 @@ class nsHashKey;
|
|||
#define NS_DEACTIVATE (NS_WINDOW_START + 8)
|
||||
// top-level window z-level change request
|
||||
#define NS_SETZLEVEL (NS_WINDOW_START + 9)
|
||||
// Widget will need to be painted
|
||||
#define NS_WILL_PAINT (NS_WINDOW_START + 29)
|
||||
// Widget needs to be repainted
|
||||
#define NS_PAINT (NS_WINDOW_START + 30)
|
||||
// Key is pressed within a window
|
||||
|
|
|
@ -2755,15 +2755,6 @@ static const PRInt32 sShadowInvalidationInterval = 100;
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
- (void)viewWillDraw
|
||||
{
|
||||
if (!mGeckoChild)
|
||||
return;
|
||||
|
||||
nsPaintEvent paintEvent(PR_TRUE, NS_WILL_PAINT, mGeckoChild);
|
||||
mGeckoChild->DispatchWindowEvent(paintEvent);
|
||||
}
|
||||
|
||||
// Allows us to turn off setting up the clip region
|
||||
// before each drawRect. We already clip within gecko.
|
||||
- (BOOL)wantsDefaultClipping
|
||||
|
|
Загрузка…
Ссылка в новой задаче