| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/BoxDecorationData.h" | 5 #include "core/paint/BoxDecorationData.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBox.h" | 7 #include "core/layout/LayoutBox.h" |
| 8 #include "core/paint/BoxPainter.h" | 8 #include "core/paint/BoxPainter.h" |
| 9 #include "core/style/BorderEdge.h" | 9 #include "core/style/BorderEdge.h" |
| 10 #include "core/style/ComputedStyle.h" | 10 #include "core/style/ComputedStyle.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (!hasBorderDecoration || !hasBorderRadius || layoutBox.canRenderBorderIma
ge()) { | 53 if (!hasBorderDecoration || !hasBorderRadius || layoutBox.canRenderBorderIma
ge()) { |
| 54 if (layoutBox.backgroundShouldAlwaysBeClipped()) | 54 if (layoutBox.backgroundShouldAlwaysBeClipped()) |
| 55 return BackgroundBleedClipOnly; | 55 return BackgroundBleedClipOnly; |
| 56 // Border radius clipping may require layer bleed avoidance if we are go
ing to draw | 56 // Border radius clipping may require layer bleed avoidance if we are go
ing to draw |
| 57 // an image over something else, because we do not want the antialiasing
to lead to bleeding | 57 // an image over something else, because we do not want the antialiasing
to lead to bleeding |
| 58 if (boxStyle.hasBackgroundImage() && hasBorderRadius) { | 58 if (boxStyle.hasBackgroundImage() && hasBorderRadius) { |
| 59 // But if the top layer is opaque for the purposes of background pai
nting, we do not | 59 // But if the top layer is opaque for the purposes of background pai
nting, we do not |
| 60 // need the bleed avoidance because we will not paint anything behin
d the top layer. | 60 // need the bleed avoidance because we will not paint anything behin
d the top layer. |
| 61 // But only if we need to draw something underneath. | 61 // But only if we need to draw something underneath. |
| 62 const FillLayer& fillLayer = layoutBox.style()->backgroundLayers(); | 62 const FillLayer& fillLayer = layoutBox.style()->backgroundLayers(); |
| 63 if ((backgroundColor.alpha() || fillLayer.next()) && !BoxPainter::is
FillLayerOpaque(fillLayer, layoutBox)) | 63 if ((backgroundColor.alpha() || fillLayer.next()) && !fillLayer.imag
eOccludesNextLayers(layoutBox)) |
| 64 return BackgroundBleedClipLayer; | 64 return BackgroundBleedClipLayer; |
| 65 } | 65 } |
| 66 return BackgroundBleedNone; | 66 return BackgroundBleedNone; |
| 67 } | 67 } |
| 68 | 68 |
| 69 if (borderObscuresBackgroundEdge(boxStyle)) | 69 if (borderObscuresBackgroundEdge(boxStyle)) |
| 70 return BackgroundBleedShrinkBackground; | 70 return BackgroundBleedShrinkBackground; |
| 71 | 71 |
| 72 return BackgroundBleedClipLayer; | 72 return BackgroundBleedClipLayer; |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |