Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp b/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
| index ef35fb1fffab783a39ddaa21d7c09b690541270b..1bc8326764b8da9682ce12f3ede902e6f5e445bc 100644 |
| --- a/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
| +++ b/third_party/WebKit/Source/core/paint/BoxDecorationData.cpp |
| @@ -5,6 +5,7 @@ |
| #include "core/paint/BoxDecorationData.h" |
| #include "core/layout/LayoutBox.h" |
| +#include "core/paint/BoxPainter.h" |
| #include "core/style/BorderEdge.h" |
| #include "core/style/ComputedStyle.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| @@ -47,13 +48,23 @@ BackgroundBleedAvoidance BoxDecorationData::determineBackgroundBleedAvoidance(co |
| if (!hasBackground) |
| return BackgroundBleedNone; |
| - if (!hasBorderDecoration || !layoutBox.style()->hasBorderRadius() || layoutBox.canRenderBorderImage()) { |
| + const ComputedStyle& boxStyle = layoutBox.styleRef(); |
| + const bool hasBorderRadius = boxStyle.hasBorderRadius(); |
| + if (!hasBorderDecoration || !hasBorderRadius || layoutBox.canRenderBorderImage()) { |
| if (layoutBox.backgroundShouldAlwaysBeClipped()) |
| return BackgroundBleedClipOnly; |
| + // Border radius clipping may require layer bleed avoidance if we are going to draw |
| + // an image over something else, because we do not want the antialiasing to lead to bleeding |
| + if (boxStyle.hasBackgroundImage() && hasBorderRadius) { |
|
Stephen Chennney
2016/02/12 22:07:54
Have to make sure we have the background image bef
|
| + // But if the top layer is opaque for the purposes of background painting, we do not |
| + // need the bleed avoidance because we will not paint anything behind the top layer. |
| + if (!BoxPainter::isFillLayerOpaque(layoutBox.style()->backgroundLayers(), layoutBox)) |
|
Stephen Chennney
2016/02/12 22:07:54
Have to use the same test as used in BoxPainter.
|
| + return BackgroundBleedClipLayer; |
| + } |
| return BackgroundBleedNone; |
| } |
| - if (borderObscuresBackgroundEdge(*layoutBox.style())) |
| + if (borderObscuresBackgroundEdge(boxStyle)) |
| return BackgroundBleedShrinkBackground; |
| return BackgroundBleedClipLayer; |