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

Issue 658483003: Implement mix-blend-mode in GL renderer using shaders. (Closed)

Created:
6 years, 2 months ago by rosca
Modified:
6 years, 2 months ago
CC:
bsalomon_chromium, cc-bugs_chromium.org, chromium-reviews, danakj, Erik Dahlström (inactive), mihnea, reed2
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Implement mix-blend-mode in GL renderer using shaders. This implementation brings in several improvements for blending: - it's done faster, due to reducing the number of readbacks. - the backdrop doesn't suffer any transformation, so the result is more correct. - the results are similar to the ones obtained using the software paths. - blending is always applied after filters, even when the filters can be expressed using a color matrix. The initial experiment: https://codereview.chromium.org/555133002/. BUG=243223 Committed: https://crrev.com/7b73f83a1d6c212c3f4bc915f495baf1b4671dbf Cr-Commit-Position: refs/heads/master@{#300657}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fixing antialiasing issues #

Total comments: 11

Patch Set 3 : adding pixel tests and addressing comments #

Patch Set 4 : removing some unneeded code #

Total comments: 3

Patch Set 5 : clang-format on shaders + nits #

Patch Set 6 : generate baseline for pixel tests on linux #

Total comments: 2

Patch Set 7 : new shader specific enum for blend modes #

Total comments: 4

Patch Set 8 : nits #

