OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 LayoutPoint adjustedLayerOffset = layerOffset + locationOffset(); | 605 LayoutPoint adjustedLayerOffset = layerOffset + locationOffset(); |
606 RenderBoxModelObject::addLayerHitTestRects(layerRects, currentLayer, adjuste
dLayerOffset, containerRect); | 606 RenderBoxModelObject::addLayerHitTestRects(layerRects, currentLayer, adjuste
dLayerOffset, containerRect); |
607 } | 607 } |
608 | 608 |
609 void RenderBox::computeSelfHitTestRects(Vector<LayoutRect>& rects, const LayoutP
oint& layerOffset) const | 609 void RenderBox::computeSelfHitTestRects(Vector<LayoutRect>& rects, const LayoutP
oint& layerOffset) const |
610 { | 610 { |
611 if (!size().isEmpty()) | 611 if (!size().isEmpty()) |
612 rects.append(LayoutRect(layerOffset, size())); | 612 rects.append(LayoutRect(layerOffset, size())); |
613 } | 613 } |
614 | 614 |
615 LayoutRect RenderBox::reflectionBox() const | |
616 { | |
617 LayoutRect result; | |
618 if (!style()->boxReflect()) | |
619 return result; | |
620 LayoutRect box = borderBoxRect(); | |
621 result = box; | |
622 switch (style()->boxReflect()->direction()) { | |
623 case ReflectionBelow: | |
624 result.move(0, box.height() + reflectionOffset()); | |
625 break; | |
626 case ReflectionAbove: | |
627 result.move(0, -box.height() - reflectionOffset()); | |
628 break; | |
629 case ReflectionLeft: | |
630 result.move(-box.width() - reflectionOffset(), 0); | |
631 break; | |
632 case ReflectionRight: | |
633 result.move(box.width() + reflectionOffset(), 0); | |
634 break; | |
635 } | |
636 return result; | |
637 } | |
638 | |
639 int RenderBox::reflectionOffset() const | 615 int RenderBox::reflectionOffset() const |
640 { | 616 { |
641 if (!style()->boxReflect()) | 617 if (!style()->boxReflect()) |
642 return 0; | 618 return 0; |
643 if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxRefl
ect()->direction() == ReflectionRight) | 619 if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxRefl
ect()->direction() == ReflectionRight) |
644 return valueForLength(style()->boxReflect()->offset(), borderBoxRect().w
idth()); | 620 return valueForLength(style()->boxReflect()->offset(), borderBoxRect().w
idth()); |
645 return valueForLength(style()->boxReflect()->offset(), borderBoxRect().heigh
t()); | 621 return valueForLength(style()->boxReflect()->offset(), borderBoxRect().heigh
t()); |
646 } | 622 } |
647 | 623 |
648 LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const | 624 LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 | 1431 |
1456 if (allMaskImagesLoaded) { | 1432 if (allMaskImagesLoaded) { |
1457 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), pa
intRect, BackgroundBleedNone, compositeOp); | 1433 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), pa
intRect, BackgroundBleedNone, compositeOp); |
1458 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->mask
BoxImage(), compositeOp); | 1434 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->mask
BoxImage(), compositeOp); |
1459 } | 1435 } |
1460 | 1436 |
1461 if (pushTransparencyLayer) | 1437 if (pushTransparencyLayer) |
1462 paintInfo.context->endLayer(); | 1438 paintInfo.context->endLayer(); |
1463 } | 1439 } |
1464 | 1440 |
1465 LayoutRect RenderBox::maskClipRect() | |
1466 { | |
1467 const NinePieceImage& maskBoxImage = style()->maskBoxImage(); | |
1468 if (maskBoxImage.image()) { | |
1469 LayoutRect borderImageRect = borderBoxRect(); | |
1470 | |
1471 // Apply outsets to the border box. | |
1472 borderImageRect.expand(style()->maskBoxImageOutsets()); | |
1473 return borderImageRect; | |
1474 } | |
1475 | |
1476 LayoutRect result; | |
1477 LayoutRect borderBox = borderBoxRect(); | |
1478 for (const FillLayer* maskLayer = style()->maskLayers(); maskLayer; maskLaye
r = maskLayer->next()) { | |
1479 if (maskLayer->image()) { | |
1480 BackgroundImageGeometry geometry; | |
1481 // Masks should never have fixed attachment, so it's OK for paintCon
tainer to be null. | |
1482 calculateBackgroundImageGeometry(0, maskLayer, borderBox, geometry); | |
1483 result.unite(geometry.destRect()); | |
1484 } | |
1485 } | |
1486 return result; | |
1487 } | |
1488 | |
1489 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons
t FillLayer* fillLayer, const LayoutRect& rect, | 1441 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons
t FillLayer* fillLayer, const LayoutRect& rect, |
1490 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject*
backgroundObject) | 1442 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject*
backgroundObject) |
1491 { | 1443 { |
1492 Vector<const FillLayer*, 8> layers; | 1444 Vector<const FillLayer*, 8> layers; |
1493 const FillLayer* curLayer = fillLayer; | 1445 const FillLayer* curLayer = fillLayer; |
1494 bool shouldDrawBackgroundInSeparateBuffer = false; | 1446 bool shouldDrawBackgroundInSeparateBuffer = false; |
1495 while (curLayer) { | 1447 while (curLayer) { |
1496 layers.append(curLayer); | 1448 layers.append(curLayer); |
1497 // Stop traversal when an opaque layer is encountered. | 1449 // Stop traversal when an opaque layer is encountered. |
1498 // FIXME : It would be possible for the following occlusion culling test
to be more aggressive | 1450 // FIXME : It would be possible for the following occlusion culling test
to be more aggressive |
(...skipping 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4738 return 0; | 4690 return 0; |
4739 | 4691 |
4740 if (!layoutState && !flowThreadContainingBlock()) | 4692 if (!layoutState && !flowThreadContainingBlock()) |
4741 return 0; | 4693 return 0; |
4742 | 4694 |
4743 RenderBlock* containerBlock = containingBlock(); | 4695 RenderBlock* containerBlock = containingBlock(); |
4744 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4696 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4745 } | 4697 } |
4746 | 4698 |
4747 } // namespace WebCore | 4699 } // namespace WebCore |
OLD | NEW |