Bug 786103 - Advance the aSrc and aDst pointers when copying video planes. r=roc
authorChris Peterson <cpeterson@mozilla.com>
Tue, 04 Sep 2012 10:10:06 -0700
changeset 104600 f0f098ac43867c3abe2811c48ac2a8e3ad0e1721
parent 104599 a21df306c3cdca808afb5768a5c9cb5e7657c79a
child 104601 1566e8499cb8f15b5c477142223a87c3455b3904
push id23433
push userryanvm@gmail.com
push dateSat, 08 Sep 2012 04:11:45 +0000
treeherdermozilla-central@1d4fc0c60063 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs786103
milestone18.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 786103 - Advance the aSrc and aDst pointers when copying video planes. r=roc
gfx/layers/ImageContainer.cpp
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -407,36 +407,36 @@ PlanarYCbCrImage::~PlanarYCbCrImage()
 
 uint8_t* 
 PlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
 {
   return mRecycleBin->GetBuffer(aSize); 
 }
 
 static void
-CopyPlane(uint8_t *aDst, uint8_t *aSrc,
+CopyPlane(uint8_t *aDst, const uint8_t *aSrc,
           const gfxIntSize &aSize, int32_t aStride, int32_t aSkip)
 {
   if (!aSkip) {
     // Fast path: planar input.
     memcpy(aDst, aSrc, aSize.height * aStride);
   } else {
     int32_t height = aSize.height;
     int32_t width = aSize.width;
     for (int y = 0; y < height; ++y) {
-      uint8_t *src = aSrc;
+      const uint8_t *src = aSrc;
       uint8_t *dst = aDst;
       // Slow path
       for (int x = 0; x < width; ++x) {
         *dst++ = *src++;
         src += aSkip;
       }
+      aSrc += aStride;
+      aDst += aStride;
     }
-    aSrc += aStride;
-    aDst += aStride;
   }
 }
 
 void
 PlanarYCbCrImage::CopyData(const Data& aData)
 {
   mData = aData;