Bug 788044 - Make various functions take const parameters. r=roc

This commit is contained in:
Matt Woodrow 2012-09-13 12:32:53 +12:00
parent 141b095414
commit 77745de1bf
7 changed files with 26 additions and 26 deletions

View File

@ -269,7 +269,7 @@ protected:
const nsIntRect& aVisibleRect,
const nsIntRect& aDrawRect,
const FrameLayerBuilder::Clip& aClip);
nsIFrame* GetActiveScrolledRoot() { return mActiveScrolledRoot; }
const nsIFrame* GetActiveScrolledRoot() { return mActiveScrolledRoot; }
/**
* If this represents only a nsDisplayImage, and the image type
@ -318,7 +318,7 @@ protected:
* be non-null; all content in a ThebesLayer must have the same
* active scrolled root.
*/
nsIFrame* mActiveScrolledRoot;
const nsIFrame* mActiveScrolledRoot;
ThebesLayer* mLayer;
/**
* If mIsSolidColorInVisibleRegion is true, this is the color of the visible
@ -441,7 +441,7 @@ protected:
const nsIntRect& aVisibleRect,
const nsIntRect& aDrawRect,
const FrameLayerBuilder::Clip& aClip,
nsIFrame* aActiveScrolledRoot);
const nsIFrame* aActiveScrolledRoot);
ThebesLayerData* GetTopThebesLayerData()
{
return mThebesLayerDataStack.IsEmpty() ? nullptr
@ -1630,7 +1630,7 @@ ContainerState::FindThebesLayerFor(nsDisplayItem* aItem,
const nsIntRect& aVisibleRect,
const nsIntRect& aDrawRect,
const FrameLayerBuilder::Clip& aClip,
nsIFrame* aActiveScrolledRoot)
const nsIFrame* aActiveScrolledRoot)
{
int32_t i;
int32_t lowestUsableLayerWithScrolledRoot = -1;
@ -1815,7 +1815,7 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
bool isFixed;
bool forceInactive;
nsIFrame* activeScrolledRoot;
const nsIFrame* activeScrolledRoot;
if (aFlags & NO_COMPONENT_ALPHA) {
// When NO_COMPONENT_ALPHA is set, items will be flattened onto the
// reference frame. In this case, force the active scrolled root to

View File

@ -487,10 +487,10 @@ static bool IsFixedFrame(nsIFrame* aFrame)
bool
nsDisplayListBuilder::IsFixedItem(nsDisplayItem *aItem,
nsIFrame** aActiveScrolledRoot,
nsIFrame* aOverrideActiveScrolledRoot)
const nsIFrame** aActiveScrolledRoot,
const nsIFrame* aOverrideActiveScrolledRoot)
{
nsIFrame* activeScrolledRoot = aOverrideActiveScrolledRoot;
const nsIFrame* activeScrolledRoot = aOverrideActiveScrolledRoot;
if (!activeScrolledRoot) {
if (aItem->GetType() == nsDisplayItem::TYPE_SCROLL_LAYER) {
nsDisplayScrollLayer* scrollLayerItem =

View File

@ -309,8 +309,8 @@ public:
* scrolled root.
*/
bool IsFixedItem(nsDisplayItem* aItem,
nsIFrame** aActiveScrolledRoot = nullptr,
nsIFrame* aOverrideActiveScrolledRoot = nullptr);
const nsIFrame** aActiveScrolledRoot = nullptr,
const nsIFrame* aOverrideActiveScrolledRoot = nullptr);
/**
* @return true if images have been set to decode synchronously.

View File

@ -622,10 +622,10 @@ nsLayoutUtils::IsProperAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame*
// static
bool
nsLayoutUtils::IsAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame* aFrame,
nsIFrame* aCommonAncestor)
nsLayoutUtils::IsAncestorFrameCrossDoc(const nsIFrame* aAncestorFrame, const nsIFrame* aFrame,
const nsIFrame* aCommonAncestor)
{
for (nsIFrame* f = aFrame; f != aCommonAncestor;
for (const nsIFrame* f = aFrame; f != aCommonAncestor;
f = GetCrossDocParentFrame(f)) {
if (f == aAncestorFrame)
return true;
@ -872,7 +872,7 @@ nsLayoutUtils::GetScrollableFrameFor(nsIFrame *aScrolledFrame)
nsIFrame*
nsLayoutUtils::GetActiveScrolledRootFor(nsIFrame* aFrame,
nsIFrame* aStopAtAncestor)
const nsIFrame* aStopAtAncestor)
{
nsIFrame* f = aFrame;
while (f != aStopAtAncestor) {
@ -919,7 +919,7 @@ nsLayoutUtils::GetActiveScrolledRootFor(nsDisplayItem* aItem,
}
bool
nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(nsIFrame* aActiveScrolledRoot,
nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(const nsIFrame* aActiveScrolledRoot,
nsDisplayListBuilder* aBuilder)
{
nsPresContext* presContext = aActiveScrolledRoot->PresContext()->
@ -1249,7 +1249,7 @@ nsLayoutUtils::MatrixTransformPoint(const nsPoint &aPoint,
}
gfx3DMatrix
nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, nsIFrame *aAncestor)
nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, const nsIFrame *aAncestor)
{
nsIFrame* parent;
gfx3DMatrix ctm = aFrame->GetTransformMatrix(aAncestor, &parent);
@ -1274,7 +1274,7 @@ TransformGfxPointFromAncestor(nsIFrame *aFrame,
static gfxRect
TransformGfxRectFromAncestor(nsIFrame *aFrame,
const gfxRect &aRect,
nsIFrame *aAncestor)
const nsIFrame *aAncestor)
{
gfx3DMatrix ctm = nsLayoutUtils::GetTransformToAncestor(aFrame, aAncestor);
return ctm.Inverse().ProjectRectBounds(aRect);
@ -1306,7 +1306,7 @@ nsLayoutUtils::TransformRootPointToFrame(nsIFrame *aFrame,
nsRect
nsLayoutUtils::TransformAncestorRectToFrame(nsIFrame* aFrame,
const nsRect &aRect,
nsIFrame* aAncestor)
const nsIFrame* aAncestor)
{
float factor = aFrame->PresContext()->AppUnitsPerDevPixel();
gfxRect result(NSAppUnitsToFloatPixels(aRect.x, factor),

View File

@ -295,8 +295,8 @@ public:
* Just like IsProperAncestorFrameCrossDoc, except that it returns true when
* aFrame == aAncestorFrame.
*/
static bool IsAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame* aFrame,
nsIFrame* aCommonAncestor = nullptr);
static bool IsAncestorFrameCrossDoc(const nsIFrame* aAncestorFrame, const nsIFrame* aFrame,
const nsIFrame* aCommonAncestor = nullptr);
/**
* Finds the nearest ancestor frame that is the root of an "actively
@ -306,7 +306,7 @@ public:
* scrolled together, so we'll place them in the same ThebesLayer.
*/
static nsIFrame* GetActiveScrolledRootFor(nsIFrame* aFrame,
nsIFrame* aStopAtAncestor);
const nsIFrame* aStopAtAncestor);
static nsIFrame* GetActiveScrolledRootFor(nsDisplayItem* aItem,
nsDisplayListBuilder* aBuilder,
@ -317,7 +317,7 @@ public:
* and its topmost content document ancestor has a root scroll frame with
* a displayport set, and aActiveScrolledRoot is scrolled by that scrollframe.
*/
static bool IsScrolledByRootContentDocumentDisplayportScrolling(nsIFrame* aActiveScrolledRoot,
static bool IsScrolledByRootContentDocumentDisplayportScrolling(const nsIFrame* aActiveScrolledRoot,
nsDisplayListBuilder* aBuilder);
/**
@ -519,7 +519,7 @@ public:
*/
static nsRect TransformAncestorRectToFrame(nsIFrame* aFrame,
const nsRect& aRect,
nsIFrame* aAncestor);
const nsIFrame* aAncestor);
/**
* Transform aRect relative to aFrame up to the coordinate system of
@ -534,7 +534,7 @@ public:
* Gets the transform for aFrame relative to aAncestor. Pass null for aAncestor
* to go up to the root frame.
*/
static gfx3DMatrix GetTransformToAncestor(nsIFrame *aFrame, nsIFrame *aAncestor);
static gfx3DMatrix GetTransformToAncestor(nsIFrame *aFrame, const nsIFrame *aAncestor);
/**
* Given a point in the global coordinate space, returns that point expressed

View File

@ -4818,7 +4818,7 @@ nsIFrame::InvalidateInternal(const nsRect& aDamageRect, nscoord aX, nscoord aY,
}
gfx3DMatrix
nsIFrame::GetTransformMatrix(nsIFrame* aStopAtAncestor,
nsIFrame::GetTransformMatrix(const nsIFrame* aStopAtAncestor,
nsIFrame** aOutAncestor)
{
NS_PRECONDITION(aOutAncestor, "Need a place to put the ancestor!");

View File

@ -2009,7 +2009,7 @@ public:
* @return A gfxMatrix that converts points in this frame's coordinate space
* into points in aOutAncestor's coordinate space.
*/
gfx3DMatrix GetTransformMatrix(nsIFrame* aStopAtAncestor,
gfx3DMatrix GetTransformMatrix(const nsIFrame* aStopAtAncestor,
nsIFrame **aOutAncestor);
/**