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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
929 return FloatPoint(); | 929 return FloatPoint(); |
930 | 930 |
931 const LayoutRect borderBox = toLayoutBox(layoutObject())->borderBoxRect(); | 931 const LayoutRect borderBox = toLayoutBox(layoutObject())->borderBoxRect(); |
932 const ComputedStyle& style = layoutObject()->styleRef(); | 932 const ComputedStyle& style = layoutObject()->styleRef(); |
933 | 933 |
934 return FloatPoint(floatValueForLength(style.perspectiveOriginX(), borderBox. width().toFloat()), floatValueForLength(style.perspectiveOriginY(), borderBox.he ight().toFloat())); | 934 return FloatPoint(floatValueForLength(style.perspectiveOriginX(), borderBox. width().toFloat()), floatValueForLength(style.perspectiveOriginY(), borderBox.he ight().toFloat())); |
935 } | 935 } |
936 | 936 |
937 static inline bool isFixedPositionedContainer(DeprecatedPaintLayer* layer) | 937 static inline bool isFixedPositionedContainer(DeprecatedPaintLayer* layer) |
938 { | 938 { |
939 return layer->isRootLayer() || layer->hasTransformRelatedProperty(); | 939 return layer->isRootLayer() || layer->transform(); |
chrishtr
2015/04/30 17:34:59
This should be landed first I think, probably with
Xianzhu
2015/04/30 17:54:44
If we want change this, we should also check other
| |
940 } | 940 } |
941 | 941 |
942 DeprecatedPaintLayer* DeprecatedPaintLayer::enclosingPositionedAncestor() const | 942 DeprecatedPaintLayer* DeprecatedPaintLayer::enclosingPositionedAncestor() const |
943 { | 943 { |
944 if (layoutObject()->style()->position() == FixedPosition) { | 944 if (layoutObject()->style()->position() == FixedPosition) { |
945 DeprecatedPaintLayer* curr = parent(); | 945 DeprecatedPaintLayer* curr = parent(); |
946 while (curr && !isFixedPositionedContainer(curr)) | 946 while (curr && !isFixedPositionedContainer(curr)) |
947 curr = curr->parent(); | 947 curr = curr->parent(); |
948 | 948 |
949 return curr; | 949 return curr; |
(...skipping 209 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 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2474 expandRectForReflectionAndStackingChildren(parent(), options, result ); | 2475 expandRectForReflectionAndStackingChildren(parent(), options, result ); |
2475 else | 2476 else |
2476 expandRectForReflectionAndStackingChildren(this, options, result); | 2477 expandRectForReflectionAndStackingChildren(this, options, result); |
2477 | 2478 |
2478 // FIXME: We can optimize the size of the composited layers, by not enla rging | 2479 // FIXME: We can optimize the size of the composited layers, by not enla rging |
2479 // filtered areas with the outsets if we know that the filter is going t o render in hardware. | 2480 // filtered areas with the outsets if we know that the filter is going t o render in hardware. |
2480 // https://bugs.webkit.org/show_bug.cgi?id=81239 | 2481 // https://bugs.webkit.org/show_bug.cgi?id=81239 |
2481 result.expand(m_layoutObject->style()->filterOutsets()); | 2482 result.expand(m_layoutObject->style()->filterOutsets()); |
2482 } | 2483 } |
2483 | 2484 |
2484 if (paintsWithTransform(PaintBehaviorNormal) || (options == ApplyBoundsChick enEggHacks && transform())) | 2485 if (transform() && (paintsWithTransform(PaintBehaviorNormal) || options == A pplyBoundsChickenEggHacks)) |
2485 result = transform()->mapRect(result); | 2486 result = transform()->mapRect(result); |
2486 | 2487 |
2487 if (enclosingPaginationLayer()) { | 2488 if (enclosingPaginationLayer()) { |
2488 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, result); | 2489 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, result); |
2489 return result; | 2490 return result; |
2490 } | 2491 } |
2491 LayoutPoint delta; | 2492 LayoutPoint delta; |
2492 convertToLayerCoords(ancestorLayer, delta); | 2493 convertToLayerCoords(ancestorLayer, delta); |
2493 result.moveBy(delta); | 2494 result.moveBy(delta); |
2494 return result; | 2495 return result; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2596 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasMaskLayer(); | 2597 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasMaskLayer(); |
2597 } | 2598 } |
2598 | 2599 |
2599 bool DeprecatedPaintLayer::hasCompositedClippingMask() const | 2600 bool DeprecatedPaintLayer::hasCompositedClippingMask() const |
2600 { | 2601 { |
2601 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasChildClippingMaskLayer(); | 2602 return m_compositedDeprecatedPaintLayerMapping && m_compositedDeprecatedPain tLayerMapping->hasChildClippingMaskLayer(); |
2602 } | 2603 } |
2603 | 2604 |
2604 bool DeprecatedPaintLayer::paintsWithTransform(PaintBehavior paintBehavior) cons t | 2605 bool DeprecatedPaintLayer::paintsWithTransform(PaintBehavior paintBehavior) cons t |
2605 { | 2606 { |
2606 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer s) || compositingState() != PaintsIntoOwnBacking); | 2607 return (transform() || layoutObject()->style()->position() == FixedPosition) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || compositingState () != PaintsIntoOwnBacking); |
2607 } | 2608 } |
2608 | 2609 |
2609 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l ocalRect) const | 2610 bool DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& l ocalRect) const |
2610 { | 2611 { |
2611 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 2612 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
2612 return false; | 2613 return false; |
2613 | 2614 |
2614 if (paintsWithTransparency(PaintBehaviorNormal)) | 2615 if (paintsWithTransparency(PaintBehaviorNormal)) |
2615 return false; | 2616 return false; |
2616 | 2617 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2970 } | 2971 } |
2971 } | 2972 } |
2972 | 2973 |
2973 void showLayerTree(const blink::LayoutObject* layoutObject) | 2974 void showLayerTree(const blink::LayoutObject* layoutObject) |
2974 { | 2975 { |
2975 if (!layoutObject) | 2976 if (!layoutObject) |
2976 return; | 2977 return; |
2977 showLayerTree(layoutObject->enclosingLayer()); | 2978 showLayerTree(layoutObject->enclosingLayer()); |
2978 } | 2979 } |
2979 #endif | 2980 #endif |
OLD | NEW |