| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 if (globalPaintFlags & GlobalPaintFlattenCompositingLayers) { | 429 if (globalPaintFlags & GlobalPaintFlattenCompositingLayers) { |
| 430 TransformationMatrix matrix = *m_transform; | 430 TransformationMatrix matrix = *m_transform; |
| 431 makeMatrixRenderable(matrix, false /* flatten 3d */); | 431 makeMatrixRenderable(matrix, false /* flatten 3d */); |
| 432 return matrix; | 432 return matrix; |
| 433 } | 433 } |
| 434 | 434 |
| 435 return *m_transform; | 435 return *m_transform; |
| 436 } | 436 } |
| 437 | 437 |
| 438 // Convert a bounding box from flow thread coordinates, relative to |layer|, to
visual coordinates, relative to |ancestorLayer|. | 438 void PaintLayer::convertFromFlowThreadToVisualBoundingBoxInAncestor(const PaintL
ayer* ancestorLayer, LayoutRect& rect) const |
| 439 // See http://www.chromium.org/developers/design-documents/multi-column-layout f
or more info on these coordinate types. | |
| 440 static void convertFromFlowThreadToVisualBoundingBoxInAncestor(const PaintLayer*
layer, const PaintLayer* ancestorLayer, LayoutRect& rect) | |
| 441 { | 439 { |
| 442 PaintLayer* paginationLayer = layer->enclosingPaginationLayer(); | 440 PaintLayer* paginationLayer = enclosingPaginationLayer(); |
| 443 ASSERT(paginationLayer); | 441 ASSERT(paginationLayer); |
| 444 LayoutFlowThread* flowThread = toLayoutFlowThread(paginationLayer->layoutObj
ect()); | 442 LayoutFlowThread* flowThread = toLayoutFlowThread(paginationLayer->layoutObj
ect()); |
| 445 | 443 |
| 446 // First make the flow thread rectangle relative to the flow thread, not to
|layer|. | 444 // First make the flow thread rectangle relative to the flow thread, not to
|layer|. |
| 447 LayoutPoint offsetWithinPaginationLayer; | 445 LayoutPoint offsetWithinPaginationLayer; |
| 448 layer->convertToLayerCoords(paginationLayer, offsetWithinPaginationLayer); | 446 convertToLayerCoords(paginationLayer, offsetWithinPaginationLayer); |
| 449 rect.moveBy(offsetWithinPaginationLayer); | 447 rect.moveBy(offsetWithinPaginationLayer); |
| 450 | 448 |
| 451 // Then make the rectangle visual, relative to the fragmentation context. Sp
lit our box up into | 449 // Then make the rectangle visual, relative to the fragmentation context. Sp
lit our box up into |
| 452 // the actual fragment boxes that layout in the columns/pages and unite thos
e together to get | 450 // the actual fragment boxes that layout in the columns/pages and unite thos
e together to get |
| 453 // our true bounding box. | 451 // our true bounding box. |
| 454 rect = flowThread->fragmentsBoundingBox(rect); | 452 rect = flowThread->fragmentsBoundingBox(rect); |
| 455 | 453 |
| 456 // Finally, make the visual rectangle relative to |ancestorLayer|. | 454 // Finally, make the visual rectangle relative to |ancestorLayer|. |
| 457 if (ancestorLayer->enclosingPaginationLayer() != paginationLayer) { | 455 if (ancestorLayer->enclosingPaginationLayer() != paginationLayer) { |
| 458 rect.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer)); | 456 rect.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer)); |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 result.moveBy(offsetFromRoot); | 2145 result.moveBy(offsetFromRoot); |
| 2148 return result; | 2146 return result; |
| 2149 } | 2147 } |
| 2150 | 2148 |
| 2151 LayoutRect PaintLayer::fragmentsBoundingBox(const PaintLayer* ancestorLayer) con
st | 2149 LayoutRect PaintLayer::fragmentsBoundingBox(const PaintLayer* ancestorLayer) con
st |
| 2152 { | 2150 { |
| 2153 if (!enclosingPaginationLayer()) | 2151 if (!enclosingPaginationLayer()) |
| 2154 return physicalBoundingBox(ancestorLayer); | 2152 return physicalBoundingBox(ancestorLayer); |
| 2155 | 2153 |
| 2156 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutOb
ject()); | 2154 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutOb
ject()); |
| 2157 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, resu
lt); | 2155 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result); |
| 2158 return result; | 2156 return result; |
| 2159 } | 2157 } |
| 2160 | 2158 |
| 2161 LayoutRect PaintLayer::boundingBoxForCompositingOverlapTest() const | 2159 LayoutRect PaintLayer::boundingBoxForCompositingOverlapTest() const |
| 2162 { | 2160 { |
| 2163 // Apply NeverIncludeTransformForAncestorLayer, because the geometry map in
CompositingInputsUpdater will take care of applying the | 2161 // Apply NeverIncludeTransformForAncestorLayer, because the geometry map in
CompositingInputsUpdater will take care of applying the |
| 2164 // transform of |this| (== the ancestorLayer argument to boundingBoxForCompo
siting). | 2162 // transform of |this| (== the ancestorLayer argument to boundingBoxForCompo
siting). |
| 2165 return overlapBoundsIncludeChildren() ? boundingBoxForCompositing(this, Neve
rIncludeTransformForAncestorLayer) : fragmentsBoundingBox(this); | 2163 return overlapBoundsIncludeChildren() ? boundingBoxForCompositing(this, Neve
rIncludeTransformForAncestorLayer) : fragmentsBoundingBox(this); |
| 2166 } | 2164 } |
| 2167 | 2165 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2247 // Accelerated filters will handle their own outsets. | 2245 // Accelerated filters will handle their own outsets. |
| 2248 if (paintsWithFilters()) { | 2246 if (paintsWithFilters()) { |
| 2249 result.expand(filterOutsets()); | 2247 result.expand(filterOutsets()); |
| 2250 } | 2248 } |
| 2251 } | 2249 } |
| 2252 | 2250 |
| 2253 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a
ncestorLayer || options == MaybeIncludeTransformForAncestorLayer)) | 2251 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a
ncestorLayer || options == MaybeIncludeTransformForAncestorLayer)) |
| 2254 result = transform()->mapRect(result); | 2252 result = transform()->mapRect(result); |
| 2255 | 2253 |
| 2256 if (enclosingPaginationLayer()) { | 2254 if (enclosingPaginationLayer()) { |
| 2257 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer,
result); | 2255 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result
); |
| 2258 return result; | 2256 return result; |
| 2259 } | 2257 } |
| 2260 LayoutPoint delta; | 2258 LayoutPoint delta; |
| 2261 convertToLayerCoords(ancestorLayer, delta); | 2259 convertToLayerCoords(ancestorLayer, delta); |
| 2262 result.moveBy(delta); | 2260 result.moveBy(delta); |
| 2263 return result; | 2261 return result; |
| 2264 } | 2262 } |
| 2265 | 2263 |
| 2266 CompositingState PaintLayer::compositingState() const | 2264 CompositingState PaintLayer::compositingState() const |
| 2267 { | 2265 { |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2831 | 2829 |
| 2832 void showLayerTree(const blink::LayoutObject* layoutObject) | 2830 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2833 { | 2831 { |
| 2834 if (!layoutObject) { | 2832 if (!layoutObject) { |
| 2835 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2833 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2836 return; | 2834 return; |
| 2837 } | 2835 } |
| 2838 showLayerTree(layoutObject->enclosingLayer()); | 2836 showLayerTree(layoutObject->enclosingLayer()); |
| 2839 } | 2837 } |
| 2840 #endif | 2838 #endif |
| OLD | NEW |