Commit 7f42db61 authored by Sasha McIntosh's avatar Sasha McIntosh Committed by Commit Bot

Fix stride computation in pixel alignment.

Fix stride width computation by passing the stride bytes instead of
stride bytes as pixels.

Bug: 1024733
Change-Id: Ia383ac4fa5edf9cd84d661311db235d17ec6abd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918200
Commit-Queue: Sasha McIntosh <sashamcintosh@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715699}
parent 97555931
......@@ -250,7 +250,7 @@ void ClientImageTransferCacheEntry::ValidateYUVDataBeforeSerializing() const {
const SkPixmap* plane = yuv_pixmaps_->at(i);
DCHECK_GT(plane->width(), 0);
DCHECK_GT(plane->height(), 0);
DCHECK_GT(plane->rowBytesAsPixels(), 0);
DCHECK_GT(plane->rowBytes(), 0u);
}
}
......@@ -274,7 +274,7 @@ bool ClientImageTransferCacheEntry::Serialize(base::span<uint8_t> data) const {
const SkPixmap* plane = yuv_pixmaps_->at(i);
writer.Write(plane->width());
writer.Write(plane->height());
writer.Write(plane->rowBytesAsPixels());
writer.WriteSize(plane->rowBytes());
size_t plane_size = plane->computeByteSize();
if (plane_size == SIZE_MAX)
return false;
......@@ -405,8 +405,8 @@ bool ServiceImageTransferCacheEntry::Deserialize(
reader.Read(&plane_width);
uint32_t plane_height = 0;
reader.Read(&plane_height);
uint32_t plane_stride = 0;
reader.Read(&plane_stride);
size_t plane_stride = 0;
reader.ReadSize(&plane_stride);
// Because Skia does not support YUV rasterization from software planes,
// we require that each pixmap fits in a GPU texture. In the
// GpuImageDecodeCache, we veto YUV decoding if the planes would be too
......
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