Chromium Code Reviews| Index: cc/raster/one_copy_tile_task_worker_pool.cc |
| diff --git a/cc/raster/one_copy_tile_task_worker_pool.cc b/cc/raster/one_copy_tile_task_worker_pool.cc |
| index a07ea8965f4ca5c92c6d807d7a0c706f64b0539a..d24624cfc802c64682fe0903986d2267bd835e74 100644 |
| --- a/cc/raster/one_copy_tile_task_worker_pool.cc |
| +++ b/cc/raster/one_copy_tile_task_worker_pool.cc |
| @@ -325,8 +325,8 @@ void OneCopyTileTaskWorkerPool::CopyOnWorkerThread( |
| gl->CompressedCopyTextureCHROMIUM(staging_buffer->texture_id, |
| resource_lock->texture_id()); |
| } else { |
| - int bytes_per_row = |
| - (BitsPerPixel(resource->format()) * resource->size().width()) / 8; |
| + int bytes_per_row = ResourceUtil::UncheckedWidthInBytes<int>( |
|
danakj
2016/04/13 18:38:59
If it can overflow/underflow then you want to use
reveman
2016/04/17 20:22:59
I don't think we want unnecessary conditionals to
danakj
2016/04/18 19:47:53
ok sg thanks, just wanted to be sure. LGTM then
|
| + resource->size().width(), resource->format()); |
| int chunk_size_in_rows = |
| std::max(1, max_bytes_per_copy_operation_ / bytes_per_row); |
| // Align chunk size to 4. Required to support compressed texture formats. |