зеркало из https://github.com/mozilla/gecko-dev.git
Bug 385862: View usage cleanups. r+sr=roc
This commit is contained in:
Родитель
a010d5b126
Коммит
107224ebc4
|
@ -47,15 +47,8 @@
|
||||||
#include "nsISelectionController.h"
|
#include "nsISelectionController.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
#include "nsRegion.h"
|
#include "nsRegion.h"
|
||||||
#include "nsIViewManager.h"
|
|
||||||
#include "nsIBlender.h"
|
|
||||||
#include "nsTransform2D.h"
|
|
||||||
#include "nsFrameManager.h"
|
#include "nsFrameManager.h"
|
||||||
#include "nsPlaceholderFrame.h"
|
|
||||||
|
|
||||||
#ifdef MOZ_CAIRO_GFX
|
|
||||||
#include "gfxContext.h"
|
#include "gfxContext.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
|
nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
|
||||||
PRBool aIsForEvents, PRBool aBuildCaret, nsIFrame* aMovingFrame)
|
PRBool aIsForEvents, PRBool aBuildCaret, nsIFrame* aMovingFrame)
|
||||||
|
@ -779,8 +772,6 @@ void nsDisplayOpacity::Paint(nsDisplayListBuilder* aBuilder,
|
||||||
nsRect bounds;
|
nsRect bounds;
|
||||||
bounds.IntersectRect(GetBounds(aBuilder), aDirtyRect);
|
bounds.IntersectRect(GetBounds(aBuilder), aDirtyRect);
|
||||||
|
|
||||||
#ifdef MOZ_CAIRO_GFX
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDeviceContext> devCtx;
|
nsCOMPtr<nsIDeviceContext> devCtx;
|
||||||
aCtx->GetDeviceContext(*getter_AddRefs(devCtx));
|
aCtx->GetDeviceContext(*getter_AddRefs(devCtx));
|
||||||
float a2p = 1.0f / devCtx->AppUnitsPerDevPixel();
|
float a2p = 1.0f / devCtx->AppUnitsPerDevPixel();
|
||||||
|
@ -809,44 +800,6 @@ void nsDisplayOpacity::Paint(nsDisplayListBuilder* aBuilder,
|
||||||
ctx->Paint(opacity);
|
ctx->Paint(opacity);
|
||||||
|
|
||||||
ctx->Restore();
|
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,
|
PRBool nsDisplayOpacity::OptimizeVisibility(nsDisplayListBuilder* aBuilder,
|
||||||
|
|
|
@ -121,8 +121,6 @@
|
||||||
#include "nsXPCOM.h"
|
#include "nsXPCOM.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsILayoutHistoryState.h"
|
#include "nsILayoutHistoryState.h"
|
||||||
#include "nsIScrollPositionListener.h"
|
|
||||||
#include "nsICompositeListener.h"
|
|
||||||
#include "nsILineIterator.h" // for ScrollContentIntoView
|
#include "nsILineIterator.h" // for ScrollContentIntoView
|
||||||
#include "nsTimer.h"
|
#include "nsTimer.h"
|
||||||
#include "nsWeakPtr.h"
|
#include "nsWeakPtr.h"
|
||||||
|
|
|
@ -1277,6 +1277,9 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
mDrag.UnSet();
|
mDrag.UnSet();
|
||||||
|
|
||||||
|
aDesiredSize.mOverflowArea = nsRect(0, 0,
|
||||||
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -1487,9 +1490,6 @@ nsHTMLFramesetFrame::StartMouseDrag(nsPresContext* aPresContext,
|
||||||
viewMan->GrabMouseEvents(view, ignore);
|
viewMan->GrabMouseEvents(view, ignore);
|
||||||
mDragger = aBorder;
|
mDragger = aBorder;
|
||||||
|
|
||||||
//XXX This should go away! Border should have own view instead
|
|
||||||
viewMan->SetViewCheckChildEvents(view, PR_FALSE);
|
|
||||||
|
|
||||||
mFirstDragPoint = aEvent->refPoint;
|
mFirstDragPoint = aEvent->refPoint;
|
||||||
|
|
||||||
// Store the original frame sizes
|
// Store the original frame sizes
|
||||||
|
@ -1591,8 +1591,6 @@ nsHTMLFramesetFrame::EndMouseDrag(nsPresContext* aPresContext)
|
||||||
mDragger = nsnull;
|
mDragger = nsnull;
|
||||||
PRBool ignore;
|
PRBool ignore;
|
||||||
viewMan->GrabMouseEvents(nsnull, ignore);
|
viewMan->GrabMouseEvents(nsnull, ignore);
|
||||||
//XXX This should go away! Border should have own view instead
|
|
||||||
viewMan->SetViewCheckChildEvents(view, PR_TRUE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gDragInProgress = PR_FALSE;
|
gDragInProgress = PR_FALSE;
|
||||||
|
@ -1655,6 +1653,8 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// computed values are.
|
// computed values are.
|
||||||
SizeToAvailSize(aReflowState, aDesiredSize);
|
SizeToAvailSize(aReflowState, aDesiredSize);
|
||||||
|
|
||||||
|
aDesiredSize.mOverflowArea = nsRect(0, 0,
|
||||||
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -1728,8 +1728,8 @@ void nsHTMLFramesetBorderFrame::PaintBorder(nsIRenderingContext& aRenderingConte
|
||||||
|
|
||||||
nscoord x0 = 0;
|
nscoord x0 = 0;
|
||||||
nscoord y0 = 0;
|
nscoord y0 = 0;
|
||||||
nscoord x1 = (mVertical) ? x0 : mRect.width;
|
nscoord x1 = (mVertical) ? 0 : mRect.width;
|
||||||
nscoord y1 = (mVertical) ? mRect.height : x0;
|
nscoord y1 = (mVertical) ? mRect.height : 0;
|
||||||
|
|
||||||
nscolor color = WHITE;
|
nscolor color = WHITE;
|
||||||
if (mVisibility || mVisibilityOverride) {
|
if (mVisibility || mVisibilityOverride) {
|
||||||
|
@ -1851,6 +1851,8 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
|
||||||
// computed values are.
|
// computed values are.
|
||||||
SizeToAvailSize(aReflowState, aDesiredSize);
|
SizeToAvailSize(aReflowState, aDesiredSize);
|
||||||
|
|
||||||
|
aDesiredSize.mOverflowArea = nsRect(0, 0,
|
||||||
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
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 which case we want to call with aAbove == PR_FALSE to insert at the beginning
|
||||||
// in document order
|
// in document order
|
||||||
viewManager->InsertChild(parentView, view, insertBefore, insertBefore != nsnull);
|
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.
|
// REVIEW: Don't create a widget for fixed-pos elements anymore.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче