Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2318)

Unified Diff: cc/raster/one_copy_tile_task_worker_pool.cc

Issue 1879153003: cc: Use ResourceUtil::UncheckedWidthInBytes() in CopyOnWorkerThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@raster_provider
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698