From 4999636198979de49765e69fe1cad7486df87c95 Mon Sep 17 00:00:00 2001 From: reveman Date: Fri, 20 Nov 2015 10:37:46 -0800 Subject: cc: Pass correct stride to SkCanvas::readPixels. Use buffer stride as provided instead of assuming that it is width*bpp aligned to 4 bytes. BUG=531430,293728 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1466673002 Cr-Commit-Position: refs/heads/master@{#360863} --- cc/raster/tile_task_worker_pool.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'cc/raster') diff --git a/cc/raster/tile_task_worker_pool.cc b/cc/raster/tile_task_worker_pool.cc index 34c84cb..e1e6ac3 100644 --- a/cc/raster/tile_task_worker_pool.cc +++ b/cc/raster/tile_task_worker_pool.cc @@ -225,13 +225,8 @@ void TileTaskWorkerPool::PlaybackToMemory( SkImageInfo dst_info = SkImageInfo::Make(info.width(), info.height(), buffer_color_type, info.alphaType(), info.profileType()); - // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the - // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728 - // is fixed. - const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes()); - DCHECK_EQ(0u, dst_row_bytes % 4); - bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0); - DCHECK_EQ(true, success); + bool rv = canvas->readPixels(dst_info, memory, stride, 0, 0); + DCHECK(rv); } } -- cgit v1.1