mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 594650: Replace static variable in header file with static variable + accessor method, to fix codesighs & Composer.dll bustage. r=roc r=taras a=bustage
This commit is contained in:
parent
2f6c001135
commit
ecd6d13497
@ -39,10 +39,15 @@
|
||||
#include "nsString.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "prlog.h"
|
||||
#include <limits.h>
|
||||
|
||||
// the mozilla::css::Side sequence must match the nsMargin nscoord sequence
|
||||
PR_STATIC_ASSERT((NS_SIDE_TOP == 0) && (NS_SIDE_RIGHT == 1) && (NS_SIDE_BOTTOM == 2) && (NS_SIDE_LEFT == 3));
|
||||
|
||||
|
||||
/* static */
|
||||
const nsIntRect nsIntRect::kMaxSizedIntRect(0, 0, INT_MAX, INT_MAX);
|
||||
|
||||
// Containment
|
||||
PRBool nsRect::Contains(nscoord aX, nscoord aY) const
|
||||
{
|
||||
|
@ -335,6 +335,13 @@ struct NS_GFX nsIntRect {
|
||||
PRInt32 YMost() const {return y + height;}
|
||||
|
||||
inline nsRect ToAppUnits(nscoord aAppUnitsPerPixel) const;
|
||||
|
||||
// Returns a special nsIntRect that's used in some places to signify
|
||||
// "all available space".
|
||||
static const nsIntRect& GetMaxSizedIntRect() { return kMaxSizedIntRect; }
|
||||
|
||||
protected:
|
||||
static const nsIntRect kMaxSizedIntRect;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -204,7 +204,7 @@ NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsRect r = (*aDirtyRect == mozilla::imagelib::kFullImageSpaceRect) ?
|
||||
nsRect r = (*aDirtyRect == nsIntRect::GetMaxSizedIntRect()) ?
|
||||
nsRect(nsPoint(0, 0), mFrame->GetSize()) :
|
||||
aDirtyRect->ToAppUnits(nsPresContext::AppUnitsPerCSSPixel());
|
||||
|
||||
|
@ -577,7 +577,7 @@ nsImageFrame::OnDataAvailable(imgIRequest *aRequest,
|
||||
|
||||
// XXX We really need to round this out, now that we're doing better
|
||||
// image scaling!
|
||||
nsRect r = (*aRect == mozilla::imagelib::kFullImageSpaceRect) ?
|
||||
nsRect r = (*aRect == nsIntRect::GetMaxSizedIntRect()) ?
|
||||
GetInnerArea() :
|
||||
SourceRectToDest(*aRect);
|
||||
|
||||
@ -660,7 +660,7 @@ nsImageFrame::FrameChanged(imgIContainer *aContainer,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsRect r = (*aDirtyRect == mozilla::imagelib::kFullImageSpaceRect) ?
|
||||
nsRect r = (*aDirtyRect == nsIntRect::GetMaxSizedIntRect()) ?
|
||||
GetInnerArea() :
|
||||
SourceRectToDest(*aDirtyRect);
|
||||
|
||||
|
@ -56,17 +56,6 @@ interface imgIDecoderObserver;
|
||||
#include "limits.h"
|
||||
|
||||
class nsIFrame;
|
||||
|
||||
namespace mozilla {
|
||||
namespace imagelib {
|
||||
/**
|
||||
* A sentinel value that can be passed to various imagelib methods
|
||||
* to represent "the full image space".
|
||||
*/
|
||||
static const nsIntRect kFullImageSpaceRect(0, 0, INT_MAX, INT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
[ptr] native gfxImageSurface(gfxImageSurface);
|
||||
|
@ -242,7 +242,7 @@ VectorImage::Init(imgIDecoderObserver* aObserver,
|
||||
void
|
||||
VectorImage::GetCurrentFrameRect(nsIntRect& aRect)
|
||||
{
|
||||
aRect = kFullImageSpaceRect;
|
||||
aRect = nsIntRect::GetMaxSizedIntRect();
|
||||
}
|
||||
|
||||
PRUint32
|
||||
@ -646,7 +646,7 @@ VectorImage::OnStopRequest(nsIRequest* aRequest, nsISupports* aCtxt,
|
||||
// NOTE: This signals that width/height are available.
|
||||
observer->OnStartContainer(nsnull, this);
|
||||
|
||||
observer->FrameChanged(this, &kFullImageSpaceRect);
|
||||
observer->FrameChanged(this, &nsIntRect::GetMaxSizedIntRect());
|
||||
observer->OnStopFrame(nsnull, 0);
|
||||
observer->OnStopDecode(nsnull, NS_OK, nsnull);
|
||||
}
|
||||
@ -678,7 +678,7 @@ VectorImage::InvalidateObserver()
|
||||
{
|
||||
nsCOMPtr<imgIContainerObserver> observer(do_QueryReferent(mObserver));
|
||||
if (observer) {
|
||||
observer->FrameChanged(this, &kFullImageSpaceRect);
|
||||
observer->FrameChanged(this, &nsIntRect::GetMaxSizedIntRect());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user