Bug 444692. Windowless plugin frames should use frame invalidation so that generic invalidation hooks work. r+sr=dbaron

This commit is contained in:
Robert O'Callahan 2008-07-14 10:23:04 +12:00
parent 626428f7fa
commit c942a1b54e

View File

@ -2398,20 +2398,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(nsPluginRect *invalidRect)
nsresult rv = NS_ERROR_FAILURE;
if (mOwner && invalidRect && mWidgetVisible) {
//no reference count on view
nsIView* view = mOwner->GetView();
if (view) {
nsPresContext* presContext = mOwner->PresContext();
nsRect rect(presContext->DevPixelsToAppUnits(invalidRect->left),
presContext->DevPixelsToAppUnits(invalidRect->top),
presContext->DevPixelsToAppUnits(invalidRect->right - invalidRect->left),
presContext->DevPixelsToAppUnits(invalidRect->bottom - invalidRect->top));
//set flags to not do a synchronous update, force update does the redraw
view->GetViewManager()->UpdateView(view, rect, NS_VMREFRESH_NO_SYNC);
}
nsPresContext* presContext = mOwner->PresContext();
nsRect rect(presContext->DevPixelsToAppUnits(invalidRect->left),
presContext->DevPixelsToAppUnits(invalidRect->top),
presContext->DevPixelsToAppUnits(invalidRect->right - invalidRect->left),
presContext->DevPixelsToAppUnits(invalidRect->bottom - invalidRect->top));
mOwner->Invalidate(rect);
}
return rv;