| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/BoxBorderPainter.h" | 6 #include "core/paint/BoxBorderPainter.h" |
| 7 | 7 |
| 8 #include "core/paint/BoxPainter.h" | 8 #include "core/paint/BoxPainter.h" |
| 9 #include "core/paint/PaintInfo.h" | 9 #include "core/paint/PaintInfo.h" |
| 10 #include "core/style/BorderEdge.h" | 10 #include "core/style/BorderEdge.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 return true; | 412 return true; |
| 413 } | 413 } |
| 414 | 414 |
| 415 // This is faster than the normal complex border path only if it avoids crea
ting transparency | 415 // This is faster than the normal complex border path only if it avoids crea
ting transparency |
| 416 // layers (when the border is translucent). | 416 // layers (when the border is translucent). |
| 417 if (firstEdge().borderStyle() == SOLID && !m_outer.isRounded() && m_hasAlpha
) { | 417 if (firstEdge().borderStyle() == SOLID && !m_outer.isRounded() && m_hasAlpha
) { |
| 418 ASSERT(m_visibleEdgeSet != AllBorderEdges); | 418 ASSERT(m_visibleEdgeSet != AllBorderEdges); |
| 419 // solid, rectangular border => one drawPath() | 419 // solid, rectangular border => one drawPath() |
| 420 Path path; | 420 Path path; |
| 421 path.setWindRule(RULE_NONZERO); |
| 421 | 422 |
| 422 for (int i = BSTop; i <= BSLeft; ++i) { | 423 for (int i = BSTop; i <= BSLeft; ++i) { |
| 423 const BorderEdge& currEdge = m_edges[i]; | 424 const BorderEdge& currEdge = m_edges[i]; |
| 424 if (currEdge.shouldRender()) | 425 if (currEdge.shouldRender()) |
| 425 path.addRect(calculateSideRect(m_outer, currEdge, i)); | 426 path.addRect(calculateSideRect(m_outer, currEdge, i)); |
| 426 } | 427 } |
| 427 | 428 |
| 428 context->setFillRule(RULE_NONZERO); | |
| 429 context->setFillColor(firstEdge().color); | 429 context->setFillColor(firstEdge().color); |
| 430 context->fillPath(path); | 430 context->fillPath(path); |
| 431 | |
| 432 return true; | 431 return true; |
| 433 } | 432 } |
| 434 | 433 |
| 435 return false; | 434 return false; |
| 436 } | 435 } |
| 437 | 436 |
| 438 BoxBorderPainter::BoxBorderPainter(const LayoutRect& borderRect, const ComputedS
tyle& style, | 437 BoxBorderPainter::BoxBorderPainter(const LayoutRect& borderRect, const ComputedS
tyle& style, |
| 439 const IntRect& clipRect, BackgroundBleedAvoidance bleedAvoidance, | 438 const IntRect& clipRect, BackgroundBleedAvoidance bleedAvoidance, |
| 440 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) | 439 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) |
| 441 : m_style(style) | 440 : m_style(style) |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 | 1016 |
| 1018 FloatPoint secondQuad[4]; | 1017 FloatPoint secondQuad[4]; |
| 1019 secondQuad[0] = quad[0]; | 1018 secondQuad[0] = quad[0]; |
| 1020 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); | 1019 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); |
| 1021 secondQuad[2] = quad[2]; | 1020 secondQuad[2] = quad[2]; |
| 1022 secondQuad[3] = quad[3]; | 1021 secondQuad[3] = quad[3]; |
| 1023 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); | 1022 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); |
| 1024 } | 1023 } |
| 1025 | 1024 |
| 1026 } // namespace blink | 1025 } // namespace blink |
| OLD | NEW |