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

Issue 1202843008: cc: Fix BytesPerPixel issue and refactor. (Closed)

Created:
5 years, 6 months ago by prashant.n
Modified:
5 years, 4 months ago
CC:
cc-bugs_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

1. With introduction of compressed formats, e.g. ETC1, the number of bits per pixel is becoming less than 8. Computing bytes per pixel by BitsPerPixel(format) / 8, might give different values. So compute the bits per row first and divide it by 8 to get the bytes per row. 2. Move resource size computation functions to separate file, i.e. resource_util.cc. 3. Move resource format related functions to resource_format.h. As there is dependecy on third_party/khronos/GLES2/gl2.h & third_party/khronos/GLES2/gl2ext.h, the inlined functions have been written as non-inlined functions and header files have been included in resource_format.cc. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/8e4942838460a8d66a31c46baf265a5a8b61a16a Cr-Commit-Position: refs/heads/master@{#341492}

Patch Set 1 #

Patch Set 2 : int=size_t in video_resource_updater.cc. #

Patch Set 3 : row bytes aligned #

Total comments: 7

Patch Set 4 : Moving few functions to their own files. #

Total comments: 1

Patch Set 5 : Formatted. #

Patch Set 6 : Formatted. #

Patch Set 7 : RowSize=>Width. #

Total comments: 5

Patch Set 8 : Corrected function names. #

Patch Set 9 : Corrected comments. #

Total comments: 7

Patch Set 10 : Addressed review comments. #

Total comments: 3

Patch Set 11 : Addressed review comments. #

Total comments: 6

Patch Set 12 : Templatized all the functions for consistency. #

Patch Set 13 : Removed resource_util.cc. #

Patch Set 14 : Removed redundant static_assert. #

Patch Set 15 : Fixed issue. #

Patch Set 16 : Ensured bytes to be integral value. #

Total comments: 7

Patch Set 17 : Added unit test for resource_util functions. #

Patch Set 18 : Removed constness of height. #

Patch Set 19 : Addressed review comments. #

Patch Set 20 : Spelling mistake. #

Total comments: 1

Patch Set 21 : Replaced std::is_same by local definition. #

Patch Set 22 : Rebased. #

Patch Set 23 : Rebase errors. #

Patch Set 24 : Rebase errors. #

Patch Set 25 : Fixed win build break. #

Patch Set 26 : Fixed Android build break. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+541 lines, -139 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M cc/raster/pixel_buffer_tile_task_worker_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +9 lines, -9 lines 0 comments Download
M cc/raster/tile_task_worker_pool_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M cc/resources/resource.h View 1 2 3 2 chunks +1 line, -32 lines 0 comments Download
M cc/resources/resource_format.h View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -0 lines 0 comments Download
M cc/resources/resource_format.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +62 lines, -0 lines 0 comments Download
M cc/resources/resource_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 chunks +13 lines, -11 lines 0 comments Download
M cc/resources/resource_pool_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +3 lines, -1 line 0 comments Download
M cc/resources/resource_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -55 lines 0 comments Download
M cc/resources/resource_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +7 lines, -12 lines 0 comments Download
A cc/resources/resource_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +242 lines, -0 lines 0 comments Download
A cc/resources/resource_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +167 lines, -0 lines 0 comments Download
M cc/resources/scoped_resource_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M cc/resources/video_resource_updater.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +10 lines, -8 lines 0 comments Download
M cc/tiles/tile.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M cc/tiles/tile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +3 lines, -2 lines 0 comments Download
M cc/tiles/tile_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 62 (19 generated)
prashant.n
PTAL.
5 years, 6 months ago (2015-06-24 16:26:26 UTC) #2
reveman
https://codereview.chromium.org/1202843008/diff/40001/cc/resources/resource.h File cc/resources/resource.h (left): https://codereview.chromium.org/1202843008/diff/40001/cc/resources/resource.h#oldcode55 cc/resources/resource.h:55: size.height() / 8; hm, looks like this was broken ...
5 years, 6 months ago (2015-06-24 18:02:26 UTC) #3
vmpstr
https://codereview.chromium.org/1202843008/diff/40001/cc/resources/resource.h File cc/resources/resource.h (left): https://codereview.chromium.org/1202843008/diff/40001/cc/resources/resource.h#oldcode55 cc/resources/resource.h:55: size.height() / 8; On 2015/06/24 18:02:26, reveman wrote: > ...
5 years, 6 months ago (2015-06-24 18:46:14 UTC) #5
prashant.n
PTAL https://codereview.chromium.org/1202843008/diff/40001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/1202843008/diff/40001/cc/resources/video_resource_updater.cc#newcode310 cc/resources/video_resource_updater.cc:310: size_t bits_per_pixel = BitsPerPixel(plane_resource.resource_format); On 2015/06/24 18:02:26, reveman ...
5 years, 6 months ago (2015-06-25 15:23:04 UTC) #6
prashant.n
PTAL.
5 years, 5 months ago (2015-07-01 17:18:29 UTC) #8
prashant.n
On 2015/07/01 17:18:29, prashant.n wrote: > PTAL. Anybody back to review this?
5 years, 5 months ago (2015-07-14 03:31:34 UTC) #9
vmpstr
https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_format.h File cc/resources/resource_format.h (right): https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_format.h#newcode13 cc/resources/resource_format.h:13: typedef unsigned int GLenum; Can you instead include one ...
5 years, 5 months ago (2015-07-14 17:44:15 UTC) #10
prashant.n
https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_util.cc File cc/resources/resource_util.cc (right): https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_util.cc#newcode27 cc/resources/resource_util.cc:27: size_t ResourceUtil::CheckedSizeInBytes(const gfx::Size& size, On 2015/07/14 17:44:15, vmpstr wrote: ...
5 years, 5 months ago (2015-07-15 07:03:31 UTC) #11
vmpstr
https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_util.cc File cc/resources/resource_util.cc (right): https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_util.cc#newcode27 cc/resources/resource_util.cc:27: size_t ResourceUtil::CheckedSizeInBytes(const gfx::Size& size, On 2015/07/15 07:03:31, prashant.n wrote: ...
5 years, 5 months ago (2015-07-15 17:43:23 UTC) #12
prashant.n
> > > > You mean to say - instead of SizeInBytes, use UncheckedSizeInBytes? > ...
5 years, 5 months ago (2015-07-15 18:22:09 UTC) #13
prashant.n
PTAL https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_format.h File cc/resources/resource_format.h (right): https://codereview.chromium.org/1202843008/diff/120001/cc/resources/resource_format.h#newcode13 cc/resources/resource_format.h:13: typedef unsigned int GLenum; On 2015/07/14 17:44:15, vmpstr ...
5 years, 5 months ago (2015-07-16 05:54:02 UTC) #14
vmpstr
https://codereview.chromium.org/1202843008/diff/160001/cc/resources/resource_format.cc File cc/resources/resource_format.cc (right): https://codereview.chromium.org/1202843008/diff/160001/cc/resources/resource_format.cc#newcode52 cc/resources/resource_format.cc:52: static const unsigned format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = { nit: ...
5 years, 5 months ago (2015-07-16 19:04:00 UTC) #15
prashant.n
PTAL https://codereview.chromium.org/1202843008/diff/160001/cc/resources/resource_provider.cc File cc/resources/resource_provider.cc (right): https://codereview.chromium.org/1202843008/diff/160001/cc/resources/resource_provider.cc#newcode1524 cc/resources/resource_provider.cc:1524: int resource_bytes = ResourceUtil::UncheckedSizeInBytesAligned( On 2015/07/16 19:04:00, vmpstr ...
5 years, 5 months ago (2015-07-22 15:44:58 UTC) #16
vmpstr
Other than the comment below, this change looks good. https://codereview.chromium.org/1202843008/diff/180001/cc/resources/resource_util.h File cc/resources/resource_util.h (right): https://codereview.chromium.org/1202843008/diff/180001/cc/resources/resource_util.h#newcode18 cc/resources/resource_util.h:18: ...
5 years, 5 months ago (2015-07-22 18:05:55 UTC) #17
prashant.n
https://codereview.chromium.org/1202843008/diff/180001/cc/resources/resource_util.h File cc/resources/resource_util.h (right): https://codereview.chromium.org/1202843008/diff/180001/cc/resources/resource_util.h#newcode18 cc/resources/resource_util.h:18: static int CheckedSizeInBytes(const gfx::Size& size, ResourceFormat format); I thought ...
5 years, 5 months ago (2015-07-23 05:27:10 UTC) #18
vmpstr
https://codereview.chromium.org/1202843008/diff/180001/cc/resources/resource_util.h File cc/resources/resource_util.h (right): https://codereview.chromium.org/1202843008/diff/180001/cc/resources/resource_util.h#newcode18 cc/resources/resource_util.h:18: static int CheckedSizeInBytes(const gfx::Size& size, ResourceFormat format); On 2015/07/23 ...
5 years, 5 months ago (2015-07-23 17:56:27 UTC) #19
prashant.n
PTAL.
5 years, 5 months ago (2015-07-24 06:28:36 UTC) #20
ericrk
On 2015/07/24 06:28:36, prashant.n wrote: > PTAL. Taking a look as well. Overall LGTM with ...
5 years, 5 months ago (2015-07-24 20:03:46 UTC) #21
ericrk
https://codereview.chromium.org/1202843008/diff/200001/cc/resources/resource_format.cc File cc/resources/resource_format.cc (right): https://codereview.chromium.org/1202843008/diff/200001/cc/resources/resource_format.cc#newcode52 cc/resources/resource_format.cc:52: static const GLenum format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = { There's ...
5 years, 5 months ago (2015-07-24 20:03:52 UTC) #23
prashant.n
5 years, 5 months ago (2015-07-25 07:15:06 UTC) #24
prashant.n
https://codereview.chromium.org/1202843008/diff/200001/cc/resources/resource_format.cc File cc/resources/resource_format.cc (right): https://codereview.chromium.org/1202843008/diff/200001/cc/resources/resource_format.cc#newcode52 cc/resources/resource_format.cc:52: static const GLenum format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = { Sounds ...
5 years, 5 months ago (2015-07-25 07:15:43 UTC) #25
prashant.n
All review comments addressed, but few unittests are failing on my machine. Checking if that ...
5 years, 4 months ago (2015-07-27 17:37:55 UTC) #26
prashant.n
PTAL at newly added functions and integral width portion. (Now all unit tests are passing.) ...
5 years, 4 months ago (2015-07-28 15:47:32 UTC) #27
prashant.n
Looks we may need to write unit test for resource_util functions.
5 years, 4 months ago (2015-07-28 16:19:45 UTC) #28
prashant.n
Now PTAL.
5 years, 4 months ago (2015-07-29 16:27:45 UTC) #29
ericrk
Looks good. Thanks for adding the tests! https://codereview.chromium.org/1202843008/diff/300001/cc/resources/resource_util.h File cc/resources/resource_util.h (right): https://codereview.chromium.org/1202843008/diff/300001/cc/resources/resource_util.h#newcode16 cc/resources/resource_util.h:16: #define VERIFY_INTEGER_TYPE ...
5 years, 4 months ago (2015-07-29 18:19:24 UTC) #30
enne (OOO)
https://codereview.chromium.org/1202843008/diff/300001/cc/resources/resource_util.h File cc/resources/resource_util.h (right): https://codereview.chromium.org/1202843008/diff/300001/cc/resources/resource_util.h#newcode16 cc/resources/resource_util.h:16: #define VERIFY_INTEGER_TYPE \ Yeah, I'd prefer not having a ...
5 years, 4 months ago (2015-07-29 18:21:21 UTC) #31
prashant.n
Please review and let me your opinion for moving template definitions to .cc. https://codereview.chromium.org/1202843008/diff/300001/cc/resources/resource_util.h File ...
5 years, 4 months ago (2015-07-30 18:45:02 UTC) #32
vmpstr
lgtm stamp when ericrk is happy with it. https://codereview.chromium.org/1202843008/diff/380001/cc/resources/resource_util.h File cc/resources/resource_util.h (right): https://codereview.chromium.org/1202843008/diff/380001/cc/resources/resource_util.h#newcode156 cc/resources/resource_util.h:156: std::numeric_limits<T>::is_integer ...
5 years, 4 months ago (2015-07-30 20:50:58 UTC) #33
ericrk
On 2015/07/30 20:50:58, vmpstr wrote: > lgtm stamp when ericrk is happy with it. > ...
5 years, 4 months ago (2015-07-30 22:19:03 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1202843008/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1202843008/400001
5 years, 4 months ago (2015-07-31 06:05:28 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/79729) ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 4 months ago (2015-07-31 06:07:38 UTC) #39
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1202843008/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1202843008/420001
5 years, 4 months ago (2015-07-31 09:34:46 UTC) #41
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/73373)
5 years, 4 months ago (2015-07-31 09:43:58 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1202843008/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1202843008/460001
5 years, 4 months ago (2015-07-31 11:05:47 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/84889)
5 years, 4 months ago (2015-07-31 11:58:45 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1202843008/480001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1202843008/480001
5 years, 4 months ago (2015-07-31 13:07:52 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/50618)
5 years, 4 months ago (2015-07-31 15:25:36 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1202843008/500001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1202843008/500001
5 years, 4 months ago (2015-08-01 09:59:21 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/93815)
5 years, 4 months ago (2015-08-01 11:13:10 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1202843008/500001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1202843008/500001
5 years, 4 months ago (2015-08-03 05:52:51 UTC) #60
commit-bot: I haz the power
Committed patchset #26 (id:500001)
5 years, 4 months ago (2015-08-03 07:13:51 UTC) #61
commit-bot: I haz the power
5 years, 4 months ago (2015-08-03 07:14:28 UTC) #62
Message was sent while issue was closed.
Patchset 26 (id:??) landed as
https://crrev.com/8e4942838460a8d66a31c46baf265a5a8b61a16a
Cr-Commit-Position: refs/heads/master@{#341492}

Powered by Google App Engine
This is Rietveld 408576698