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

Issue 1152473006: cc: Remove DrawQuad::IterateResoruces (Closed)

Created:
5 years, 6 months ago by vmpstr
Modified:
5 years, 5 months ago
Reviewers:
sky, jschuh, piman, danakj, Nico, Mike West
CC:
cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Remove DrawQuad::IterateResoruces This patch removes IterateResources function in favor of iterating resources directly on the quad. In order to accomplish this, each derived quad uses new resources object on the base class to store all of the resources it needs. This allows the calling code that used to call IterateResources with a callback to instead directly iterate all of the ids and manipulate them in any way that is required. This improves the performance of the IterateResources test by ~30%. BUG=492765 R=danakj, piman@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/0eca2e87110112c678c5f4c89b7f99e2de6026bb Cr-Commit-Position: refs/heads/master@{#332476}

Patch Set 1 #

Patch Set 2 : #

Total comments: 17

Patch Set 3 : removeiterateresources #

Patch Set 4 : iterators! #

Total comments: 27

Patch Set 5 : no iterators! #

Patch Set 6 : #

Total comments: 16

Patch Set 7 : more changes #

Patch Set 8 : rebase #

Total comments: 2

Patch Set 9 : mkwst review #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+361 lines, -387 lines) Patch
M cc/layers/delegated_renderer_layer_impl.cc View 1 2 3 4 5 6 2 chunks +15 lines, -25 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -11 lines 0 comments Download
M cc/layers/tiled_layer_impl_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M cc/output/delegating_renderer.cc View 1 2 3 4 2 chunks +4 lines, -10 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 11 chunks +22 lines, -27 lines 0 comments Download
M cc/output/overlay_strategy_common.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -4 lines 0 comments Download
M cc/output/overlay_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M cc/output/software_renderer.cc View 3 chunks +7 lines, -7 lines 0 comments Download
M cc/quads/checkerboard_draw_quad.h View 1 chunk +0 lines, -2 lines 0 comments Download
M cc/quads/checkerboard_draw_quad.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M cc/quads/debug_border_draw_quad.h View 1 chunk +0 lines, -2 lines 0 comments Download
M cc/quads/debug_border_draw_quad.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M cc/quads/draw_quad.h View 1 2 3 4 5 6 7 2 chunks +16 lines, -3 lines 1 comment Download
M cc/quads/draw_quad.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M cc/quads/draw_quad_perftest.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -7 lines 0 comments Download
M cc/quads/draw_quad_unittest.cc View 1 2 3 4 5 17 chunks +47 lines, -45 lines 0 comments Download
M cc/quads/io_surface_draw_quad.h View 1 chunk +5 lines, -2 lines 0 comments Download
M cc/quads/io_surface_draw_quad.cc View 4 chunks +7 lines, -11 lines 0 comments Download
M cc/quads/list_container_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M cc/quads/picture_draw_quad.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -2 lines 0 comments Download
M cc/quads/picture_draw_quad.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M cc/quads/render_pass_draw_quad.h View 2 chunks +5 lines, -2 lines 0 comments Download
M cc/quads/render_pass_draw_quad.cc View 1 2 3 4 5 6 4 chunks +4 lines, -10 lines 0 comments Download
M cc/quads/solid_color_draw_quad.h View 1 chunk +0 lines, -2 lines 0 comments Download
M cc/quads/solid_color_draw_quad.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M cc/quads/stream_video_draw_quad.h View 1 chunk +4 lines, -3 lines 0 comments Download
M cc/quads/stream_video_draw_quad.cc View 4 chunks +7 lines, -9 lines 0 comments Download
M cc/quads/surface_draw_quad.h View 1 chunk +0 lines, -2 lines 0 comments Download
M cc/quads/surface_draw_quad.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M cc/quads/texture_draw_quad.h View 2 chunks +3 lines, -2 lines 0 comments Download
M cc/quads/texture_draw_quad.cc View 4 chunks +6 lines, -10 lines 0 comments Download
M cc/quads/tile_draw_quad.h View 1 chunk +4 lines, -4 lines 0 comments Download
M cc/quads/tile_draw_quad.cc View 4 chunks +6 lines, -10 lines 0 comments Download
M cc/quads/yuv_video_draw_quad.h View 1 chunk +18 lines, -6 lines 0 comments Download
M cc/quads/yuv_video_draw_quad.cc View 1 2 3 4 5 6 4 chunks +20 lines, -26 lines 0 comments Download
M cc/surfaces/surface_aggregator.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -7 lines 0 comments Download
M cc/surfaces/surface_aggregator.cc View 1 2 3 4 5 6 9 chunks +44 lines, -59 lines 0 comments Download
M cc/test/fake_delegated_renderer_layer_impl.cc View 1 2 3 4 2 chunks +9 lines, -16 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_delegated.cc View 6 chunks +11 lines, -11 lines 0 comments Download
M content/common/cc_messages.h View 1 2 3 4 5 6 7 8 7 chunks +9 lines, -9 lines 0 comments Download
M content/common/cc_messages.cc View 1 2 3 4 5 6 7 8 2 chunks +41 lines, -0 lines 0 comments Download
M content/common/cc_messages_unittest.cc View 1 5 chunks +9 lines, -9 lines 0 comments Download
M mojo/converters/surfaces/surfaces_type_converters.cc View 1 2 3 4 4 chunks +7 lines, -7 lines 0 comments Download
M mojo/converters/surfaces/tests/surface_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 32 (8 generated)
vmpstr
Hi, please take a look. I still have to write a perftest, but I would ...
5 years, 6 months ago (2015-05-28 16:49:58 UTC) #1
danakj
https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (right): https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc#newcode138 cc/layers/delegated_renderer_layer_impl.cc:138: for (const auto& quad : pass->quad_list) {} https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc#newcode139 cc/layers/delegated_renderer_layer_impl.cc:139: ...
5 years, 6 months ago (2015-05-28 17:10:06 UTC) #2
piman
https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (right): https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc#newcode139 cc/layers/delegated_renderer_layer_impl.cc:139: quad->IterateResources( On 2015/05/28 17:10:05, danakj wrote: > Does this ...
5 years, 6 months ago (2015-05-28 18:37:59 UTC) #3
vmpstr
https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (right): https://codereview.chromium.org/1152473006/diff/20001/cc/layers/delegated_renderer_layer_impl.cc#newcode138 cc/layers/delegated_renderer_layer_impl.cc:138: for (const auto& quad : pass->quad_list) On 2015/05/28 17:10:05, ...
5 years, 6 months ago (2015-05-28 18:38:45 UTC) #4
danakj
https://codereview.chromium.org/1152473006/diff/20001/cc/layers/tiled_layer_impl_unittest.cc File cc/layers/tiled_layer_impl_unittest.cc (right): https://codereview.chromium.org/1152473006/diff/20001/cc/layers/tiled_layer_impl_unittest.cc#newcode272 cc/layers/tiled_layer_impl_unittest.cc:272: EXPECT_NE(0u, quad->resource_id()) << LayerTestCommon::quad_string On 2015/05/28 18:38:45, vmpstr wrote: ...
5 years, 6 months ago (2015-05-28 19:02:29 UTC) #5
vmpstr
PTAL (with range based for-loops) https://codereview.chromium.org/1152473006/diff/20001/cc/layers/tiled_layer_impl_unittest.cc File cc/layers/tiled_layer_impl_unittest.cc (right): https://codereview.chromium.org/1152473006/diff/20001/cc/layers/tiled_layer_impl_unittest.cc#newcode272 cc/layers/tiled_layer_impl_unittest.cc:272: EXPECT_NE(0u, quad->resource_id()) << LayerTestCommon::quad_string ...
5 years, 6 months ago (2015-05-28 19:18:51 UTC) #6
piman
https://codereview.chromium.org/1152473006/diff/60001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (right): https://codereview.chromium.org/1152473006/diff/60001/cc/layers/delegated_renderer_layer_impl.cc#newcode127 cc/layers/delegated_renderer_layer_impl.cc:127: continue; You can break here actually. https://codereview.chromium.org/1152473006/diff/60001/cc/layers/layer_impl.cc File cc/layers/layer_impl.cc ...
5 years, 6 months ago (2015-05-28 19:35:47 UTC) #7
danakj
https://codereview.chromium.org/1152473006/diff/60001/cc/quads/draw_quad.h File cc/quads/draw_quad.h (right): https://codereview.chromium.org/1152473006/diff/60001/cc/quads/draw_quad.h#newcode137 cc/quads/draw_quad.h:137: return index_ == other.index_ && resources_ == other.resources_; I ...
5 years, 6 months ago (2015-05-28 20:57:37 UTC) #8
vmpstr
PTAL https://codereview.chromium.org/1152473006/diff/60001/cc/layers/delegated_renderer_layer_impl.cc File cc/layers/delegated_renderer_layer_impl.cc (right): https://codereview.chromium.org/1152473006/diff/60001/cc/layers/delegated_renderer_layer_impl.cc#newcode127 cc/layers/delegated_renderer_layer_impl.cc:127: continue; On 2015/05/28 19:35:46, piman (Very slow to ...
5 years, 6 months ago (2015-05-28 22:37:00 UTC) #9
danakj
LGTM A perf test would be good for your perf though. https://codereview.chromium.org/1152473006/diff/60001/cc/quads/draw_quad.h File cc/quads/draw_quad.h (right): ...
5 years, 6 months ago (2015-05-28 23:00:15 UTC) #10
vmpstr
I think I'll write a perftest as a separate patch to land before this one, ...
5 years, 6 months ago (2015-05-28 23:35:52 UTC) #11
vmpstr
The perftest (IterateResources) improves by about 30%. In the grand scheme of things, it probably ...
5 years, 6 months ago (2015-05-29 18:25:43 UTC) #12
vmpstr
+jschuh for content/common/ (and security review) +sky for mojo/converters/ Please take a look.
5 years, 6 months ago (2015-05-29 18:30:55 UTC) #15
sky
mojo/converters LGTM
5 years, 6 months ago (2015-05-29 19:15:54 UTC) #16
vmpstr
+mkwst as well for cc_messages
5 years, 6 months ago (2015-06-01 22:28:52 UTC) #18
Mike West
IPC LGTM % comment. https://codereview.chromium.org/1152473006/diff/140001/content/common/cc_messages.cc File content/common/cc_messages.cc (right): https://codereview.chromium.org/1152473006/diff/140001/content/common/cc_messages.cc#newcode839 content/common/cc_messages.cc:839: for (size_t i = 0; ...
5 years, 6 months ago (2015-06-02 04:37:19 UTC) #19
vmpstr
https://codereview.chromium.org/1152473006/diff/140001/content/common/cc_messages.cc File content/common/cc_messages.cc (right): https://codereview.chromium.org/1152473006/diff/140001/content/common/cc_messages.cc#newcode839 content/common/cc_messages.cc:839: for (size_t i = 0; i < p.count; ++i) ...
5 years, 6 months ago (2015-06-02 17:19:22 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152473006/160001
5 years, 6 months ago (2015-06-02 20:12:08 UTC) #23
commit-bot: I haz the power
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/64539)
5 years, 6 months ago (2015-06-02 21:28:39 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152473006/160001
5 years, 6 months ago (2015-06-02 21:32:05 UTC) #27
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 6 months ago (2015-06-02 22:14:55 UTC) #28
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/0eca2e87110112c678c5f4c89b7f99e2de6026bb Cr-Commit-Position: refs/heads/master@{#332476}
5 years, 6 months ago (2015-06-02 22:15:54 UTC) #29
Nico
https://codereview.chromium.org/1152473006/diff/160001/cc/quads/draw_quad.h File cc/quads/draw_quad.h (right): https://codereview.chromium.org/1152473006/diff/160001/cc/quads/draw_quad.h#newcode128 cc/quads/draw_quad.h:128: enum : size_t { kMaxResourceIdCount = 4 }; (drive-by ...
5 years, 5 months ago (2015-07-23 18:04:41 UTC) #31
vmpstr
5 years, 5 months ago (2015-07-23 21:40:04 UTC) #32
Message was sent while issue was closed.
On 2015/07/23 18:04:41, Nico (hiding) wrote:
> https://codereview.chromium.org/1152473006/diff/160001/cc/quads/draw_quad.h
> File cc/quads/draw_quad.h (right):
> 
>
https://codereview.chromium.org/1152473006/diff/160001/cc/quads/draw_quad.h#n...
> cc/quads/draw_quad.h:128: enum : size_t { kMaxResourceIdCount = 4 };
> (drive-by since I just saw this: explicit types on unnamed enums don't really
> make sense. You're just using this line to tell the compiler "yo,
> kMaxResourceIdCount is 4", the size_t bit doesn't add anything)

There's a DCHECK below that compares this to size_t, and without a type, there
would be a signed/unsigned comparison error (see trybots on
https://codereview.chromium.org/1248403002/). I can also do this as a cast, but
this seemed cleaner at the time (ie, it is an array size which is properly typed
as size_t...). 

> 
> (also, all other fields in this class are at the beginning of this class; it's
a
> bit weird that resources is tacked on at the end)

Because it's a type, I think it needs to be physically declared before it's
used, right? Maybe I confused this :P

Powered by Google App Engine
This is Rietveld 408576698