DescriptionOptimized 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 #
Messages
Total messages: 15 (2 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||