Patch Set 9 : adjusting the pixel comparator for linux and mac #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1346 lines, -525 lines) Patch
M cc/layers/delegated_renderer_layer_impl_unittest.cc View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download
M cc/output/gl_renderer.h View 1 2 3 4 5 6 4 chunks +32 lines, -23 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 25 chunks +275 lines, -258 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 4 5 6 7 6 chunks +299 lines, -194 lines 0 comments Download
M cc/output/program_binding.h View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M cc/output/shader.h View 1 2 3 4 5 6 7 17 chunks +61 lines, -17 lines 0 comments Download
M cc/output/shader.cc View 1 2 3 4 5 6 24 chunks +348 lines, -25 lines 2 comments Download
M cc/output/software_renderer.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M cc/test/data/background_filter_blur_off_axis.png View 1 2 3 4 5 Binary file 0 comments Download
A cc/test/data/blending_render_pass.png View 1 2 Binary file 0 comments Download
A cc/test/data/blending_render_pass_cm.png View 1 2 Binary file 0 comments Download
A cc/test/data/blending_render_pass_mask.png View 1 2 Binary file 0 comments Download
A cc/test/data/blending_render_pass_mask_cm.png View 1 2 Binary file 0 comments Download
M cc/test/render_pass_test_utils.h View 1 chunk +2 lines, -1 line 0 comments Download
M cc/test/render_pass_test_utils.cc View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_pixeltest_blending.cc View 1 2 3 4 5 6 7 8 5 chunks +310 lines, -1 line 0 comments Download
M cc/trees/layer_tree_settings.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_settings.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 34 (10 generated)
rosca
6 years, 2 months ago (2014-10-14 11:13:38 UTC) #2
Erik Dahlström (inactive)
https://codereview.chromium.org/658483003/diff/1/cc/output/gl_renderer.h File cc/output/gl_renderer.h (right): https://codereview.chromium.org/658483003/diff/1/cc/output/gl_renderer.h#newcode47 cc/output/gl_renderer.h:47: static const SkXfermode::Mode kLastBlendMode = SkXfermode::kLuminosity_Mode; why not use ...
6 years, 2 months ago (2014-10-14 13:56:07 UTC) #4
rosca
https://codereview.chromium.org/658483003/diff/1/cc/output/gl_renderer.h File cc/output/gl_renderer.h (right): https://codereview.chromium.org/658483003/diff/1/cc/output/gl_renderer.h#newcode47 cc/output/gl_renderer.h:47: static const SkXfermode::Mode kLastBlendMode = SkXfermode::kLuminosity_Mode; On 2014/10/14 13:56:07, ...
6 years, 2 months ago (2014-10-15 15:33:55 UTC) #5
enne (OOO)
Just so I understand the ordering here, I'm expecting that the unit test patch is ...
6 years, 2 months ago (2014-10-15 19:18:22 UTC) #6
rosca
On 2014/10/15 19:18:22, enne wrote: > Just so I understand the ordering here, I'm expecting ...
6 years, 2 months ago (2014-10-15 19:36:47 UTC) #7
enne (OOO)
If the unit tests can't come before, I think they'd be better as a part ...
6 years, 2 months ago (2014-10-16 01:41:25 UTC) #8
rosca
Adrienne, thanks for the review. I merged the pixel tests from https://codereview.chromium.org/598593005/ into this patch. ...
6 years, 2 months ago (2014-10-16 16:14:56 UTC) #9
rosca
https://codereview.chromium.org/658483003/diff/60001/cc/trees/layer_tree_host_pixeltest_filters.cc File cc/trees/layer_tree_host_pixeltest_filters.cc (right): https://codereview.chromium.org/658483003/diff/60001/cc/trees/layer_tree_host_pixeltest_filters.cc#newcode140 cc/trees/layer_tree_host_pixeltest_filters.cc:140: float percentage_pixels_large_error = 0.435f; // 174px / (200*200) This ...
6 years, 2 months ago (2014-10-16 17:25:19 UTC) #11
danakj
https://codereview.chromium.org/658483003/diff/60001/cc/trees/layer_tree_host_pixeltest_filters.cc File cc/trees/layer_tree_host_pixeltest_filters.cc (right): https://codereview.chromium.org/658483003/diff/60001/cc/trees/layer_tree_host_pixeltest_filters.cc#newcode140 cc/trees/layer_tree_host_pixeltest_filters.cc:140: float percentage_pixels_large_error = 0.435f; // 174px / (200*200) On ...
6 years, 2 months ago (2014-10-16 17:27:00 UTC) #12
rosca
https://codereview.chromium.org/658483003/diff/20001/cc/output/shader.cc File cc/output/shader.cc (right): https://codereview.chromium.org/658483003/diff/20001/cc/output/shader.cc#newcode673 cc/output/shader.cc:673: return SHADER0(precision mediump float;) On 2014/10/16 01:41:25, enne wrote: ...
6 years, 2 months ago (2014-10-17 13:55:55 UTC) #13
enne (OOO)
This looks good in general to me. Thanks for adding the force antialiasing flag. https://codereview.chromium.org/658483003/diff/100001/cc/output/gl_renderer.h ...
6 years, 2 months ago (2014-10-17 19:16:16 UTC) #14
rosca
https://codereview.chromium.org/658483003/diff/100001/cc/output/gl_renderer.h File cc/output/gl_renderer.h (right): https://codereview.chromium.org/658483003/diff/100001/cc/output/gl_renderer.h#newcode62 cc/output/gl_renderer.h:62: static_assert(kNumBlendModes == 15, On 2014/10/17 19:16:15, enne wrote: > ...
6 years, 2 months ago (2014-10-20 12:07:37 UTC) #16
rosca
reed, bsalomon: please take a look at how we use Xfermode modes in this patch ...
6 years, 2 months ago (2014-10-21 13:48:13 UTC) #18
reed1
On 2014/10/21 13:48:13, rosca wrote: > reed, bsalomon: please take a look at how we ...
6 years, 2 months ago (2014-10-21 13:55:59 UTC) #19
enne (OOO)
lgtm, thanks! https://codereview.chromium.org/658483003/diff/120001/cc/output/gl_renderer_unittest.cc File cc/output/gl_renderer_unittest.cc (right): https://codereview.chromium.org/658483003/diff/120001/cc/output/gl_renderer_unittest.cc#newcode88 cc/output/gl_renderer_unittest.cc:88: default: style nit: Don't use default, since ...
6 years, 2 months ago (2014-10-21 18:13:30 UTC) #20
rosca
Thanks! https://codereview.chromium.org/658483003/diff/120001/cc/output/gl_renderer_unittest.cc File cc/output/gl_renderer_unittest.cc (right): https://codereview.chromium.org/658483003/diff/120001/cc/output/gl_renderer_unittest.cc#newcode88 cc/output/gl_renderer_unittest.cc:88: default: On 2014/10/21 18:13:30, enne wrote: > style ...
6 years, 2 months ago (2014-10-21 20:32:32 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/658483003/140001
6 years, 2 months ago (2014-10-22 06:07:40 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/26308)
6 years, 2 months ago (2014-10-22 07:13:06 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/658483003/140001
6 years, 2 months ago (2014-10-22 07:37:39 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/658483003/160001
6 years, 2 months ago (2014-10-22 08:55:07 UTC) #30
commit-bot: I haz the power
Committed patchset #9 (id:160001)
6 years, 2 months ago (2014-10-22 09:54:21 UTC) #31
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/7b73f83a1d6c212c3f4bc915f495baf1b4671dbf Cr-Commit-Position: refs/heads/master@{#300657}
6 years, 2 months ago (2014-10-22 09:56:17 UTC) #32
enne (OOO)
https://codereview.chromium.org/658483003/diff/160001/cc/output/shader.cc File cc/output/shader.cc (right): https://codereview.chromium.org/658483003/diff/160001/cc/output/shader.cc#newcode712 cc/output/shader.cc:712: ); Did the presubmit linter not yell at you ...
6 years, 2 months ago (2014-10-22 19:00:19 UTC) #33
rosca
6 years, 2 months ago (2014-10-22 19:35:02 UTC) #34
Message was sent while issue was closed.
https://codereview.chromium.org/658483003/diff/160001/cc/output/shader.cc
File cc/output/shader.cc (right):

https://codereview.chromium.org/658483003/diff/160001/cc/output/shader.cc#new...
cc/output/shader.cc:712: );
On 2014/10/22 19:00:18, enne wrote:
> Did the presubmit linter not yell at you for about whitespace and parentheses?

Seemingly not. I should have run it locally. Thanks for fixing it.

Powered by Google App Engine
This is Rietveld 408576698