Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 337813
Collapse All | Expand All

(-)old/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp (-2 / +1 lines)
Lines 202-208 Link Here
202
nsresult
202
nsresult
203
nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
203
nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
204
{
204
{
205
  nsIntRect r(0, fromRow, mGIFStruct.width, rows);
205
  nsIntRect r(mGIFStruct.x_offset, mGIFStruct.y_offset + fromRow, mGIFStruct.width, rows);
206
206
207
  // Update image  
207
  // Update image  
208
  nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
208
  nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
Lines 215-221 Link Here
215
  if (!mGIFStruct.images_decoded && mObserver) {
215
  if (!mGIFStruct.images_decoded && mObserver) {
216
    PRUint32 imgCurFrame;
216
    PRUint32 imgCurFrame;
217
    mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
217
    mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
218
    r.y += mGIFStruct.y_offset;
219
    mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
218
    mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
220
  }
219
  }
221
  return NS_OK;
220
  return NS_OK;
(-)old/modules/libpr0n/src/imgContainer.cpp (+7 lines)
Lines 420-425 Link Here
420
420
421
  frame->GetImageData(imageData, imageLength);
421
  frame->GetImageData(imageData, imageLength);
422
422
423
  frame->LockImageData();
424
423
  mFrames.InsertElementAt(framenum, frame.forget());
425
  mFrames.InsertElementAt(framenum, frame.forget());
424
  mNumFrames++;
426
  mNumFrames++;
425
427
Lines 445-450 Link Here
445
  nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
447
  nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
446
  NS_ENSURE_SUCCESS(rv, rv);
448
  NS_ENSURE_SUCCESS(rv, rv);
447
449
450
  if (mFrames.Length() > 0) {
451
    imgFrame *prevframe = mFrames.ElementAt(mFrames.Length() - 1);
452
    prevframe->UnlockImageData();
453
  }
454
448
  if (mFrames.Length() == 0) {
455
  if (mFrames.Length() == 0) {
449
    return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength, 
456
    return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength, 
450
                                  paletteData, paletteLength);
457
                                  paletteData, paletteLength);
(-)old/modules/libpr0n/src/imgFrame.cpp (-6 / +24 lines)
Lines 157-162 Link Here
157
#ifdef USE_WIN_SURFACE
157
#ifdef USE_WIN_SURFACE
158
  , mIsDDBSurface(PR_FALSE)
158
  , mIsDDBSurface(PR_FALSE)
159
#endif
159
#endif
160
  , mLocked(PR_FALSE)
160
{
161
{
161
  static PRBool hasCheckedOptimize = PR_FALSE;
162
  static PRBool hasCheckedOptimize = PR_FALSE;
162
  if (!hasCheckedOptimize) {
163
  if (!hasCheckedOptimize) {
Lines 418-425 Link Here
418
419
419
  PRBool doTile = !imageRect.Contains(sourceRect);
420
  PRBool doTile = !imageRect.Contains(sourceRect);
420
  if (doPadding || doPartialDecode) {
421
  if (doPadding || doPartialDecode) {
421
    gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height) +
422
    gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
422
      gfxPoint(aPadding.left, aPadding.top);
423
423
424
    if (!doTile && !mSinglePixel) {
424
    if (!doTile && !mSinglePixel) {
425
      // Not tiling, and we have a surface, so we can account for
425
      // Not tiling, and we have a surface, so we can account for
Lines 713-719 Link Here
713
713
714
  // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
714
  // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
715
  // you, gif decoder)
715
  // you, gif decoder)
716
  nsIntRect boundsRect(0, 0, mSize.width, mSize.height);
716
  nsIntRect boundsRect(mOffset, mSize);
717
  mDecoded.IntersectRect(mDecoded, boundsRect);
717
  mDecoded.IntersectRect(mDecoded, boundsRect);
718
718
719
#ifdef XP_MACOSX
719
#ifdef XP_MACOSX
Lines 811-817 Link Here
811
nsresult imgFrame::LockImageData()
811
nsresult imgFrame::LockImageData()
812
{
812
{
813
  if (mPalettedImageData)
813
  if (mPalettedImageData)
814
    return NS_OK;
814
    return NS_ERROR_NOT_AVAILABLE;
815
816
  NS_ABORT_IF_FALSE(!mLocked, "Trying to lock already locked image data.");
817
  if (mLocked) {
818
    return NS_ERROR_FAILURE;
819
  }
820
  mLocked = PR_TRUE;
815
821
816
  if ((mOptSurface || mSinglePixel) && !mImageSurface) {
822
  if ((mOptSurface || mSinglePixel) && !mImageSurface) {
817
    // Recover the pixels
823
    // Recover the pixels
Lines 837-849 Link Here
837
#endif
843
#endif
838
  }
844
  }
839
845
846
  if (mImageSurface)
847
    mImageSurface->Flush();
848
840
  return NS_OK;
849
  return NS_OK;
841
}
850
}
842
851
843
nsresult imgFrame::UnlockImageData()
852
nsresult imgFrame::UnlockImageData()
844
{
853
{
845
  if (mPalettedImageData)
854
  if (mPalettedImageData)
846
    return NS_OK;
855
    return NS_ERROR_NOT_AVAILABLE;
856
857
  NS_ABORT_IF_FALSE(mLocked, "Unlocking an unlocked image!");
858
  if (!mLocked) {
859
    return NS_ERROR_FAILURE;
860
  }
861
  mLocked = PR_FALSE;
862
863
  if (mImageSurface)
864
    mImageSurface->MarkDirty();
847
865
848
#ifdef XP_MACOSX
866
#ifdef XP_MACOSX
849
  if (mQuartzSurface)
867
  if (mQuartzSurface)
Lines 900-906 Link Here
900
918
901
PRBool imgFrame::ImageComplete() const
919
PRBool imgFrame::ImageComplete() const
902
{
920
{
903
  return mDecoded == nsIntRect(0, 0, mSize.width, mSize.height);
921
  return mDecoded == nsIntRect(mOffset, mSize);
904
}
922
}
905
923
906
// A hint from the image decoders that this image has no alpha, even
924
// A hint from the image decoders that this image has no alpha, even
(-)old/modules/libpr0n/src/imgFrame.h (+1 lines)
Lines 172-177 Link Here
172
  PRPackedBool mNeverUseDeviceSurface;
172
  PRPackedBool mNeverUseDeviceSurface;
173
  PRPackedBool mFormatChanged;
173
  PRPackedBool mFormatChanged;
174
  PRPackedBool mCompositingFailed;
174
  PRPackedBool mCompositingFailed;
175
  PRPackedBool mLocked;
175
176
176
#ifdef XP_WIN
177
#ifdef XP_WIN
177
  PRPackedBool mIsDDBSurface;
178
  PRPackedBool mIsDDBSurface;

Return to bug 337813