Bug 1229825 - Make GIF deinterlacer respect the frame rect bounds. r=tn, a=sylvestre
authorEdwin Flores <eflores@mozilla.com>
Tue, 29 Dec 2015 18:19:27 -0500
changeset 310578 5a51913d7daf21404fcc4aef65424fd95c77d0b8
parent 310577 3c125ce5d3b1ec5367d9f788f6096b085a04a72a
child 310579 9f8711a3f2cfdfa923378f0a3b8864494ef02e92
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn, sylvestre
bugs1229825
milestone45.0a2
Bug 1229825 - Make GIF deinterlacer respect the frame rect bounds. r=tn, a=sylvestre
image/Downscaler.h
image/decoders/nsGIFDecoder2.cpp
--- a/image/Downscaler.h
+++ b/image/Downscaler.h
@@ -53,16 +53,17 @@ class Downscaler
 {
 public:
   /// Constructs a new Downscaler which to scale to size @aTargetSize.
   explicit Downscaler(const nsIntSize& aTargetSize);
   ~Downscaler();
 
   const nsIntSize& OriginalSize() const { return mOriginalSize; }
   const nsIntSize& TargetSize() const { return mTargetSize; }
+  const nsIntSize FrameSize() const { return nsIntSize(mFrameRect.width, mFrameRect.height); }
   const gfxSize& Scale() const { return mScale; }
 
   /**
    * Begins a new frame and reinitializes the Downscaler.
    *
    * @param aOriginalSize The original size of this frame, before scaling.
    * @param aFrameRect The region of  the original image which has data.
    *                   Every pixel outside @aFrameRect is considered blank and
--- a/image/decoders/nsGIFDecoder2.cpp
+++ b/image/decoders/nsGIFDecoder2.cpp
@@ -1172,17 +1172,17 @@ nsGIFDecoder2::WriteInternal(const char*
           }
         }
       }
 
       if (q[8] & 0x40) {
         mGIFStruct.interlaced = true;
         mGIFStruct.ipass = 1;
         if (mDownscaler) {
-          mDeinterlacer.emplace(mDownscaler->OriginalSize());
+          mDeinterlacer.emplace(mDownscaler->FrameSize());
         }
       } else {
         mGIFStruct.interlaced = false;
         mGIFStruct.ipass = 0;
       }
 
       // Only apply the Haeberli display hack on the first frame
       mGIFStruct.progressive_display = (mGIFStruct.images_decoded == 0);