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

Issue 18432002: Blend TextureLayer background-color at draw time. (Closed)

Created:
7 years, 5 months ago by alokp
Modified:
7 years, 5 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, cc-bugs_chromium.org
Visibility:
Public.

Description

Blend TextureLayer background-color at draw time. This enables the following optimization: 1. The compositor will be able to disable GL blending if the background-color is opaque. 2. For elements that paint directly to a texture layer, i.e. accelerated canvas, video, etc., there is no need to allocate an additional layer just to paint the background. BUG=236982 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=211339

Patch Set 1 #

Total comments: 9

Patch Set 2 : addressed comments #

Patch Set 3 : added TextureLayer unittest #

Total comments: 1

Patch Set 4 : separate shaders for textures with background #

Total comments: 6

Patch Set 5 : stashing incomplete pixel test #

Patch Set 6 : implemented software renderer #

Total comments: 1

Patch Set 7 : minor cleanup #

Total comments: 4

Patch Set 8 : added non-premultiplied test #

Total comments: 4

Patch Set 9 : simplified opaque-rect calculation #

Patch Set 10 : resolved conflicts with TOT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+469 lines, -20 lines) Patch
M cc/layers/heads_up_display_layer_impl.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.cc View 1 2 3 4 5 6 8 chunks +12 lines, -2 lines 0 comments Download
M cc/layers/scrollbar_layer_impl.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M cc/layers/texture_layer.h View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M cc/layers/texture_layer.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -0 lines 0 comments Download
M cc/layers/texture_layer_impl.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M cc/layers/texture_layer_impl.cc View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -1 line 0 comments Download
M cc/layers/texture_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/video_layer_impl.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M cc/output/gl_renderer.h View 1 2 3 4 5 6 7 8 9 3 chunks +16 lines, -0 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 7 8 chunks +83 lines, -5 lines 0 comments Download
M cc/output/gl_renderer_draw_cache.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M cc/output/renderer_pixeltest.cc View 1 2 3 4 5 6 7 3 chunks +169 lines, -0 lines 0 comments Download
M cc/output/shader.h View 1 2 3 4 5 4 chunks +32 lines, -1 line 0 comments Download
M cc/output/shader.cc View 1 2 3 4 5 1 chunk +62 lines, -0 lines 0 comments Download
M cc/output/software_renderer.cc View 1 2 3 4 5 6 1 chunk +22 lines, -2 lines 0 comments Download
M cc/quads/draw_quad_unittest.cc View 1 2 3 4 5 6 5 chunks +14 lines, -7 lines 0 comments Download
M cc/quads/texture_draw_quad.h View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M cc/quads/texture_draw_quad.cc View 1 2 3 4 5 6 4 chunks +9 lines, -2 lines 0 comments Download
M cc/test/render_pass_test_common.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_delegated.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/common/cc_messages.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/common/cc_messages_unittest.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
alokp
7 years, 5 months ago (2013-07-02 00:01:45 UTC) #1
piman
A few drive-by's Also, I think you need to support this in software_renderer too. https://codereview.chromium.org/18432002/diff/1/cc/output/shader.cc ...
7 years, 5 months ago (2013-07-02 01:26:30 UTC) #2
enne (OOO)
Can you add pixel tests for this change? https://codereview.chromium.org/18432002/diff/1/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/18432002/diff/1/cc/output/gl_renderer.cc#newcode1790 cc/output/gl_renderer.cc:1790: draw_cache_.background_color_data.push_back( ...
7 years, 5 months ago (2013-07-02 01:27:21 UTC) #3
alokp
piman: I will be happy to support software-renderer. Is there a command-line flag to enable ...
7 years, 5 months ago (2013-07-02 22:03:54 UTC) #4
piman
On Tue, Jul 2, 2013 at 3:03 PM, <alokp@chromium.org> wrote: > piman: I will be ...
7 years, 5 months ago (2013-07-02 22:27:53 UTC) #5
alokp
> > We're talking about our inner-most loop, it runs on several million pixels > ...
7 years, 5 months ago (2013-07-02 22:35:53 UTC) #6
alokp
https://codereview.chromium.org/18432002/diff/11001/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/18432002/diff/11001/cc/layers/texture_layer_impl.cc#newcode91 cc/layers/texture_layer_impl.cc:91: background_color() : SK_ColorTRANSPARENT; > But if background-color is not ...
7 years, 5 months ago (2013-07-02 22:36:05 UTC) #7
enne (OOO)
https://codereview.chromium.org/18432002/diff/1/cc/output/shader.cc File cc/output/shader.cc (right): https://codereview.chromium.org/18432002/diff/1/cc/output/shader.cc#newcode713 cc/output/shader.cc:713: gl_FragColor = texColor * v_alpha; On 2013/07/02 22:03:54, Alok ...
7 years, 5 months ago (2013-07-02 23:08:29 UTC) #8
alokp
It is a bit ugly but I have restored the original shaders for textures without ...
7 years, 5 months ago (2013-07-03 18:09:11 UTC) #9
piman
On 2013/07/03 18:09:11, Alok Priyadarshi wrote: > It is a bit ugly but I have ...
7 years, 5 months ago (2013-07-03 19:54:54 UTC) #10
piman
https://codereview.chromium.org/18432002/diff/16001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/18432002/diff/16001/cc/output/gl_renderer.cc#newcode1821 cc/output/gl_renderer.cc:1821: const TextureDrawQuad* quad) { FYI this method was removed ...
7 years, 5 months ago (2013-07-03 20:11:12 UTC) #11
alokp
Added pixel test and implemented the blending in software renderer. https://codereview.chromium.org/18432002/diff/16001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/18432002/diff/16001/cc/output/gl_renderer.cc#newcode1821 ...
7 years, 5 months ago (2013-07-09 00:08:06 UTC) #12
alokp
reviewers: PTAL. I think this is ready for CQ.
7 years, 5 months ago (2013-07-10 17:24:42 UTC) #13
enne (OOO)
Can you also add tests for the premultiplied vs not premultiplied path? I'd like any ...
7 years, 5 months ago (2013-07-10 17:52:13 UTC) #14
alokp
Added test for non-premultiplied path. Note that software renderer does not support non-premultiplied alpha yet. ...
7 years, 5 months ago (2013-07-10 19:06:19 UTC) #15
enne (OOO)
lgtm. I assume there's going to be a Blink-side change to not create layers for ...
7 years, 5 months ago (2013-07-10 19:56:00 UTC) #16
alokp
On 2013/07/10 19:56:00, enne wrote: > lgtm. > > I assume there's going to be ...
7 years, 5 months ago (2013-07-10 19:58:14 UTC) #17
piman
LGTM for content/
7 years, 5 months ago (2013-07-10 19:58:30 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alokp@chromium.org/18432002/34028
7 years, 5 months ago (2013-07-10 20:03:57 UTC) #19
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=14621
7 years, 5 months ago (2013-07-10 20:14:28 UTC) #20
alokp
cdn@: Could you review cc_messages.h
7 years, 5 months ago (2013-07-10 20:24:48 UTC) #21
alokp
+palmer for IPC review. cdn, palmer: Could any of you review cc_messages.h please?
7 years, 5 months ago (2013-07-11 16:07:12 UTC) #22
palmer
https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc#newcode111 cc/layers/texture_layer_impl.cc:111: gfx::Rect opaque_rect = contents_opaque() || (SkColorGetA(bg_color) == 0xFF) ? ...
7 years, 5 months ago (2013-07-11 18:37:22 UTC) #23
alokp
https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc#newcode111 cc/layers/texture_layer_impl.cc:111: gfx::Rect opaque_rect = contents_opaque() || (SkColorGetA(bg_color) == 0xFF) ? ...
7 years, 5 months ago (2013-07-11 19:55:00 UTC) #24
danakj
https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc#newcode111 cc/layers/texture_layer_impl.cc:111: gfx::Rect opaque_rect = contents_opaque() || (SkColorGetA(bg_color) == 0xFF) ? ...
7 years, 5 months ago (2013-07-11 20:34:04 UTC) #25
alokp
Added temp var. https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/18432002/diff/34028/cc/layers/texture_layer_impl.cc#newcode111 cc/layers/texture_layer_impl.cc:111: gfx::Rect opaque_rect = contents_opaque() || (SkColorGetA(bg_color) ...
7 years, 5 months ago (2013-07-11 20:42:33 UTC) #26
palmer
IPC security LGTM
7 years, 5 months ago (2013-07-11 21:34:57 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alokp@chromium.org/18432002/5733953138851840
7 years, 5 months ago (2013-07-11 21:42:20 UTC) #28
commit-bot: I haz the power
Failed to apply patch for webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 5 months ago (2013-07-11 21:42:35 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alokp@chromium.org/18432002/69001
7 years, 5 months ago (2013-07-11 23:40:09 UTC) #30
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 5 months ago (2013-07-12 00:22:54 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alokp@chromium.org/18432002/69001
7 years, 5 months ago (2013-07-12 05:06:56 UTC) #32
commit-bot: I haz the power
7 years, 5 months ago (2013-07-12 05:33:52 UTC) #33
Message was sent while issue was closed.
Change committed as 211339

Powered by Google App Engine
This is Rietveld 408576698