Bug 639415 - Disable prescaling of videos if they have an offset due to chromium scaling code not supporting offsets - r=kinetik
authorChris Double <chris.double@double.co.nz>
Mon, 14 Mar 2011 17:31:48 +1300
changeset 67674 ce528cff2f8f96bba6a3df8ef3897bab32395989
parent 67673 272a7b90280dd5771684342f73f6c6e23893f90d
child 67675 3b33622916e25577951983861865fb9358afff4d
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs639415
milestone2.2a1pre
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 639415 - Disable prescaling of videos if they have an offset due to chromium scaling code not supporting offsets - r=kinetik
gfx/layers/basic/BasicImages.cpp
--- a/gfx/layers/basic/BasicImages.cpp
+++ b/gfx/layers/basic/BasicImages.cpp
@@ -141,17 +141,19 @@ BasicPlanarYCbCrImage::SetData(const Dat
     NS_ERROR("Illegal width or height");
     return;
   }
 
   gfxASurface::gfxImageFormat format = GetOffscreenFormat();
 
   // 'prescale' is true if the scaling is to be done as part of the
   // YCbCr to RGB conversion rather than on the RGB data when rendered.
-  PRBool prescale = mScaleHint.width > 0 && mScaleHint.height > 0;
+  // We don't prescale if the image has an offset. See bug 639415.
+  PRBool prescale = mScaleHint.width > 0 && mScaleHint.height > 0 &&
+                    aData.mPicX == 0 && aData.mPicY == 0;
   if (format == gfxASurface::ImageFormatRGB16_565) {
     if (have_ycbcr_to_rgb565()) {
       // yuv2rgb16 with scale function not yet available for NEON
       prescale = PR_FALSE;
     } else {
       // yuv2rgb16 function not yet available for non-NEON
       format = gfxASurface::ImageFormatRGB24;
     }