Commit b1e65bcf authored by xidachen's avatar xidachen Committed by Commit bot

Correct a small mistake in ImageBitmap::copyBitmapData

In a previous CL, it was pointed out that the number "4" should be replaced
by info.bytesPerPixel() in two places. In that CL, it was corrected in
one place, but the other one was accidently left over. This CL corrects
the left-over one.

Review URL: https://codereview.chromium.org/1631353002

Cr-Commit-Position: refs/heads/master@{#371593}
parent 1cf50512
...@@ -171,7 +171,7 @@ PassOwnPtr<uint8_t[]> ImageBitmap::copyBitmapData() ...@@ -171,7 +171,7 @@ PassOwnPtr<uint8_t[]> ImageBitmap::copyBitmapData()
{ {
SkImageInfo info = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType); SkImageInfo info = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType);
OwnPtr<uint8_t[]> dstPixels = adoptArrayPtr(new uint8_t[width() * height() * info.bytesPerPixel()]); OwnPtr<uint8_t[]> dstPixels = adoptArrayPtr(new uint8_t[width() * height() * info.bytesPerPixel()]);
size_t dstRowBytes = 4 * width(); size_t dstRowBytes = info.bytesPerPixel() * width();
m_image->imageForCurrentFrame()->readPixels(info, dstPixels.get(), dstRowBytes, 0, 0); m_image->imageForCurrentFrame()->readPixels(info, dstPixels.get(), dstRowBytes, 0, 0);
return dstPixels.release(); return dstPixels.release();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment