Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(11)

Issue 1159113010: Optimized box border side painting order (Closed)

Created:
4 years, 11 months ago by f(malita)
Modified:
4 years, 11 months ago
CC:
blink-reviews, blink-reviews-paint_chromium.org, dshwang, reed1, robertphillips, slimming-paint-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Optimized box border side painting order We are currently drawing border sides in a predefined/hard-coded order: top, bottom, left, right. This is limiting the applicability of overdraw as a corner seam avoidance technique (drawing an expanded side shape while relying on adjacent sides overdrawing unwanted portions) because the hard-coded side order is in many cases suboptimal (e.g. a double border side painted after a solid side cannot be used for overdraw as it doesn't fully cover the mitre area). The current approach is also inefficient when it comes to translucent borders: translucent sides may draw after opaque sides (preventing overdraw) and we create one transparency layer for each common-color edge set - but these layers are drawn/clipped independently, resulting in seaming artifacts. The CL removes this predefined order assumption and introduces a general side order optimizer with the following rules: * if needed, side opacity is always applied via (nested) transparency layers * more opaque sides are painted after less opaque sides * for equal opacity, more "solid" sides are painted after less solid sides (solid style after double style, etc.) * for equal opacity and style, try painting in non-adjacent order These rules are all geared towards maximizing the applicability of overdraw: if opaque color/style sides are always painted last, then mitres are not required for prior sides. The handling of translucent border sides is improved in a couple of ways: 1) instead of creating one transparency layer per unique translucent color, we now only create one transparency layer per unique alpha/opacity 2) using the layer nesting algorithm described in BoxBorderPainter::paintOpacityGroup() allows us to always draw sides using opaque paints => translucent sides are now effectively usable for overdraw While optimizing paint order, the CL doesn't attempt to maximize the use of overdraw. More aggressive overdraw optimizations may follow. BUG=474265 R=chrishtr@chromium.org,junov@chromium.org,pdr@chromium.org,fs@opera.com Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=196620

Patch Set 1 #

Patch Set 2 : comments, cleanup #

Patch Set 3 : expectations #

Total comments: 4

Patch Set 4 : review comments #

Total comments: 3

Patch Set 5 : effectiveOpacity fix + test #

Patch Set 6 : single sort #

Patch Set 7 : forgot the new test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+415 lines, -142 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download
A LayoutTests/fast/borders/border-mixed-alpha2.html View 1 2 3 4 6 1 chunk +83 lines, -0 lines 0 comments Download
A LayoutTests/fast/borders/border-mixed-alpha2-expected.png View 1 2 3 4 6 Binary file 0 comments Download
A + LayoutTests/fast/borders/border-mixed-alpha2-expected.txt View 1 2 3 4 6 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/paint/BoxBorderPainter.h View 2 chunks +8 lines, -5 lines 0 comments Download
M Source/core/paint/BoxBorderPainter.cpp View 1 2 3 4 5 9 chunks +300 lines, -138 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
f(malita)
This is the meat of https://codereview.chromium.org/1156663008/, enabling more aggressive use of overdraw for corner seam ...
4 years, 11 months ago (2015-06-03 19:58:45 UTC) #2
chrishtr
https://codereview.chromium.org/1159113010/diff/40001/Source/core/paint/BoxBorderPainter.cpp File Source/core/paint/BoxBorderPainter.cpp (right): https://codereview.chromium.org/1159113010/diff/40001/Source/core/paint/BoxBorderPainter.cpp#newcode403 Source/core/paint/BoxBorderPainter.cpp:403: struct BoxBorderPainter::ComplexBorderInfo { All of this code is just ...
4 years, 11 months ago (2015-06-03 22:12:00 UTC) #3
f(malita)
https://codereview.chromium.org/1159113010/diff/40001/Source/core/paint/BoxBorderPainter.cpp File Source/core/paint/BoxBorderPainter.cpp (right): https://codereview.chromium.org/1159113010/diff/40001/Source/core/paint/BoxBorderPainter.cpp#newcode403 Source/core/paint/BoxBorderPainter.cpp:403: struct BoxBorderPainter::ComplexBorderInfo { On 2015/06/03 22:12:00, chrishtr wrote: > ...
4 years, 11 months ago (2015-06-04 01:54:21 UTC) #4
fs
https://codereview.chromium.org/1159113010/diff/60001/Source/core/paint/BoxBorderPainter.cpp File Source/core/paint/BoxBorderPainter.cpp (right): https://codereview.chromium.org/1159113010/diff/60001/Source/core/paint/BoxBorderPainter.cpp#newcode739 Source/core/paint/BoxBorderPainter.cpp:739: effectiveOpacity *= groupOpacity; Based on the example above... won't ...
4 years, 11 months ago (2015-06-04 11:53:40 UTC) #5
f(malita)
https://codereview.chromium.org/1159113010/diff/60001/Source/core/paint/BoxBorderPainter.cpp File Source/core/paint/BoxBorderPainter.cpp (right): https://codereview.chromium.org/1159113010/diff/60001/Source/core/paint/BoxBorderPainter.cpp#newcode739 Source/core/paint/BoxBorderPainter.cpp:739: effectiveOpacity *= groupOpacity; On 2015/06/04 11:53:39, fs wrote: > ...
4 years, 11 months ago (2015-06-04 15:29:05 UTC) #6
fs
https://codereview.chromium.org/1159113010/diff/60001/Source/core/paint/BoxBorderPainter.cpp File Source/core/paint/BoxBorderPainter.cpp (right): https://codereview.chromium.org/1159113010/diff/60001/Source/core/paint/BoxBorderPainter.cpp#newcode739 Source/core/paint/BoxBorderPainter.cpp:739: effectiveOpacity *= groupOpacity; On 2015/06/04 15:29:05, f(malita) wrote: > ...
4 years, 11 months ago (2015-06-04 15:49:14 UTC) #7
chrishtr
On 2015/06/04 at 01:54:21, fmalita wrote: > https://codereview.chromium.org/1159113010/diff/40001/Source/core/paint/BoxBorderPainter.cpp > File Source/core/paint/BoxBorderPainter.cpp (right): > > https://codereview.chromium.org/1159113010/diff/40001/Source/core/paint/BoxBorderPainter.cpp#newcode403 ...
4 years, 11 months ago (2015-06-04 21:00:21 UTC) #8
f(malita)
On 2015/06/04 21:00:21, chrishtr wrote: > On 2015/06/04 at 01:54:21, fmalita wrote: > > > ...
4 years, 11 months ago (2015-06-05 18:15:54 UTC) #9
chrishtr
Sort function looks good now. I still don't uderstand the need for opacity groups though. ...
4 years, 11 months ago (2015-06-05 18:53:21 UTC) #10
f(malita)
On 2015/06/05 18:53:21, chrishtr wrote: > Sort function looks good now. > > I still ...
4 years, 11 months ago (2015-06-06 00:09:57 UTC) #11
chrishtr
lgtm
4 years, 11 months ago (2015-06-06 00:20:21 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1159113010/120001
4 years, 11 months ago (2015-06-06 00:20:40 UTC) #14
commit-bot: I haz the power
4 years, 11 months ago (2015-06-06 03:29:09 UTC) #15
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=196620

Powered by Google App Engine
This is Rietveld 408576698