Bug 1229825 - Make GIF deinterlacer respect the frame rect bounds. r=tn
authorEdwin Flores <eflores@mozilla.com>
Tue, 29 Dec 2015 18:19:27 -0500
changeset 277815 df078713d748487a433de312690c75e37a7f0d58
parent 277814 63bb81bf85174acf9e70f244a9ef0e0449939fca
child 277816 d2b5f30e0b9ce15285148c7c2dc944105bb0a48e
push id69616
push userryanvm@gmail.com
push dateTue, 29 Dec 2015 23:19:52 +0000
treeherdermozilla-inbound@df078713d748 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1229825
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1229825 - Make GIF deinterlacer respect the frame rect bounds. r=tn
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);