No bug - Remove outdated comment and additional comment questioning its relevance. r=me DONTBUILD
authorMike Hommey <mh+mozilla@glandium.org>
Sun, 26 Jul 2015 11:39:44 +0900
changeset 254608 3a2312bfa3f283ed7fc1a9436e4c7c1a9f0cec4d
parent 254607 56fc13299fe6c72e341fab541bdad99835cc556e
child 254609 e7549c25cfcd77273abd493fa923183367fbfc40
push id29108
push userryanvm@gmail.com
push dateMon, 27 Jul 2015 14:12:01 +0000
treeherdermozilla-central@27ae736ef960 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs534467, 651858, 734668, 764125
milestone42.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
No bug - Remove outdated comment and additional comment questioning its relevance. r=me DONTBUILD The first half of the comment was added in bug 534467. At that point the code looked like: // NOTE! dst is the same as src, and this relies on reading // from src and advancing that ptr before writing to dst. PRUint8 *src = aData; PRUint8 *dst = aData; It was in content/canvas/src/nsCanvasRenderingContext2D.cpp. Then bug 651858 added nsCanvasRenderingContext2DAzure.cpp, starting from nsCanvasRenderingContext2D.cpp. The comment was kept, but the code was modified such that src and dst were different things. Then bug 734668 removed nsCanvasRenderingContext2D.cpp, and finally renamed nsCanvasRenderingContext2DAzure.cpp to CanvasRenderingContext2D.cpp. The comment questioning the relevance of the first comment was added in bug 764125, when the file was still nsCanvasRenderingContext2DAzure.cpp.
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -5069,20 +5069,16 @@ CanvasRenderingContext2D::GetImageDataAr
 
   JS::AutoCheckCannotGC nogc;
   uint8_t* data = JS_GetUint8ClampedArrayData(darray, nogc);
   if (!readback) {
     src = data;
     srcStride = aWidth * 4;
   }
 
-  // NOTE! dst is the same as src, and this relies on reading
-  // from src and advancing that ptr before writing to dst.
-  // NOTE! I'm not sure that it is, I think this comment might have been
-  // inherited from Thebes canvas and is no longer true
   uint8_t* dst = data + dstWriteRect.y * (aWidth * 4) + dstWriteRect.x * 4;
 
   if (mOpaque) {
     for (int32_t j = 0; j < dstWriteRect.height; ++j) {
       for (int32_t i = 0; i < dstWriteRect.width; ++i) {
         // XXX Is there some useful swizzle MMX we can use here?
 #if MOZ_LITTLE_ENDIAN
         uint8_t b = *src++;