зеркало из https://github.com/mozilla/pjs.git
Bug 265084. Progress towards floating point nscoord: make image interfaces and libpr0n use PRInt32 instead of nscoord. r+sr=tor
This commit is contained in:
Родитель
dca7a472f9
Коммит
14447eb6f2
|
@ -46,16 +46,18 @@
|
|||
#include "nsRect.h"
|
||||
%}
|
||||
|
||||
native nsRectRef(nsRect &);
|
||||
native nsRectRef(nsIntRect &);
|
||||
|
||||
/**
|
||||
* gfxIImageFrame interface
|
||||
*
|
||||
* All x, y, width, height values are in pixels.
|
||||
*
|
||||
* @author Tim Rowley <tor@cs.brown.edu>
|
||||
* @author Stuart Parmenter <pavlov@netscape.com>
|
||||
* @version 0.1
|
||||
*/
|
||||
[scriptable, uuid(51cc27a8-1dd2-11b2-a1aa-dad33ab193b4)]
|
||||
[scriptable, uuid(20caf74f-2c35-450f-9f87-c3ecc213553c)]
|
||||
interface gfxIImageFrame : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -69,10 +71,10 @@ interface gfxIImageFrame : nsISupports
|
|||
*
|
||||
* @note The data of a new image is unspecified (Whats the word i'm looking for here?).
|
||||
*/
|
||||
void init(in nscoord aX,
|
||||
in nscoord aY,
|
||||
in nscoord aWidth,
|
||||
in nscoord aHeight,
|
||||
void init(in PRInt32 aX,
|
||||
in PRInt32 aY,
|
||||
in PRInt32 aWidth,
|
||||
in PRInt32 aHeight,
|
||||
in gfx_format aFormat,
|
||||
in gfx_depth aDepth);
|
||||
|
||||
|
@ -85,22 +87,22 @@ interface gfxIImageFrame : nsISupports
|
|||
/**
|
||||
* The x-offset of the image.
|
||||
*/
|
||||
readonly attribute nscoord x;
|
||||
readonly attribute PRInt32 x;
|
||||
|
||||
/**
|
||||
* The y-offset of the image.
|
||||
*/
|
||||
readonly attribute nscoord y;
|
||||
readonly attribute PRInt32 y;
|
||||
|
||||
/**
|
||||
* The width of the image.
|
||||
*/
|
||||
readonly attribute nscoord width;
|
||||
readonly attribute PRInt32 width;
|
||||
|
||||
/**
|
||||
* The height of the image.
|
||||
*/
|
||||
readonly attribute nscoord height;
|
||||
readonly attribute PRInt32 height;
|
||||
|
||||
/**
|
||||
* The rectangle this frame ocupies.
|
||||
|
@ -184,11 +186,11 @@ interface gfxIImageFrame : nsISupports
|
|||
/**
|
||||
* Blit this frame into another frame. Used for GIF animation compositing
|
||||
*/
|
||||
void drawTo(in gfxIImageFrame aDst,
|
||||
in nscoord aDX,
|
||||
in nscoord aDY,
|
||||
in nscoord aDWidth,
|
||||
in nscoord aDHeight);
|
||||
void drawTo(in gfxIImageFrame aDst,
|
||||
in PRInt32 aDX,
|
||||
in PRInt32 aDY,
|
||||
in PRInt32 aDWidth,
|
||||
in PRInt32 aDHeight);
|
||||
|
||||
/**
|
||||
* Represents the number of milliseconds until the next frame should be displayed.
|
||||
|
|
|
@ -44,12 +44,6 @@
|
|||
|
||||
#include "nsrootidl.idl"
|
||||
|
||||
/*! @verbatim */
|
||||
%{C++
|
||||
#include "nsCoord.h"
|
||||
%}
|
||||
/*! @endverbatim */
|
||||
|
||||
/**
|
||||
* A color is a 32 bit unsigned integer with
|
||||
* four components: R, G, B and A.
|
||||
|
@ -71,7 +65,4 @@ typedef unsigned short gfx_depth; // is short ok?
|
|||
*/
|
||||
typedef long gfx_format;
|
||||
|
||||
typedef PRInt32 nscoord;
|
||||
|
||||
[ptr] native nsRect(nsRect);
|
||||
[ptr] native nsIntRect(nsIntRect);
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
struct nsRect;
|
||||
class nsIDeviceContext;
|
||||
|
||||
struct nsColorMap
|
||||
|
@ -69,8 +69,8 @@ typedef enum {
|
|||
|
||||
// IID for the nsIImage interface
|
||||
#define NS_IIMAGE_IID \
|
||||
{ 0x0b4faaa0, 0xaa3a, 0x11d1, \
|
||||
{ 0xa8, 0x24, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
|
||||
{ 0xce91c93f, 0x532d, 0x470d, \
|
||||
{ 0xbf, 0xa3, 0xc9, 0x6e, 0x56, 0x01, 0x52, 0xa4 } }
|
||||
|
||||
// Interface to Images
|
||||
class nsIImage : public nsISupports
|
||||
|
@ -158,7 +158,7 @@ public:
|
|||
* @param aFlags Used to pass in parameters for the update
|
||||
* @param aUpdateRect The rectangle to update
|
||||
*/
|
||||
virtual void ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsRect *aUpdateRect) = 0;
|
||||
virtual void ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsIntRect *aUpdateRect) = 0;
|
||||
|
||||
/**
|
||||
* Converted this pixelmap to an optimized pixelmap for the device
|
||||
|
@ -201,7 +201,8 @@ public:
|
|||
* @param aDHeight The destination height of the pixelmap
|
||||
* @return if TRUE, no errors
|
||||
*/
|
||||
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsIDrawingSurface* aSurface, PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
|
||||
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsIDrawingSurface* aSurface,
|
||||
PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
|
||||
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight) = 0;
|
||||
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ nsresult nsBMPDecoder::SetData()
|
|||
nsresult rv = mFrame->SetImageData(mDecoded, mBpr, line * mBpr);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsRect r(0, line, mBIH.width, 1);
|
||||
nsIntRect r(0, line, mBIH.width, 1);
|
||||
return mObserver->OnDataAvailable(nsnull, mFrame, &r);
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ nsresult nsBMPDecoder::WriteRLERows(PRUint32 rows)
|
|||
}
|
||||
|
||||
line = (mBIH.height < 0) ? (-mBIH.height - mCurLine - rows) : mCurLine;
|
||||
nsRect r(0, line, mBIH.width, rows);
|
||||
nsIntRect r(0, line, mBIH.width, rows);
|
||||
return mObserver->OnDataAvailable(nsnull, mFrame, &r);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ nsresult nsICODecoder::SetImageData()
|
|||
mFrame->SetImageData(decodeBufferPos, decodedLineLen, frameOffset);
|
||||
}
|
||||
|
||||
nsRect r(0, 0, 0, 0);
|
||||
nsIntRect r(0, 0, 0, 0);
|
||||
mFrame->GetWidth(&r.width);
|
||||
mFrame->GetHeight(&r.height);
|
||||
mObserver->OnDataAvailable(nsnull, mFrame, &r);
|
||||
|
|
|
@ -74,9 +74,9 @@ imgContainerGIF::~imgContainerGIF()
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* void init (in nscoord aWidth, in nscoord aHeight,
|
||||
/* void init (in PRInt32 aWidth, in PRInt32 aHeight,
|
||||
in imgIContainerObserver aObserver); */
|
||||
NS_IMETHODIMP imgContainerGIF::Init(nscoord aWidth, nscoord aHeight,
|
||||
NS_IMETHODIMP imgContainerGIF::Init(PRInt32 aWidth, PRInt32 aHeight,
|
||||
imgIContainerObserver *aObserver)
|
||||
{
|
||||
if (aWidth <= 0 || aHeight <= 0) {
|
||||
|
@ -100,16 +100,16 @@ NS_IMETHODIMP imgContainerGIF::GetPreferredAlphaChannelFormat(gfx_format *aForma
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* readonly attribute nscoord width; */
|
||||
NS_IMETHODIMP imgContainerGIF::GetWidth(nscoord *aWidth)
|
||||
/* readonly attribute PRInt32 width; */
|
||||
NS_IMETHODIMP imgContainerGIF::GetWidth(PRInt32 *aWidth)
|
||||
{
|
||||
*aWidth = mSize.width;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* readonly attribute nscoord height; */
|
||||
NS_IMETHODIMP imgContainerGIF::GetHeight(nscoord *aHeight)
|
||||
/* readonly attribute PRInt32 height; */
|
||||
NS_IMETHODIMP imgContainerGIF::GetHeight(PRInt32 *aHeight)
|
||||
{
|
||||
*aHeight = mSize.height;
|
||||
return NS_OK;
|
||||
|
@ -169,7 +169,7 @@ NS_IMETHODIMP imgContainerGIF::AppendFrame(gfxIImageFrame *item)
|
|||
// Calculate mFirstFrameRefreshArea
|
||||
// Some gifs are huge but only have a small area that they animate
|
||||
// We only need to refresh that small area when Frame 0 comes around again
|
||||
nsRect itemRect;
|
||||
nsIntRect itemRect;
|
||||
item->GetRect(itemRect);
|
||||
mFirstFrameRefreshArea.UnionRect(mFirstFrameRefreshArea, itemRect);
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ NS_IMETHODIMP imgContainerGIF::Notify(nsITimer *timer)
|
|||
else
|
||||
StopAnimation();
|
||||
|
||||
nsRect dirtyRect;
|
||||
nsIntRect dirtyRect;
|
||||
gfxIImageFrame *frameToUse = nsnull;
|
||||
|
||||
if (nextFrameIndex == 0) {
|
||||
|
@ -460,7 +460,7 @@ NS_IMETHODIMP imgContainerGIF::Notify(nsITimer *timer)
|
|||
// DoComposite gets called when the timer for animation get fired and we have to
|
||||
// update the composited frame of the animation.
|
||||
nsresult imgContainerGIF::DoComposite(gfxIImageFrame** aFrameToUse,
|
||||
nsRect* aDirtyRect,
|
||||
nsIntRect* aDirtyRect,
|
||||
gfxIImageFrame* aPrevFrame,
|
||||
gfxIImageFrame* aNextFrame,
|
||||
PRInt32 aNextFrameIndex)
|
||||
|
@ -485,7 +485,7 @@ nsresult imgContainerGIF::DoComposite(gfxIImageFrame** aFrameToUse,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsRect prevFrameRect;
|
||||
nsIntRect prevFrameRect;
|
||||
aPrevFrame->GetRect(prevFrameRect);
|
||||
PRBool isFullPrevFrame = (prevFrameRect.x == 0 && prevFrameRect.y == 0 &&
|
||||
prevFrameRect.width == mSize.width &&
|
||||
|
@ -500,7 +500,7 @@ nsresult imgContainerGIF::DoComposite(gfxIImageFrame** aFrameToUse,
|
|||
}
|
||||
|
||||
PRInt32 nextFrameDisposalMethod;
|
||||
nsRect nextFrameRect;
|
||||
nsIntRect nextFrameRect;
|
||||
aNextFrame->GetFrameDisposalMethod(&nextFrameDisposalMethod);
|
||||
aNextFrame->GetRect(nextFrameRect);
|
||||
PRBool isFullNextFrame = (nextFrameRect.x == 0 && nextFrameRect.y == 0 &&
|
||||
|
@ -703,8 +703,7 @@ void imgContainerGIF::BuildCompositeMask(gfxIImageFrame *aCompositingFrame,
|
|||
return;
|
||||
}
|
||||
|
||||
nscoord widthOverlay;
|
||||
nscoord heightOverlay;
|
||||
PRInt32 widthOverlay, heightOverlay;
|
||||
PRInt32 overlayXOffset, overlayYOffset;
|
||||
aOverlayFrame->GetWidth(&widthOverlay);
|
||||
aOverlayFrame->GetHeight(&heightOverlay);
|
||||
|
@ -726,8 +725,7 @@ void imgContainerGIF::BuildCompositeMask(gfxIImageFrame *aCompositingFrame,
|
|||
aOverlayFrame->GetAlphaBytesPerRow(&abprOverlay);
|
||||
|
||||
// Only the composite's width & height are needed. x & y should always be 0.
|
||||
nscoord widthComposite;
|
||||
nscoord heightComposite;
|
||||
PRInt32 widthComposite, heightComposite;
|
||||
aCompositingFrame->GetWidth(&widthComposite);
|
||||
aCompositingFrame->GetHeight(&heightComposite);
|
||||
|
||||
|
@ -855,8 +853,8 @@ void imgContainerGIF::SetMaskVisibility(gfxIImageFrame *aFrame,
|
|||
return;
|
||||
}
|
||||
|
||||
nscoord frameWidth;
|
||||
nscoord frameHeight;
|
||||
PRInt32 frameWidth;
|
||||
PRInt32 frameHeight;
|
||||
aFrame->GetWidth(&frameWidth);
|
||||
aFrame->GetHeight(&frameHeight);
|
||||
|
||||
|
@ -981,13 +979,13 @@ void imgContainerGIF::BlackenFrame(gfxIImageFrame *aFrame)
|
|||
|
||||
nsCOMPtr<nsIInterfaceRequestor> ireq(do_QueryInterface(aFrame));
|
||||
if (ireq) {
|
||||
nscoord width;
|
||||
nscoord height;
|
||||
PRInt32 width;
|
||||
PRInt32 height;
|
||||
aFrame->GetWidth(&width);
|
||||
aFrame->GetHeight(&height);
|
||||
|
||||
nsCOMPtr<nsIImage> img(do_GetInterface(ireq));
|
||||
nsRect r(0, 0, width, height);
|
||||
nsIntRect r(0, 0, width, height);
|
||||
|
||||
img->ImageUpdated(nsnull, nsImageUpdateFlags_kBitsChanged, &r);
|
||||
}
|
||||
|
@ -1005,8 +1003,8 @@ void imgContainerGIF::BlackenFrame(gfxIImageFrame *aFrame,
|
|||
|
||||
aFrame->LockImageData();
|
||||
|
||||
nscoord widthFrame;
|
||||
nscoord heightFrame;
|
||||
PRInt32 widthFrame;
|
||||
PRInt32 heightFrame;
|
||||
aFrame->GetWidth(&widthFrame);
|
||||
aFrame->GetHeight(&heightFrame);
|
||||
|
||||
|
@ -1094,7 +1092,7 @@ PRBool imgContainerGIF::CopyFrameImage(gfxIImageFrame *aSrcFrame,
|
|||
nsCOMPtr<nsIImage> img(do_GetInterface(ireq));
|
||||
if (!img)
|
||||
return PR_FALSE;
|
||||
nsRect r;
|
||||
nsIntRect r;
|
||||
aDstFrame->GetRect(r);
|
||||
img->ImageUpdated(nsnull, nsImageUpdateFlags_kBitsChanged, &r);
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ private:
|
|||
* @param aNextFrame Frame we need to incorperate/display
|
||||
* @param aNextFrameIndex Position of aNextFrame in mFrames list
|
||||
*/
|
||||
nsresult DoComposite(gfxIImageFrame** aFrameToUse, nsRect* aDirtyRect,
|
||||
nsresult DoComposite(gfxIImageFrame** aFrameToUse, nsIntRect* aDirtyRect,
|
||||
gfxIImageFrame* aPrevFrame,
|
||||
gfxIImageFrame* aNextFrame,
|
||||
PRInt32 aNextFrameIndex);
|
||||
|
@ -197,7 +197,7 @@ private:
|
|||
PRBool aVisible);
|
||||
//! @overload
|
||||
void SetMaskVisibility(gfxIImageFrame *aFrame,
|
||||
nsRect &aRect, PRBool aVisible) {
|
||||
nsIntRect &aRect, PRBool aVisible) {
|
||||
SetMaskVisibility(aFrame, aRect.x, aRect.y,
|
||||
aRect.width, aRect.height, aVisible);
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ private:
|
|||
void BlackenFrame(gfxIImageFrame* aFrame,
|
||||
PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||
//! @overload
|
||||
inline void BlackenFrame(gfxIImageFrame* aFrame, nsRect &aRect) {
|
||||
inline void BlackenFrame(gfxIImageFrame* aFrame, nsIntRect &aRect) {
|
||||
BlackenFrame(aFrame, aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
}
|
||||
|
||||
|
@ -228,9 +228,9 @@ private:
|
|||
nsCOMArray<gfxIImageFrame> mFrames;
|
||||
|
||||
//! Size of GIF (not necessarily the frame)
|
||||
nsSize mSize;
|
||||
nsIntSize mSize;
|
||||
//! Area of the first frame that needs to be redrawn on subsequent loops
|
||||
nsRect mFirstFrameRefreshArea;
|
||||
nsIntRect mFirstFrameRefreshArea;
|
||||
|
||||
PRInt32 mCurrentDecodingFrameIndex; // 0 to numFrames-1
|
||||
PRInt32 mCurrentAnimationFrameIndex; // 0 to numFrames-1
|
||||
|
|
|
@ -169,31 +169,31 @@ nsGIFDecoder2::FlushImageData()
|
|||
{
|
||||
PRInt32 imgWidth;
|
||||
mImageContainer->GetWidth(&imgWidth);
|
||||
nsRect frameRect;
|
||||
nsIntRect frameRect;
|
||||
mImageFrame->GetRect(frameRect);
|
||||
|
||||
switch (mCurrentPass - mLastFlushedPass) {
|
||||
case 0: { // same pass
|
||||
PRInt32 remainingRows = mCurrentRow - mLastFlushedRow;
|
||||
if (remainingRows) {
|
||||
nsRect r(0, frameRect.y + mLastFlushedRow + 1,
|
||||
imgWidth, remainingRows);
|
||||
nsIntRect r(0, frameRect.y + mLastFlushedRow + 1,
|
||||
imgWidth, remainingRows);
|
||||
mObserver->OnDataAvailable(nsnull, mImageFrame, &r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: { // one pass on - need to handle bottom & top rects
|
||||
nsRect r(0, frameRect.y, imgWidth, mCurrentRow + 1);
|
||||
nsIntRect r(0, frameRect.y, imgWidth, mCurrentRow + 1);
|
||||
mObserver->OnDataAvailable(nsnull, mImageFrame, &r);
|
||||
nsRect r2(0, frameRect.y + mLastFlushedRow + 1,
|
||||
imgWidth, frameRect.height - mLastFlushedRow - 1);
|
||||
nsIntRect r2(0, frameRect.y + mLastFlushedRow + 1,
|
||||
imgWidth, frameRect.height - mLastFlushedRow - 1);
|
||||
mObserver->OnDataAvailable(nsnull, mImageFrame, &r2);
|
||||
}
|
||||
break;
|
||||
|
||||
default: { // more than one pass on - push the whole frame
|
||||
nsRect r(0, frameRect.y, imgWidth, frameRect.height);
|
||||
nsIntRect r(0, frameRect.y, imgWidth, frameRect.height);
|
||||
mObserver->OnDataAvailable(nsnull, mImageFrame, &r);
|
||||
}
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ int nsGIFDecoder2::BeginImageFrame(
|
|||
PRInt32 imgWidth;
|
||||
decoder->mImageContainer->GetWidth(&imgWidth);
|
||||
if (aFrameYOffset > 0) {
|
||||
nsRect r(0, 0, imgWidth, aFrameYOffset);
|
||||
nsIntRect r(0, 0, imgWidth, aFrameYOffset);
|
||||
decoder->mObserver->OnDataAvailable(nsnull, decoder->mImageFrame, &r);
|
||||
}
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ int nsGIFDecoder2::EndImageFrame(
|
|||
PRInt32 imgWidth;
|
||||
decoder->mImageContainer->GetWidth(&imgWidth);
|
||||
|
||||
nsRect r(0, realFrameHeight, imgWidth, imgHeight - realFrameHeight);
|
||||
nsIntRect r(0, realFrameHeight, imgWidth, imgHeight - realFrameHeight);
|
||||
decoder->mObserver->OnDataAvailable(nsnull, decoder->mImageFrame, &r);
|
||||
}
|
||||
}
|
||||
|
@ -451,8 +451,7 @@ int nsGIFDecoder2::HaveDecodedRow(
|
|||
}
|
||||
|
||||
if (aRowBufPtr) {
|
||||
nscoord width;
|
||||
|
||||
PRInt32 width;
|
||||
decoder->mImageFrame->GetWidth(&width);
|
||||
|
||||
gfx_format format;
|
||||
|
|
|
@ -136,7 +136,7 @@ NS_IMETHODIMP nsIconDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR
|
|||
mObserver->OnStartFrame(nsnull, mFrame);
|
||||
|
||||
PRUint32 bpr, abpr;
|
||||
nscoord width, height;
|
||||
PRInt32 width, height;
|
||||
mFrame->GetImageBytesPerRow(&bpr);
|
||||
mFrame->GetAlphaBytesPerRow(&abpr);
|
||||
mFrame->GetWidth(&width);
|
||||
|
@ -152,7 +152,7 @@ NS_IMETHODIMP nsIconDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PR
|
|||
PRUint8 *line = (PRUint8*)data + i*bpr;
|
||||
mFrame->SetImageData(line, bpr, (rownum++)*bpr);
|
||||
|
||||
nsRect r(0, rownum, width, 1);
|
||||
nsIntRect r(0, rownum, width, 1);
|
||||
mObserver->OnDataAvailable(nsnull, mFrame, &r);
|
||||
|
||||
wroteLen += bpr ;
|
||||
|
|
|
@ -548,7 +548,7 @@ nsJPEGDecoder::OutputScanlines()
|
|||
}
|
||||
|
||||
if (top != mInfo.output_scanline) {
|
||||
nsRect r(0, top, mInfo.output_width, mInfo.output_scanline-top);
|
||||
nsIntRect r(0, top, mInfo.output_width, mInfo.output_scanline-top);
|
||||
mObserver->OnDataAvailable(nsnull, mFrame, &r);
|
||||
}
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
|
|||
line = new_row;
|
||||
|
||||
if (new_row) {
|
||||
nscoord width;
|
||||
PRInt32 width;
|
||||
decoder->mFrame->GetWidth(&width);
|
||||
PRUint32 iwidth = width;
|
||||
|
||||
|
@ -515,7 +515,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
|
|||
break;
|
||||
}
|
||||
|
||||
nsRect r(0, row_num, width, 1);
|
||||
nsIntRect r(0, row_num, width, 1);
|
||||
decoder->mObserver->OnDataAvailable(nsnull, decoder->mFrame, &r);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ nsresult nsXBMDecoder::ProcessData(const char* aData, PRUint32 aCount) {
|
|||
// Row finished. Set Data.
|
||||
mFrame->SetAlphaData(mAlphaRow, abpr, mCurRow * abpr);
|
||||
mFrame->SetImageData(mRow, bpr, mCurRow * bpr);
|
||||
nsRect r(0, mCurRow, mWidth, 1);
|
||||
nsIntRect r(0, mCurRow, mWidth, 1);
|
||||
mObserver->OnDataAvailable(nsnull, mFrame, &r);
|
||||
|
||||
if ((mCurRow + 1) == mHeight) {
|
||||
|
|
|
@ -51,7 +51,7 @@ interface imgIContainerObserver;
|
|||
* @version 0.1
|
||||
* @see "gfx2"
|
||||
*/
|
||||
[scriptable, uuid(5e8405a4-1dd2-11b2-8385-bc8e3446cad3)]
|
||||
[scriptable, uuid(1a6290e6-8285-4e10-963d-d001f8d327b8)]
|
||||
interface imgIContainer : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -63,8 +63,8 @@ interface imgIContainer : nsISupports
|
|||
* gfxIImageFrame children will fit.
|
||||
* @param aObserver Observer to send animation notifications to.
|
||||
*/
|
||||
void init(in nscoord aWidth,
|
||||
in nscoord aHeight,
|
||||
void init(in PRInt32 aWidth,
|
||||
in PRInt32 aHeight,
|
||||
in imgIContainerObserver aObserver);
|
||||
|
||||
|
||||
|
@ -74,12 +74,12 @@ interface imgIContainer : nsISupports
|
|||
/**
|
||||
* The width of the container rectangle.
|
||||
*/
|
||||
readonly attribute nscoord width;
|
||||
readonly attribute PRInt32 width;
|
||||
|
||||
/**
|
||||
* The height of the container rectangle.
|
||||
*/
|
||||
readonly attribute nscoord height;
|
||||
readonly attribute PRInt32 height;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,10 +54,10 @@ interface gfxIImageFrame;
|
|||
* @author Stuart Parmenter <pavlov@netscape.com>
|
||||
* @version 0.1
|
||||
*/
|
||||
[uuid(153f1518-1dd2-11b2-b9cd-b16eb63e0471)]
|
||||
[uuid(53102f15-0f53-4939-957e-aea353ad2700)]
|
||||
interface imgIContainerObserver : nsISupports
|
||||
{
|
||||
[noscript] void frameChanged(in imgIContainer aContainer,
|
||||
in gfxIImageFrame aFrame,
|
||||
in nsRect aDirtyRect);
|
||||
in nsIntRect aDirtyRect);
|
||||
};
|
||||
|
|
|
@ -54,7 +54,7 @@ interface gfxIImageFrame;
|
|||
* @version 0.1
|
||||
* @see imagelib2
|
||||
*/
|
||||
[scriptable, uuid(350163d2-1dd2-11b2-9e69-89959ecec1f3)]
|
||||
[scriptable, uuid(cce7152e-4395-4231-a781-c347c5446cc2)]
|
||||
interface imgIDecoderObserver : imgIContainerObserver
|
||||
{
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ interface imgIDecoderObserver : imgIContainerObserver
|
|||
/**
|
||||
* called when some part of the frame has new data in it
|
||||
*/
|
||||
[noscript] void onDataAvailable(in imgIRequest aRequest, in gfxIImageFrame aFrame, [const] in nsRect aRect);
|
||||
[noscript] void onDataAvailable(in imgIRequest aRequest, in gfxIImageFrame aFrame, [const] in nsIntRect aRect);
|
||||
|
||||
/**
|
||||
* called when a frame is finished decoding
|
||||
|
|
|
@ -58,8 +58,8 @@ imgContainer::~imgContainer()
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* void init (in nscoord aWidth, in nscoord aHeight, in imgIContainerObserver aObserver); */
|
||||
NS_IMETHODIMP imgContainer::Init(nscoord aWidth, nscoord aHeight, imgIContainerObserver *aObserver)
|
||||
/* void init (in PRIn32 aWidth, in PRInt32 aHeight, in imgIContainerObserver aObserver); */
|
||||
NS_IMETHODIMP imgContainer::Init(PRInt32 aWidth, PRInt32 aHeight, imgIContainerObserver *aObserver)
|
||||
{
|
||||
if (aWidth <= 0 || aHeight <= 0) {
|
||||
NS_WARNING("error - negative image size\n");
|
||||
|
@ -85,8 +85,8 @@ NS_IMETHODIMP imgContainer::GetPreferredAlphaChannelFormat(gfx_format *aFormat)
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* readonly attribute nscoord width; */
|
||||
NS_IMETHODIMP imgContainer::GetWidth(nscoord *aWidth)
|
||||
/* readonly attribute PRInt32 width; */
|
||||
NS_IMETHODIMP imgContainer::GetWidth(PRInt32 *aWidth)
|
||||
{
|
||||
NS_ASSERTION(aWidth, "imgContainer::GetWidth; Invalid Arg");
|
||||
if (!aWidth)
|
||||
|
@ -97,8 +97,8 @@ NS_IMETHODIMP imgContainer::GetWidth(nscoord *aWidth)
|
|||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* readonly attribute nscoord height; */
|
||||
NS_IMETHODIMP imgContainer::GetHeight(nscoord *aHeight)
|
||||
/* readonly attribute PRInt32 height; */
|
||||
NS_IMETHODIMP imgContainer::GetHeight(PRInt32 *aHeight)
|
||||
{
|
||||
NS_ASSERTION(aHeight, "imgContainer::GetHeight; Invalid Arg");
|
||||
if (!aHeight)
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
virtual ~imgContainer();
|
||||
|
||||
private:
|
||||
nsSize mSize;
|
||||
nsIntSize mSize;
|
||||
nsCOMPtr<gfxIImageFrame> mFrame;
|
||||
};
|
||||
|
||||
|
|
|
@ -216,12 +216,12 @@ nsresult imgRequest::NotifyProxyListener(imgRequestProxy *proxy)
|
|||
|
||||
if (!(mState & onStopContainer)) {
|
||||
// OnDataAvailable
|
||||
nsRect r;
|
||||
nsIntRect r;
|
||||
frame->GetRect(r); // XXX we should only send the currently decoded rectangle here.
|
||||
proxy->OnDataAvailable(frame, &r);
|
||||
} else {
|
||||
// OnDataAvailable
|
||||
nsRect r;
|
||||
nsIntRect r;
|
||||
frame->GetRect(r); // We're done loading this image, send the the whole rect
|
||||
proxy->OnDataAvailable(frame, &r);
|
||||
|
||||
|
@ -357,10 +357,10 @@ NS_IMETHODIMP imgRequest::GetIsMultiPartChannel(PRBool *aIsMultiPartChannel)
|
|||
|
||||
/** imgIContainerObserver methods **/
|
||||
|
||||
/* [noscript] void frameChanged (in imgIContainer container, in gfxIImageFrame newframe, in nsRect dirtyRect); */
|
||||
/* [noscript] void frameChanged (in imgIContainer container, in gfxIImageFrame newframe, in nsIntRect dirtyRect); */
|
||||
NS_IMETHODIMP imgRequest::FrameChanged(imgIContainer *container,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
nsIntRect * dirtyRect)
|
||||
{
|
||||
LOG_SCOPE(gImgLog, "imgRequest::FrameChanged");
|
||||
|
||||
|
@ -456,10 +456,10 @@ NS_IMETHODIMP imgRequest::OnStartFrame(imgIRequest *request,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* [noscript] void onDataAvailable (in imgIRequest request, in gfxIImageFrame frame, [const] in nsRect rect); */
|
||||
/* [noscript] void onDataAvailable (in imgIRequest request, in gfxIImageFrame frame, [const] in nsIntRect rect); */
|
||||
NS_IMETHODIMP imgRequest::OnDataAvailable(imgIRequest *request,
|
||||
gfxIImageFrame *frame,
|
||||
const nsRect * rect)
|
||||
const nsIntRect * rect)
|
||||
{
|
||||
LOG_SCOPE(gImgLog, "imgRequest::OnDataAvailable");
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ NS_IMETHODIMP imgRequestProxy::Clone(imgIDecoderObserver* aObserver,
|
|||
|
||||
/** imgIContainerObserver methods **/
|
||||
|
||||
void imgRequestProxy::FrameChanged(imgIContainer *container, gfxIImageFrame *newframe, nsRect * dirtyRect)
|
||||
void imgRequestProxy::FrameChanged(imgIContainer *container, gfxIImageFrame *newframe, nsIntRect * dirtyRect)
|
||||
{
|
||||
LOG_FUNC(gImgLog, "imgRequestProxy::FrameChanged");
|
||||
|
||||
|
@ -401,7 +401,7 @@ void imgRequestProxy::OnStartFrame(gfxIImageFrame *frame)
|
|||
}
|
||||
}
|
||||
|
||||
void imgRequestProxy::OnDataAvailable(gfxIImageFrame *frame, const nsRect * rect)
|
||||
void imgRequestProxy::OnDataAvailable(gfxIImageFrame *frame, const nsIntRect * rect)
|
||||
{
|
||||
LOG_FUNC(gImgLog, "imgRequestProxy::OnDataAvailable");
|
||||
|
||||
|
|
|
@ -84,13 +84,13 @@ protected:
|
|||
void OnStartDecode (void);
|
||||
void OnStartContainer(imgIContainer *aContainer);
|
||||
void OnStartFrame (gfxIImageFrame *aFrame);
|
||||
void OnDataAvailable (gfxIImageFrame *aFrame, const nsRect * aRect);
|
||||
void OnDataAvailable (gfxIImageFrame *aFrame, const nsIntRect * aRect);
|
||||
void OnStopFrame (gfxIImageFrame *aFrame);
|
||||
void OnStopContainer (imgIContainer *aContainer);
|
||||
void OnStopDecode (nsresult status, const PRUnichar *statusArg);
|
||||
|
||||
/* non-virtual imgIContainerObserver methods */
|
||||
void FrameChanged(imgIContainer *aContainer, gfxIImageFrame *aFrame, nsRect * aDirtyRect);
|
||||
void FrameChanged(imgIContainer *aContainer, gfxIImageFrame *aFrame, nsIntRect * aDirtyRect);
|
||||
|
||||
/* non-virtual nsIRequestObserver methods */
|
||||
void OnStartRequest(nsIRequest *request, nsISupports *ctxt);
|
||||
|
|
Загрузка…
Ссылка в новой задаче