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 if (layer->transform()) | 1169 transform = transform * *layer->transform(); |
1170 transform = transform * *layer->transform(); | |
1171 | 1170 |
1172 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always | 1171 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always |
1173 // paints unfragmented. | 1172 // paints unfragmented. |
1174 LayoutRect clipRect = layer->physicalBoundingBox(layer); | 1173 LayoutRect clipRect = layer->physicalBoundingBox(layer); |
1175 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transp
arencyBehavior, subPixelAccumulation, paintBehavior); | 1174 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transp
arencyBehavior, subPixelAccumulation, paintBehavior); |
1176 clipRect.expand(layer->layoutObject()->style()->filterOutsets()); | 1175 clipRect.expand(layer->layoutObject()->style()->filterOutsets()); |
1177 LayoutRect result = transform.mapRect(clipRect); | 1176 LayoutRect result = transform.mapRect(clipRect); |
1178 if (!paginationLayer) | 1177 if (!paginationLayer) |
1179 return result; | 1178 return result; |
1180 | 1179 |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2475 expandRectForReflectionAndStackingChildren(parent(), options, result
); | 2474 expandRectForReflectionAndStackingChildren(parent(), options, result
); |
2476 else | 2475 else |
2477 expandRectForReflectionAndStackingChildren(this, options, result); | 2476 expandRectForReflectionAndStackingChildren(this, options, result); |
2478 | 2477 |
2479 // FIXME: We can optimize the size of the composited layers, by not enla
rging | 2478 // FIXME: We can optimize the size of the composited layers, by not enla
rging |
2480 // filtered areas with the outsets if we know that the filter is going t
o render in hardware. | 2479 // filtered areas with the outsets if we know that the filter is going t
o render in hardware. |
2481 // https://bugs.webkit.org/show_bug.cgi?id=81239 | 2480 // https://bugs.webkit.org/show_bug.cgi?id=81239 |
2482 result.expand(m_layoutObject->style()->filterOutsets()); | 2481 result.expand(m_layoutObject->style()->filterOutsets()); |
2483 } | 2482 } |
2484 | 2483 |
2485 if (transform() && (paintsWithTransform(PaintBehaviorNormal) || options == A
pplyBoundsChickenEggHacks)) | 2484 if (paintsWithTransform(PaintBehaviorNormal) || (options == ApplyBoundsChick
enEggHacks && transform())) |
2486 result = transform()->mapRect(result); | 2485 result = transform()->mapRect(result); |
2487 | 2486 |
2488 if (enclosingPaginationLayer()) { | 2487 if (enclosingPaginationLayer()) { |
2489 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer,
result); | 2488 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer,
result); |
2490 return result; | 2489 return result; |
2491 } | 2490 } |
2492 LayoutPoint delta; | 2491 LayoutPoint delta; |
2493 convertToLayerCoords(ancestorLayer, delta); | 2492 convertToLayerCoords(ancestorLayer, delta); |
2494 result.moveBy(delta); | 2493 result.moveBy(delta); |
2495 return result; | 2494 return result; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasMaskLayer(); | 2596 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasMaskLayer(); |
2598 } | 2597 } |
2599 | 2598 |
2600 bool DeprecatedPaintLayer::hasCompositedClippingMask() const | 2599 bool DeprecatedPaintLayer::hasCompositedClippingMask() const |
2601 { | 2600 { |
2602 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasChildClippingMaskLayer(); | 2601 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain
tLayerMapping->hasChildClippingMaskLayer(); |
2603 } | 2602 } |
2604 | 2603 |
2605 bool DeprecatedPaintLayer::paintsWithTransform(PaintBehavior paintBehavior) cons
t | 2604 bool DeprecatedPaintLayer::paintsWithTransform(PaintBehavior paintBehavior) cons
t |
2606 { | 2605 { |
2607 return (transform() || layoutObject()->style()->position() == FixedPosition)
&& ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || compositingState
() != PaintsIntoOwnBacking); | 2606 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer
s) || compositingState() != PaintsIntoOwnBacking); |
2608 } | 2607 } |
2609 | 2608 |
2610 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l
ocalRect) const | 2609 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l
ocalRect) const |
2611 { | 2610 { |
2612 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 2611 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
2613 return false; | 2612 return false; |
2614 | 2613 |
2615 if (paintsWithTransparency(PaintBehaviorNormal)) | 2614 if (paintsWithTransparency(PaintBehaviorNormal)) |
2616 return false; | 2615 return false; |
2617 | 2616 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 } | 2970 } |
2972 } | 2971 } |
2973 | 2972 |
2974 void showLayerTree(const blink::LayoutObject* layoutObject) | 2973 void showLayerTree(const blink::LayoutObject* layoutObject) |
2975 { | 2974 { |
2976 if (!layoutObject) | 2975 if (!layoutObject) |
2977 return; | 2976 return; |
2978 showLayerTree(layoutObject->enclosingLayer()); | 2977 showLayerTree(layoutObject->enclosingLayer()); |
2979 } | 2978 } |
2980 #endif | 2979 #endif |
OLD | NEW |