| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 } | 387 } |
| 388 } else { | 388 } else { |
| 389 context->fillRect(pixelSnappedIntRect(rect), bgColor); | 389 context->fillRect(pixelSnappedIntRect(rect), bgColor); |
| 390 } | 390 } |
| 391 | 391 |
| 392 return; | 392 return; |
| 393 } | 393 } |
| 394 | 394 |
| 395 // BorderFillBox radius clipping is taken care of by BackgroundBleedClip{Onl
y,Layer} | 395 // BorderFillBox radius clipping is taken care of by BackgroundBleedClip{Onl
y,Layer} |
| 396 bool clipToBorderRadius = hasRoundedBorder && !(isBorderFill && bleedAvoidan
ceIsClipping(bleedAvoidance)); | 396 bool clipToBorderRadius = hasRoundedBorder && !(isBorderFill && bleedAvoidan
ceIsClipping(bleedAvoidance)); |
| 397 OwnPtr<RoundedInnerRectClipper> clipToBorder; | 397 RoundedInnerRectClipper clipToBorder(obj, paintInfo); |
| 398 if (clipToBorderRadius) { | 398 if (clipToBorderRadius) { |
| 399 FloatRoundedRect border = isBorderFill | 399 FloatRoundedRect border = isBorderFill |
| 400 ? backgroundRoundedRectAdjustedForBleedAvoidance(obj, rect, bleedAvo
idance, box, boxSize, includeLeftEdge, includeRightEdge) | 400 ? backgroundRoundedRectAdjustedForBleedAvoidance(obj, rect, bleedAvo
idance, box, boxSize, includeLeftEdge, includeRightEdge) |
| 401 : getBackgroundRoundedRect(obj, rect, box, boxSize.width(), boxSize.
height(), includeLeftEdge, includeRightEdge); | 401 : getBackgroundRoundedRect(obj, rect, box, boxSize.width(), boxSize.
height(), includeLeftEdge, includeRightEdge); |
| 402 | 402 |
| 403 // Clip to the padding or content boxes as necessary. | 403 // Clip to the padding or content boxes as necessary. |
| 404 if (bgLayer.clip() == ContentFillBox) { | 404 if (bgLayer.clip() == ContentFillBox) { |
| 405 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), | 405 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), |
| 406 LayoutRectOutsets( | 406 LayoutRectOutsets( |
| 407 -(obj.paddingTop() + obj.borderTop()), | 407 -(obj.paddingTop() + obj.borderTop()), |
| 408 -(obj.paddingRight() + obj.borderRight()), | 408 -(obj.paddingRight() + obj.borderRight()), |
| 409 -(obj.paddingBottom() + obj.borderBottom()), | 409 -(obj.paddingBottom() + obj.borderBottom()), |
| 410 -(obj.paddingLeft() + obj.borderLeft())), | 410 -(obj.paddingLeft() + obj.borderLeft())), |
| 411 includeLeftEdge, includeRightEdge); | 411 includeLeftEdge, includeRightEdge); |
| 412 } else if (bgLayer.clip() == PaddingFillBox) { | 412 } else if (bgLayer.clip() == PaddingFillBox) { |
| 413 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), includeLeftEdge, includeRightEdge); | 413 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), includeLeftEdge, includeRightEdge); |
| 414 } | 414 } |
| 415 | 415 |
| 416 clipToBorder = adoptPtr(new RoundedInnerRectClipper(obj, paintInfo, rect
, border, ApplyToContext)); | 416 clipToBorder.begin(rect, border, ApplyToContext); |
| 417 } | 417 } |
| 418 | 418 |
| 419 int bLeft = includeLeftEdge ? obj.borderLeft() : 0; | 419 int bLeft = includeLeftEdge ? obj.borderLeft() : 0; |
| 420 int bRight = includeRightEdge ? obj.borderRight() : 0; | 420 int bRight = includeRightEdge ? obj.borderRight() : 0; |
| 421 LayoutUnit pLeft = includeLeftEdge ? obj.paddingLeft() : LayoutUnit(); | 421 LayoutUnit pLeft = includeLeftEdge ? obj.paddingLeft() : LayoutUnit(); |
| 422 LayoutUnit pRight = includeRightEdge ? obj.paddingRight() : LayoutUnit(); | 422 LayoutUnit pRight = includeRightEdge ? obj.paddingRight() : LayoutUnit(); |
| 423 | 423 |
| 424 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithL
ocalScrolling); | 424 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithL
ocalScrolling); |
| 425 LayoutRect scrolledPaintRect = rect; | 425 LayoutRect scrolledPaintRect = rect; |
| 426 if (clippedWithLocalScrolling) { | 426 if (clippedWithLocalScrolling) { |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2298 | 2298 |
| 2299 FloatPoint secondQuad[4]; | 2299 FloatPoint secondQuad[4]; |
| 2300 secondQuad[0] = quad[0]; | 2300 secondQuad[0] = quad[0]; |
| 2301 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); | 2301 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); |
| 2302 secondQuad[2] = quad[2]; | 2302 secondQuad[2] = quad[2]; |
| 2303 secondQuad[3] = quad[3]; | 2303 secondQuad[3] = quad[3]; |
| 2304 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); | 2304 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 } // namespace blink | 2307 } // namespace blink |
| OLD | NEW |