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

Issue 2196583002: Paint local background colors onto foreground layer. (Closed)

Created:
4 years, 4 months ago by flackr
Modified:
4 years, 4 months ago
Reviewers:
bokan, chrishtr
CC:
blink-reviews, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, chromium-reviews, dshwang, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Paint local background colors onto foreground layer. This patch adds support for drawing backgrounds into the scrolling content layer. This allows us to render text with sub-pixel anti-aliasing when an opaque background color is used meaning that we can now promote in these cases, and correctly supports content-box clips on locally attached backgrounds (see overflow-scroll-with-local-background.html test). BUG=381840 TEST=compositing/overflow/overflow-scroll-with-local-background.html,compositing/overflow/overflow-scroll-with-transparent-background.html,compositing/overflow/overflow-scroll-with-opaque-background.html Committed: https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f Cr-Commit-Position: refs/heads/master@{#410797}

Patch Set 1 #

Patch Set 2 : Fix some painting artifacts. #

Total comments: 2

Patch Set 3 : Don't propogate PaintingBackgroundOntoForeground to descendants #

Patch Set 4 : Skip root layer. #

Patch Set 5 : Blend mode is still opaque. #

Total comments: 12

Patch Set 6 : Call paintBackgroundForFragments twice to paint root and children with/without PaintingBackgroundOn… #

Patch Set 7 : Revert patchset 6 - return to patchset 5. #

Patch Set 8 : Remove PaintingBackgroundOntoForeground when painting descendant children. #

Total comments: 3

Patch Set 9 : Rename PaintLayerPaintingBackgroundOntoForeground to PaintLayerPaintingRootBackgroundOntoForeground #

Total comments: 6

Patch Set 10 : Only set PaintLayerPaintingRootBackgroundOntoForeground while painting root background instead of s… #

Total comments: 4

Patch Set 11 : Address review comments. #

Patch Set 12 : Reuse PaintLayerPaintingSkipRootBackground flag and use suggested organization from chrishtr. #

Patch Set 13 : Rename PaintLayer::shouldPaintBackgroundOntoForeground to PaintLayer::shouldPaintBackgroundOntoScro… #

Total comments: 8

Patch Set 14 : Address review comments and fix test failures by removing SkipRootBackground when painting a new ro… #

Total comments: 16

Patch Set 15 : Incorporate test related cleanups and comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+381 lines, -30 lines) Patch
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +37 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +30 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-expected.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +48 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-transparent-background.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +48 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-transparent-background-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +40 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +33 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BoxPainter.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/BoxPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +65 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/TableRowPainter.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/TableSectionPainter.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 44 (16 generated)
chrishtr
Is this CL ready for review?
4 years, 4 months ago (2016-07-29 18:20:20 UTC) #2
flackr
On 2016/07/29 at 18:20:20, chrishtr wrote: > Is this CL ready for review? I'm just ...
4 years, 4 months ago (2016-07-29 18:21:29 UTC) #3
bokan
https://codereview.chromium.org/2196583002/diff/20001/third_party/WebKit/Source/core/paint/BoxPainter.cpp File third_party/WebKit/Source/core/paint/BoxPainter.cpp (right): https://codereview.chromium.org/2196583002/diff/20001/third_party/WebKit/Source/core/paint/BoxPainter.cpp#newcode56 third_party/WebKit/Source/core/paint/BoxPainter.cpp:56: paintRect.move(-m_layoutBox.scrolledContentOffset()); I hit the ASSERTs in LayoutBox::scrolledContentOffset here on ...
4 years, 4 months ago (2016-07-29 19:22:54 UTC) #5
flackr
https://codereview.chromium.org/2196583002/diff/20001/third_party/WebKit/Source/core/paint/BoxPainter.cpp File third_party/WebKit/Source/core/paint/BoxPainter.cpp (right): https://codereview.chromium.org/2196583002/diff/20001/third_party/WebKit/Source/core/paint/BoxPainter.cpp#newcode56 third_party/WebKit/Source/core/paint/BoxPainter.cpp:56: paintRect.move(-m_layoutBox.scrolledContentOffset()); On 2016/07/29 at 19:22:54, bokan wrote: > I ...
4 years, 4 months ago (2016-07-29 19:28:17 UTC) #6
bokan
On 2016/07/29 19:28:17, flackr wrote: > https://codereview.chromium.org/2196583002/diff/20001/third_party/WebKit/Source/core/paint/BoxPainter.cpp > File third_party/WebKit/Source/core/paint/BoxPainter.cpp (right): > > https://codereview.chromium.org/2196583002/diff/20001/third_party/WebKit/Source/core/paint/BoxPainter.cpp#newcode56 > ...
4 years, 4 months ago (2016-07-29 19:29:00 UTC) #7
chrishtr
https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode1794 third_party/WebKit/Source/core/layout/LayoutBox.cpp:1794: if (style()->canContainFixedPositionObjects() && !isFixedPos) Spurious changes here? https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File ...
4 years, 4 months ago (2016-07-29 21:04:34 UTC) #8
flackr
https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode1794 third_party/WebKit/Source/core/layout/LayoutBox.cpp:1794: if (style()->canContainFixedPositionObjects() && !isFixedPos) On 2016/07/29 at 21:04:34, chrishtr ...
4 years, 4 months ago (2016-08-02 16:58:14 UTC) #9
flackr
https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/paint/PaintInfo.h File third_party/WebKit/Source/core/paint/PaintInfo.h (right): https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/paint/PaintInfo.h#newcode83 third_party/WebKit/Source/core/paint/PaintInfo.h:83: result.m_paintFlags &= ~PaintLayerPaintingBackgroundOntoForeground; On 2016/08/02 at 16:58:14, flackr wrote: ...
4 years, 4 months ago (2016-08-02 18:37:03 UTC) #14
flackr
On 2016/08/02 at 18:37:03, flackr wrote: > https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/paint/PaintInfo.h > File third_party/WebKit/Source/core/paint/PaintInfo.h (right): > > https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/paint/PaintInfo.h#newcode83 ...
4 years, 4 months ago (2016-08-02 19:29:30 UTC) #15
chrishtr
On 2016/08/02 at 19:29:30, flackr wrote: > On 2016/08/02 at 18:37:03, flackr wrote: > > ...
4 years, 4 months ago (2016-08-02 20:13:34 UTC) #18
flackr
https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp File third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp (right): https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp#newcode752 third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp:752: paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgroundsOnly, layerFragments, context, localPaintingInfo, paintFlags & ~PaintLayerPaintingBackgroundOntoForeground, clipState); I ...
4 years, 4 months ago (2016-08-03 15:33:14 UTC) #21
chrishtr
https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp File third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp (right): https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp#newcode752 third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp:752: paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgroundsOnly, layerFragments, context, localPaintingInfo, paintFlags & ~PaintLayerPaintingBackgroundOntoForeground, clipState); On ...
4 years, 4 months ago (2016-08-03 16:44:48 UTC) #22
flackr
https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp File third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp (right): https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp#newcode752 third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp:752: paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgroundsOnly, layerFragments, context, localPaintingInfo, paintFlags & ~PaintLayerPaintingBackgroundOntoForeground, clipState); On ...
4 years, 4 months ago (2016-08-03 17:47:10 UTC) #23
flackr
On 2016/08/03 at 16:44:48, chrishtr wrote: > https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp > File third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp (right): > > https://codereview.chromium.org/2196583002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp#newcode752 ...
4 years, 4 months ago (2016-08-03 18:38:59 UTC) #24
chrishtr
https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode313 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:313: // are background attachment local, otherwise background is painted ...
4 years, 4 months ago (2016-08-03 18:58:01 UTC) #25
flackr
https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode313 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:313: // are background attachment local, otherwise background is painted ...
4 years, 4 months ago (2016-08-03 20:58:53 UTC) #26
chrishtr
https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode313 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:313: // are background attachment local, otherwise background is painted ...
4 years, 4 months ago (2016-08-04 05:20:52 UTC) #27
flackr
On 2016/08/04 at 05:20:52, chrishtr wrote: > https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp > File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): > > https://codereview.chromium.org/2196583002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode313 ...
4 years, 4 months ago (2016-08-04 13:03:30 UTC) #28
flackr
As per our discussion I've done the following: 1. CLM explicitly sets the bit about ...
4 years, 4 months ago (2016-08-04 21:42:36 UTC) #29
chrishtr
https://codereview.chromium.org/2196583002/diff/240001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2196583002/diff/240001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode2453 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:2453: bool paintRootBackgroundIntoScrollingContentsLayer = m_owningLayer.shouldPaintBackgroundOntoScrollingContentsLayer(); Add: DCHECK(!paintRootBackgroundIntoScrollingContentsLayer || (!m_backgroundLayer && ...
4 years, 4 months ago (2016-08-05 00:40:09 UTC) #30
flackr
https://codereview.chromium.org/2196583002/diff/240001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2196583002/diff/240001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode2453 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:2453: bool paintRootBackgroundIntoScrollingContentsLayer = m_owningLayer.shouldPaintBackgroundOntoScrollingContentsLayer(); On 2016/08/05 at 00:40:08, chrishtr ...
4 years, 4 months ago (2016-08-08 18:01:30 UTC) #31
chrishtr
https://codereview.chromium.org/2196583002/diff/260001/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html File third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html (right): https://codereview.chromium.org/2196583002/diff/260001/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html#newcode23 third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html:23: <div id="scroller"> Add a comment explaining what this is ...
4 years, 4 months ago (2016-08-08 21:16:40 UTC) #32
chrishtr
Code is looking good, remaining comments are about tests.
4 years, 4 months ago (2016-08-08 21:16:51 UTC) #33
flackr
Thanks for the reviews! The tests look cleaner :-) https://codereview.chromium.org/2196583002/diff/260001/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html File third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html (right): https://codereview.chromium.org/2196583002/diff/260001/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html#newcode23 third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html:23: ...
4 years, 4 months ago (2016-08-09 18:35:27 UTC) #34
chrishtr
lgtm
4 years, 4 months ago (2016-08-09 20:14:46 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2196583002/280001
4 years, 4 months ago (2016-08-09 20:23:54 UTC) #41
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 4 months ago (2016-08-09 20:30:29 UTC) #42
commit-bot: I haz the power
4 years, 4 months ago (2016-08-09 20:33:46 UTC) #44
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f
Cr-Commit-Position: refs/heads/master@{#410797}

Powered by Google App Engine
This is Rietveld 408576698