Chromium Code Reviews| Index: ui/gfx/buffer_format_util.cc |
| diff --git a/ui/gfx/buffer_format_util.cc b/ui/gfx/buffer_format_util.cc |
| index 931b36d7947ecb151335cf2d9b0d6a42e923f026..4432b3e9a6c88568fe60ea4165f99b42816cd981 100644 |
| --- a/ui/gfx/buffer_format_util.cc |
| +++ b/ui/gfx/buffer_format_util.cc |
| @@ -53,7 +53,7 @@ bool RowSizeForBufferFormatChecked( |
| checked_size += 3; |
| if (!checked_size.IsValid()) |
| return false; |
| - *size_in_bytes = checked_size.ValueOrDie() & ~0x3; |
| + *size_in_bytes = (checked_size & ~0x3).ValueOrDie(); |
|
danakj
2016/11/30 23:13:20
I'm not clear why this is better. bitmask operatio
|
| return true; |
| case BufferFormat::RG_88: |
| case BufferFormat::BGR_565: |
| @@ -63,7 +63,7 @@ bool RowSizeForBufferFormatChecked( |
| checked_size += 3; |
| if (!checked_size.IsValid()) |
| return false; |
| - *size_in_bytes = checked_size.ValueOrDie() & ~0x3; |
| + *size_in_bytes = (checked_size & ~0x3).ValueOrDie(); |
| return true; |
| case BufferFormat::BGRX_8888: |
| case BufferFormat::RGBX_8888: |