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

Side by Side Diff: third_party/WebKit/Source/core/paint/BoxDecorationData.cpp

Issue 1787733003: Consolidate background fill layer opaqueness into one method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows build Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698