Bug 385862: View usage cleanups. r+sr=roc

This commit is contained in:
sharparrow1@yahoo.com 2007-06-27 09:37:50 -07:00
Родитель a010d5b126
Коммит 107224ebc4
4 изменённых файлов: 9 добавлений и 64 удалений

Просмотреть файл

@ -47,15 +47,8 @@
#include "nsISelectionController.h"
#include "nsIPresShell.h"
#include "nsRegion.h"
#include "nsIViewManager.h"
#include "nsIBlender.h"
#include "nsTransform2D.h"
#include "nsFrameManager.h"
#include "nsPlaceholderFrame.h"
#ifdef MOZ_CAIRO_GFX
#include "gfxContext.h"
#endif
nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
PRBool aIsForEvents, PRBool aBuildCaret, nsIFrame* aMovingFrame)
@ -779,8 +772,6 @@ void nsDisplayOpacity::Paint(nsDisplayListBuilder* aBuilder,
nsRect bounds;
bounds.IntersectRect(GetBounds(aBuilder), aDirtyRect);
#ifdef MOZ_CAIRO_GFX
nsCOMPtr<nsIDeviceContext> devCtx;
aCtx->GetDeviceContext(*getter_AddRefs(devCtx));
float a2p = 1.0f / devCtx->AppUnitsPerDevPixel();
@ -809,44 +800,6 @@ void nsDisplayOpacity::Paint(nsDisplayListBuilder* aBuilder,
ctx->Paint(opacity);
ctx->Restore();
#elif !defined(XP_MACOSX)
nsIViewManager* vm = mFrame->GetPresContext()->GetViewManager();
nsIViewManager::BlendingBuffers* buffers =
vm->CreateBlendingBuffers(aCtx, PR_FALSE, nsnull, mNeedAlpha, bounds);
if (!buffers) {
NS_WARNING("Could not create blending buffers for translucent painting; ignoring opacity");
nsDisplayWrapList::Paint(aBuilder, aCtx, aDirtyRect);
return;
}
// Paint onto black, and also onto white if necessary
nsDisplayWrapList::Paint(aBuilder, buffers->mBlackCX, bounds);
if (buffers->mWhiteCX) {
nsDisplayWrapList::Paint(aBuilder, buffers->mWhiteCX, bounds);
}
nsTransform2D* transform;
nsresult rv = aCtx->GetCurrentTransform(transform);
if (NS_FAILED(rv))
return;
nsRect damageRectInPixels = bounds;
transform->TransformCoord(&damageRectInPixels.x, &damageRectInPixels.y,
&damageRectInPixels.width, &damageRectInPixels.height);
// If blender creation failed then we would have not received a buffers object
nsIBlender* blender = vm->GetBlender();
blender->Blend(0, 0, damageRectInPixels.width, damageRectInPixels.height,
buffers->mBlackCX, aCtx,
damageRectInPixels.x, damageRectInPixels.y,
opacity, buffers->mWhiteCX,
NS_RGB(0, 0, 0), NS_RGB(255, 255, 255));
delete buffers;
#else
// bug 325296 workaround
nsDisplayWrapList::Paint(aBuilder, aCtx, aDirtyRect);
#endif /* MOZ_CAIRO_GFX */
}
PRBool nsDisplayOpacity::OptimizeVisibility(nsDisplayListBuilder* aBuilder,

Просмотреть файл

@ -121,8 +121,6 @@
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsILayoutHistoryState.h"
#include "nsIScrollPositionListener.h"
#include "nsICompositeListener.h"
#include "nsILineIterator.h" // for ScrollContentIntoView
#include "nsTimer.h"
#include "nsWeakPtr.h"

Просмотреть файл

@ -1277,6 +1277,9 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
mDrag.UnSet();
aDesiredSize.mOverflowArea = nsRect(0, 0,
aDesiredSize.width, aDesiredSize.height);
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
return NS_OK;
}
@ -1487,9 +1490,6 @@ nsHTMLFramesetFrame::StartMouseDrag(nsPresContext* aPresContext,
viewMan->GrabMouseEvents(view, ignore);
mDragger = aBorder;
//XXX This should go away! Border should have own view instead
viewMan->SetViewCheckChildEvents(view, PR_FALSE);
mFirstDragPoint = aEvent->refPoint;
// Store the original frame sizes
@ -1591,8 +1591,6 @@ nsHTMLFramesetFrame::EndMouseDrag(nsPresContext* aPresContext)
mDragger = nsnull;
PRBool ignore;
viewMan->GrabMouseEvents(nsnull, ignore);
//XXX This should go away! Border should have own view instead
viewMan->SetViewCheckChildEvents(view, PR_TRUE);
}
}
gDragInProgress = PR_FALSE;
@ -1655,6 +1653,8 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
// computed values are.
SizeToAvailSize(aReflowState, aDesiredSize);
aDesiredSize.mOverflowArea = nsRect(0, 0,
aDesiredSize.width, aDesiredSize.height);
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}
@ -1728,8 +1728,8 @@ void nsHTMLFramesetBorderFrame::PaintBorder(nsIRenderingContext& aRenderingConte
nscoord x0 = 0;
nscoord y0 = 0;
nscoord x1 = (mVertical) ? x0 : mRect.width;
nscoord y1 = (mVertical) ? mRect.height : x0;
nscoord x1 = (mVertical) ? 0 : mRect.width;
nscoord y1 = (mVertical) ? mRect.height : 0;
nscolor color = WHITE;
if (mVisibility || mVisibilityOverride) {
@ -1851,6 +1851,8 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
// computed values are.
SizeToAvailSize(aReflowState, aDesiredSize);
aDesiredSize.mOverflowArea = nsRect(0, 0,
aDesiredSize.width, aDesiredSize.height);
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}

Просмотреть файл

@ -567,14 +567,6 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIFrame* aFrame,
// in which case we want to call with aAbove == PR_FALSE to insert at the beginning
// in document order
viewManager->InsertChild(parentView, view, insertBefore, insertBefore != nsnull);
if (nsnull != aContentParentFrame) {
nsIView* zParentView = aContentParentFrame->GetClosestView();
if (zParentView != parentView) {
insertBefore = nsLayoutUtils::FindSiblingViewFor(zParentView, aFrame);
viewManager->InsertZPlaceholder(zParentView, view, insertBefore, insertBefore != nsnull);
}
}
}
// REVIEW: Don't create a widget for fixed-pos elements anymore.