Bug 196295 - move/merge GIF2.cpp into nsGIFDecoder2.

Patch by alfredkayser@nl.ibm.com,  r=biesi, sr=tor
This commit is contained in:
tor%cs.brown.edu 2007-06-25 16:41:21 +00:00
Родитель 484c345e6e
Коммит 7db936f475
6 изменённых файлов: 835 добавлений и 243 удалений

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

@ -312,9 +312,6 @@ PR_STATIC_CALLBACK(void)
imglib_Shutdown(nsIModule* aSelf)
{
imgCache::Shutdown();
#ifdef IMG_BUILD_DECODER_gif
nsGifShutdown();
#endif
}
NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsImageLib2Module, components,

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

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

@ -74,7 +74,6 @@ typedef enum {
/* A GIF decoder's state */
typedef struct gif_struct {
void* clientptr;
/* Parsing state machine */
gstate state; /* Curent decoder master state */
PRUint32 bytes_to_consume; /* Number of bytes to accumulate */
@ -85,7 +84,6 @@ typedef struct gif_struct {
int datasize;
int codesize;
int codemask;
int clear_code; /* Codeword used to trigger dictionary reset */
int avail; /* Index of next available slot in dictionary */
int oldcode;
PRUint8 firstchar;
@ -112,7 +110,6 @@ typedef struct gif_struct {
for this image in a multi-image GIF */
/* Global (multi-image) state */
int screen_bgcolor; /* Logical screen background color */
int version; /* Either 89 for GIF89 or 87 for GIF87 */
PRUintn screen_width; /* Logical screen width & height */
PRUintn screen_height;
@ -134,16 +131,5 @@ typedef struct gif_struct {
} gif_struct;
/* These are the APIs that the client calls to intialize,
push data to, and shut down the GIF decoder. */
PRBool GIFInit(gif_struct* gs, void* aClientData);
void gif_destroy(gif_struct* aGIFStruct);
PRStatus gif_write(gif_struct* aGIFStruct, const PRUint8 * buf, PRUint32 numbytes);
PRBool gif_write_ready(const gif_struct* aGIFStruct);
#endif

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

@ -56,7 +56,7 @@ REQUIRES = xpcom \
imglib2 \
$(NULL)
CPPSRCS = GIF2.cpp nsGIFDecoder2.cpp
CPPSRCS = nsGIFDecoder2.cpp
# nsGIFDecoder2.cpp includes imgContainer.h
LOCAL_INCLUDES += -I$(topsrcdir)/modules/libpr0n/src

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -70,58 +70,40 @@ public:
nsresult ProcessData(unsigned char *data, PRUint32 count, PRUint32 *_retval);
NS_METHOD FlushImageData();
private:
/* These functions will be called when the decoder has a decoded row,
* frame size information, etc. */
/* These functions will be called when the decoder has a decoded
* rows, frame size information, etc. */
void BeginGIF();
void EndGIF();
void BeginImageFrame();
void EndImageFrame();
void FlushImageData();
static int BeginGIF(
void* aClientData,
PRUint32 aLogicalScreenWidth,
PRUint32 aLogicalScreenHeight,
PRUint8 aBackgroundRGBIndex);
static int EndGIF(
void* aClientData,
int aAnimationLoopCount);
static int BeginImageFrame(
void* aClientData,
PRUint32 aFrameNumber, /* Frame number, 1-n */
PRUint32 aFrameXOffset, /* X offset in logical screen */
PRUint32 aFrameYOffset, /* Y offset in logical screen */
PRUint32 aFrameWidth,
PRUint32 aFrameHeight);
static int EndImageFrame(
void* aClientData,
PRUint32 aFrameNumber,
PRUint32 aDelayTimeout);
static int HaveDecodedRow(
void* aClientData,
nsresult GifWrite(const PRUint8 * buf, PRUint32 numbytes);
PRUint32 OutputRow();
PRBool DoLzw(const PRUint8 *q);
void HaveDecodedRow(
PRUint8* aRowBufPtr, /* Pointer to single scanline temporary buffer */
int aRow, /* Row number? */
int aDuplicateCount, /* Number of times to duplicate the row? */
int aInterlacePass);
private:
inline int ClearCode() const { return 1 << mGIFStruct.datasize; }
nsCOMPtr<imgIContainer> mImageContainer;
nsCOMPtr<gfxIImageFrame> mImageFrame;
nsCOMPtr<imgIDecoderObserver> mObserver; // this is just qi'd from mRequest for speed
PRInt32 mCurrentRow;
PRInt32 mLastFlushedRow;
gif_struct *mGIFStruct;
PRUint8 *mRGBLine;
PRUint32 mRGBLineMaxSize;
PRUint8 mBackgroundRGBIndex;
PRUint8 mCurrentPass;
PRUint8 mLastFlushedPass;
PRPackedBool mGIFOpen;
gif_struct mGIFStruct;
};
void nsGifShutdown();
#endif