OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 // the transformed layer and all of its children. | 1159 // the transformed layer and all of its children. |
1160 const DeprecatedPaintLayer* paginationLayer = transparencyMode == Descen
dantsOfTransparencyClipBox ? layer->enclosingPaginationLayer() : 0; | 1160 const DeprecatedPaintLayer* paginationLayer = transparencyMode == Descen
dantsOfTransparencyClipBox ? layer->enclosingPaginationLayer() : 0; |
1161 const DeprecatedPaintLayer* rootLayerForTransform = paginationLayer ? pa
ginationLayer : rootLayer; | 1161 const DeprecatedPaintLayer* rootLayerForTransform = paginationLayer ? pa
ginationLayer : rootLayer; |
1162 LayoutPoint delta; | 1162 LayoutPoint delta; |
1163 layer->convertToLayerCoords(rootLayerForTransform, delta); | 1163 layer->convertToLayerCoords(rootLayerForTransform, delta); |
1164 | 1164 |
1165 delta.move(subPixelAccumulation); | 1165 delta.move(subPixelAccumulation); |
1166 IntPoint pixelSnappedDelta = roundedIntPoint(delta); | 1166 IntPoint pixelSnappedDelta = roundedIntPoint(delta); |
1167 TransformationMatrix transform; | 1167 TransformationMatrix transform; |
1168 transform.translate(pixelSnappedDelta.x(), pixelSnappedDelta.y()); | 1168 transform.translate(pixelSnappedDelta.x(), pixelSnappedDelta.y()); |
1169 transform = transform * *layer->transform(); | 1169 if (layer->transform()) |
| 1170 transform = transform * *layer->transform(); |
1170 | 1171 |
1171 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always | 1172 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always |
1172 // paints unfragmented. | 1173 // paints unfragmented. |
1173 LayoutRect clipRect = layer->physicalBoundingBox(layer); | 1174 LayoutRect clipRect = layer->physicalBoundingBox(layer); |
1174 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transp
arencyBehavior, subPixelAccumulation, paintBehavior); | 1175 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transp
arencyBehavior, subPixelAccumulation, paintBehavior); |
1175 clipRect.expand(layer->layoutObject()->style()->filterOutsets()); | 1176 clipRect.expand(layer->layoutObject()->style()->filterOutsets()); |
1176 LayoutRect result = transform.mapRect(clipRect); | 1177 LayoutRect result = transform.mapRect(clipRect); |
1177 if (!paginationLayer) | 1178 if (!paginationLayer) |
1178 return result; | 1179 return result; |
1179 | 1180 |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 expandRectForReflectionAndStackingChildren(parent(), options, result
); | 2482 expandRectForReflectionAndStackingChildren(parent(), options, result
); |
2482 else | 2483 else |
2483 expandRectForReflectionAndStackingChildren(this, options, result); | 2484 expandRectForReflectionAndStackingChildren(this, options, result); |
2484 | 2485 |
2485 // FIXME: We can optimize the size of the composited layers, by not enla
rging | 2486 // FIXME: We can optimize the size of the composited layers, by not enla
rging |
2486 // filtered areas with the outsets if we know that the filter is going t
o render in hardware. | 2487 // filtered areas with the outsets if we know that the filter is going t
o render in hardware. |
2487 // https://bugs.webkit.org/show_bug.cgi?id=81239 | 2488 // https://bugs.webkit.org/show_bug.cgi?id=81239 |
2488 result.expand(m_layoutObject->style()->filterOutsets()); | 2489 result.expand(m_layoutObject->style()->filterOutsets()); |
2489 } | 2490 } |
2490 | 2491 |
2491 if (paintsWithTransform(PaintBehaviorNormal) || (options == ApplyBoundsChick
enEggHacks && transform())) | 2492 if (transform() && (paintsWithTransform(PaintBehaviorNormal) || options == A
pplyBoundsChickenEggHacks)) |
2492 result = transform()->mapRect(result); | 2493 result = transform()->mapRect(result); |
2493 | 2494 |
2494 if (enclosingPaginationLayer()) { | 2495 if (enclosingPaginationLayer()) { |
2495 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer,
result); | 2496 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer,
result); |
2496 return result; | 2497 return result; |
2497 } | 2498 } |
2498 LayoutPoint delta; | 2499 LayoutPoint delta; |
2499 convertToLayerCoords(ancestorLayer, delta); | 2500 convertToLayerCoords(ancestorLayer, delta); |
2500 result.moveBy(delta); | 2501 result.moveBy(delta); |
2501 return result; | 2502 return result; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasMaskLayer(); | 2604 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasMaskLayer(); |
2604 } | 2605 } |
2605 | 2606 |
2606 bool DeprecatedPaintLayer::hasCompositedClippingMask() const | 2607 bool DeprecatedPaintLayer::hasCompositedClippingMask() const |
2607 { | 2608 { |
2608 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasChildClippingMaskLayer(); | 2609 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasChildClippingMaskLayer(); |
2609 } | 2610 } |
2610 | 2611 |
2611 bool DeprecatedPaintLayer::paintsWithTransform(PaintBehavior paintBehavior) cons
t | 2612 bool DeprecatedPaintLayer::paintsWithTransform(PaintBehavior paintBehavior) cons
t |
2612 { | 2613 { |
2613 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer
s) || compositingState() != PaintsIntoOwnBacking); | 2614 return (transform() || layoutObject()->style()->position() == FixedPosition)
&& ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || compositingState
() != PaintsIntoOwnBacking); |
2614 } | 2615 } |
2615 | 2616 |
2616 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l
ocalRect) const | 2617 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l
ocalRect) const |
2617 { | 2618 { |
2618 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 2619 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
2619 return false; | 2620 return false; |
2620 | 2621 |
2621 if (paintsWithTransparency(PaintBehaviorNormal)) | 2622 if (paintsWithTransparency(PaintBehaviorNormal)) |
2622 return false; | 2623 return false; |
2623 | 2624 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2977 } | 2978 } |
2978 } | 2979 } |
2979 | 2980 |
2980 void showLayerTree(const blink::LayoutObject* layoutObject) | 2981 void showLayerTree(const blink::LayoutObject* layoutObject) |
2981 { | 2982 { |
2982 if (!layoutObject) | 2983 if (!layoutObject) |
2983 return; | 2984 return; |
2984 showLayerTree(layoutObject->enclosingLayer()); | 2985 showLayerTree(layoutObject->enclosingLayer()); |
2985 } | 2986 } |
2986 #endif | 2987 #endif |
OLD | NEW |