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/BoxPainterBase.h" | 5 #include "core/paint/BoxPainterBase.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/paint/BoxBorderPainter.h" |
| 10 #include "core/paint/NinePieceImagePainter.h" |
9 #include "core/paint/PaintInfo.h" | 11 #include "core/paint/PaintInfo.h" |
10 #include "core/style/BorderEdge.h" | 12 #include "core/style/BorderEdge.h" |
11 #include "core/style/ComputedStyle.h" | 13 #include "core/style/ComputedStyle.h" |
12 #include "core/style/ShadowList.h" | 14 #include "core/style/ShadowList.h" |
13 #include "platform/LengthFunctions.h" | 15 #include "platform/LengthFunctions.h" |
14 #include "platform/geometry/LayoutRect.h" | 16 #include "platform/geometry/LayoutRect.h" |
15 #include "platform/geometry/LayoutRectOutsets.h" | 17 #include "platform/geometry/LayoutRectOutsets.h" |
16 #include "platform/graphics/GraphicsContextStateSaver.h" | 18 #include "platform/graphics/GraphicsContextStateSaver.h" |
17 | 19 |
18 namespace blink { | 20 namespace blink { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 LayoutRect(border.Rect()), border_padding_insets, | 373 LayoutRect(border.Rect()), border_padding_insets, |
372 info.include_left_edge, info.include_right_edge); | 374 info.include_left_edge, info.include_right_edge); |
373 } else if (bg_layer.Clip() == kPaddingFillBox) { | 375 } else if (bg_layer.Clip() == kPaddingFillBox) { |
374 border = style.GetRoundedInnerBorderFor(LayoutRect(border.Rect()), | 376 border = style.GetRoundedInnerBorderFor(LayoutRect(border.Rect()), |
375 info.include_left_edge, | 377 info.include_left_edge, |
376 info.include_right_edge); | 378 info.include_right_edge); |
377 } | 379 } |
378 return border; | 380 return border; |
379 } | 381 } |
380 | 382 |
| 383 void BoxPainterBase::PaintBorder(const ImageResourceObserver& obj, |
| 384 const Document& document, |
| 385 Node* node, |
| 386 const PaintInfo& info, |
| 387 const LayoutRect& rect, |
| 388 const ComputedStyle& style, |
| 389 BackgroundBleedAvoidance bleed_avoidance, |
| 390 bool include_logical_left_edge, |
| 391 bool include_logical_right_edge) { |
| 392 // border-image is not affected by border-radius. |
| 393 if (NinePieceImagePainter::Paint(info.context, obj, document, node, rect, |
| 394 style, style.BorderImage())) { |
| 395 return; |
| 396 } |
| 397 |
| 398 const BoxBorderPainter border_painter(rect, style, bleed_avoidance, |
| 399 include_logical_left_edge, |
| 400 include_logical_right_edge); |
| 401 border_painter.PaintBorder(info, rect); |
| 402 } |
| 403 |
381 } // namespace blink | 404 } // namespace blink |
OLD | NEW |