| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 | 1165 |
| 1166 LayoutRect bottomRightRect(boundingRect.location(), LayoutSize(radii.bottomR
ight())); | 1166 LayoutRect bottomRightRect(boundingRect.location(), LayoutSize(radii.bottomR
ight())); |
| 1167 bottomRightRect.setX(boundingRect.maxX() - bottomRightRect.width()); | 1167 bottomRightRect.setX(boundingRect.maxX() - bottomRightRect.width()); |
| 1168 bottomRightRect.setY(boundingRect.maxY() - bottomRightRect.height()); | 1168 bottomRightRect.setY(boundingRect.maxY() - bottomRightRect.height()); |
| 1169 if (clipRect.intersects(bottomRightRect)) | 1169 if (clipRect.intersects(bottomRightRect)) |
| 1170 return false; | 1170 return false; |
| 1171 | 1171 |
| 1172 return true; | 1172 return true; |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 void BoxPainter::paintBorder(LayoutBoxModelObject& obj, const PaintInfo& info, c
onst LayoutRect& rect, const ComputedStyle& style, BackgroundBleedAvoidance blee
dAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) | 1175 void BoxPainter::paintBorder(LayoutBoxModelObject& obj, const PaintInfo& info, |
| 1176 const LayoutRect& rect, const ComputedStyle& style, BackgroundBleedAvoidance
bleedAvoidance, |
| 1177 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) |
| 1176 { | 1178 { |
| 1177 BoxBorderPainter().paintBorder(obj, info, rect, style, bleedAvoidance, inclu
deLogicalLeftEdge, includeLogicalRightEdge); | 1179 // border-image is not affected by border-radius. |
| 1180 if (paintNinePieceImage(obj, info.context, rect, style, style.borderImage())
) |
| 1181 return; |
| 1182 |
| 1183 const BoxBorderPainter borderPainter(rect, style, info.rect, bleedAvoidance, |
| 1184 includeLogicalLeftEdge, includeLogicalRightEdge); |
| 1185 borderPainter.paintBorder(info, rect); |
| 1178 } | 1186 } |
| 1179 | 1187 |
| 1180 void BoxPainter::paintBoxShadow(const PaintInfo& info, const LayoutRect& paintRe
ct, const ComputedStyle& style, ShadowStyle shadowStyle, bool includeLogicalLeft
Edge, bool includeLogicalRightEdge) | 1188 void BoxPainter::paintBoxShadow(const PaintInfo& info, const LayoutRect& paintRe
ct, const ComputedStyle& style, ShadowStyle shadowStyle, bool includeLogicalLeft
Edge, bool includeLogicalRightEdge) |
| 1181 { | 1189 { |
| 1182 // FIXME: Deal with border-image. Would be great to use border-image as a ma
sk. | 1190 // FIXME: Deal with border-image. Would be great to use border-image as a ma
sk. |
| 1183 GraphicsContext* context = info.context; | 1191 GraphicsContext* context = info.context; |
| 1184 if (!style.boxShadow()) | 1192 if (!style.boxShadow()) |
| 1185 return; | 1193 return; |
| 1186 FloatRoundedRect border = (shadowStyle == Inset) ? style.getRoundedInnerBord
erFor(paintRect, includeLogicalLeftEdge, includeLogicalRightEdge) | 1194 FloatRoundedRect border = (shadowStyle == Inset) ? style.getRoundedInnerBord
erFor(paintRect, includeLogicalLeftEdge, includeLogicalRightEdge) |
| 1187 : style.getRoundedBorderFor(paintRect, includeLogicalLeftEdge, includeLo
gicalRightEdge); | 1195 : style.getRoundedBorderFor(paintRect, includeLogicalLeftEdge, includeLo
gicalRightEdge); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 else | 1302 else |
| 1295 clippedEdges |= GraphicsContext::BottomEdge; | 1303 clippedEdges |= GraphicsContext::BottomEdge; |
| 1296 } | 1304 } |
| 1297 // TODO: support non-integer shadows - crbug.com/334828 | 1305 // TODO: support non-integer shadows - crbug.com/334828 |
| 1298 context->drawInnerShadow(border, shadowColor, flooredIntSize(shadowO
ffset), shadowBlur, shadowSpread, clippedEdges); | 1306 context->drawInnerShadow(border, shadowColor, flooredIntSize(shadowO
ffset), shadowBlur, shadowSpread, clippedEdges); |
| 1299 } | 1307 } |
| 1300 } | 1308 } |
| 1301 } | 1309 } |
| 1302 | 1310 |
| 1303 } // namespace blink | 1311 } // namespace blink |
| OLD | NEW |