| 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/BoxPainter.h" | 5 #include "core/paint/BoxPainter.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "core/layout/ImageQualityController.h" | 10 #include "core/layout/ImageQualityController.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // TODO(fmalita): we should be able to fold these parameters into | 309 // TODO(fmalita): we should be able to fold these parameters into |
| 310 // BoxBorderInfo or BoxDecorationData and avoid calling getBorderEdgeInfo | 310 // BoxBorderInfo or BoxDecorationData and avoid calling getBorderEdgeInfo |
| 311 // redundantly here. | 311 // redundantly here. |
| 312 BorderEdge edges[4]; | 312 BorderEdge edges[4]; |
| 313 style.GetBorderEdgeInfo(edges, include_logical_left_edge, | 313 style.GetBorderEdgeInfo(edges, include_logical_left_edge, |
| 314 include_logical_right_edge); | 314 include_logical_right_edge); |
| 315 | 315 |
| 316 // Use the most conservative inset to avoid mixed-style corner issues. | 316 // Use the most conservative inset to avoid mixed-style corner issues. |
| 317 float fractional_inset = 1.0f / 2; | 317 float fractional_inset = 1.0f / 2; |
| 318 for (auto& edge : edges) { | 318 for (auto& edge : edges) { |
| 319 if (edge.BorderStyle() == kBorderStyleDouble) { | 319 if (edge.BorderStyle() == EBorderStyle::kDouble) { |
| 320 fractional_inset = 1.0f / 6; | 320 fractional_inset = 1.0f / 6; |
| 321 break; | 321 break; |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 FloatRectOutsets insets(-fractional_inset * edges[kBSTop].Width(), | 325 FloatRectOutsets insets(-fractional_inset * edges[kBSTop].Width(), |
| 326 -fractional_inset * edges[kBSRight].Width(), | 326 -fractional_inset * edges[kBSRight].Width(), |
| 327 -fractional_inset * edges[kBSBottom].Width(), | 327 -fractional_inset * edges[kBSBottom].Width(), |
| 328 -fractional_inset * edges[kBSLeft].Width()); | 328 -fractional_inset * edges[kBSLeft].Width()); |
| 329 | 329 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 if (PaintNinePieceImage(obj, info.context, rect, style, style.BorderImage())) | 871 if (PaintNinePieceImage(obj, info.context, rect, style, style.BorderImage())) |
| 872 return; | 872 return; |
| 873 | 873 |
| 874 const BoxBorderPainter border_painter(rect, style, bleed_avoidance, | 874 const BoxBorderPainter border_painter(rect, style, bleed_avoidance, |
| 875 include_logical_left_edge, | 875 include_logical_left_edge, |
| 876 include_logical_right_edge); | 876 include_logical_right_edge); |
| 877 border_painter.PaintBorder(info, rect); | 877 border_painter.PaintBorder(info, rect); |
| 878 } | 878 } |
| 879 | 879 |
| 880 } // namespace blink | 880 } // namespace blink |
| OLD | NEW |