| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 } | 1407 } |
| 1408 | 1408 |
| 1409 enum ApplyToGraphicsLayersModeFlags { | 1409 enum ApplyToGraphicsLayersModeFlags { |
| 1410 ApplyToLayersAffectedByPreserve3D = (1 << 0), | 1410 ApplyToLayersAffectedByPreserve3D = (1 << 0), |
| 1411 ApplyToSquashingLayer = (1 << 1), | 1411 ApplyToSquashingLayer = (1 << 1), |
| 1412 ApplyToScrollbarLayers = (1 << 2), | 1412 ApplyToScrollbarLayers = (1 << 2), |
| 1413 ApplyToBackgroundLayer = (1 << 3), | 1413 ApplyToBackgroundLayer = (1 << 3), |
| 1414 ApplyToMaskLayers = (1 << 4), | 1414 ApplyToMaskLayers = (1 << 4), |
| 1415 ApplyToContentLayers = (1 << 5), | 1415 ApplyToContentLayers = (1 << 5), |
| 1416 ApplyToChildContainingLayers = (1 << 6), // layers between m_graphicsLayer a
nd children | 1416 ApplyToChildContainingLayers = (1 << 6), // layers between m_graphicsLayer a
nd children |
| 1417 ApplyToScrollingContentsLayer = (1 << 7), | |
| 1418 ApplyToAllGraphicsLayers = (ApplyToSquashingLayer | ApplyToScrollbarLayers |
ApplyToBackgroundLayer | ApplyToMaskLayers | ApplyToLayersAffectedByPreserve3D
| ApplyToContentLayers) | 1417 ApplyToAllGraphicsLayers = (ApplyToSquashingLayer | ApplyToScrollbarLayers |
ApplyToBackgroundLayer | ApplyToMaskLayers | ApplyToLayersAffectedByPreserve3D
| ApplyToContentLayers) |
| 1419 }; | 1418 }; |
| 1420 typedef unsigned ApplyToGraphicsLayersMode; | 1419 typedef unsigned ApplyToGraphicsLayersMode; |
| 1421 | 1420 |
| 1422 template <typename Func> | 1421 template <typename Func> |
| 1423 static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, const F
unc& f, ApplyToGraphicsLayersMode mode) | 1422 static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, const F
unc& f, ApplyToGraphicsLayersMode mode) |
| 1424 { | 1423 { |
| 1425 ASSERT(mode); | 1424 ASSERT(mode); |
| 1426 | 1425 |
| 1427 if ((mode & ApplyToLayersAffectedByPreserve3D) && mapping->childTransformLay
er()) | 1426 if ((mode & ApplyToLayersAffectedByPreserve3D) && mapping->childTransformLay
er()) |
| 1428 f(mapping->childTransformLayer()); | 1427 f(mapping->childTransformLayer()); |
| 1429 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->mainGraphicsLayer()) | 1428 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->mainGraphicsLayer()) |
| 1430 f(mapping->mainGraphicsLayer()); | 1429 f(mapping->mainGraphicsLayer()); |
| 1431 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->clippingLayer()) | 1430 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->clippingLayer()) |
| 1432 f(mapping->clippingLayer()); | 1431 f(mapping->clippingLayer()); |
| 1433 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingLayer()) | 1432 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingLayer()) |
| 1434 f(mapping->scrollingLayer()); | 1433 f(mapping->scrollingLayer()); |
| 1435 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingBlockSelectionLayer()) | 1434 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingBlockSelectionLayer()) |
| 1436 f(mapping->scrollingBlockSelectionLayer()); | 1435 f(mapping->scrollingBlockSelectionLayer()); |
| 1437 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers) || (mode & ApplyToChildContainingLayers) || (mode & ApplyToScrollingContent
sLayer)) && mapping->scrollingContentsLayer()) | 1436 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingContentsLaye
r()) |
| 1438 f(mapping->scrollingContentsLayer()); | 1437 f(mapping->scrollingContentsLayer()); |
| 1439 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->foregroundLayer()) | 1438 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->foregroundLayer()) |
| 1440 f(mapping->foregroundLayer()); | 1439 f(mapping->foregroundLayer()); |
| 1441 | 1440 |
| 1442 if ((mode & ApplyToChildContainingLayers) && mapping->childTransformLayer()) | 1441 if ((mode & ApplyToChildContainingLayers) && mapping->childTransformLayer()) |
| 1443 f(mapping->childTransformLayer()); | 1442 f(mapping->childTransformLayer()); |
| 1444 | 1443 |
| 1445 if ((mode & ApplyToSquashingLayer) && mapping->squashingLayer()) | 1444 if ((mode & ApplyToSquashingLayer) && mapping->squashingLayer()) |
| 1446 f(mapping->squashingLayer()); | 1445 f(mapping->squashingLayer()); |
| 1447 | 1446 |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 const LayoutRect* visualRect; | 2137 const LayoutRect* visualRect; |
| 2139 LayoutSize subpixelAccumulation; | 2138 LayoutSize subpixelAccumulation; |
| 2140 }; | 2139 }; |
| 2141 | 2140 |
| 2142 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient
& displayItemClient, PaintInvalidationReason paintInvalidationReason, const Layo
utRect* visualRect) | 2141 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient
& displayItemClient, PaintInvalidationReason paintInvalidationReason, const Layo
utRect* visualRect) |
| 2143 { | 2142 { |
| 2144 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval
idationReason, visualRect, m_owningLayer.subpixelAccumulation() }; | 2143 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval
idationReason, visualRect, m_owningLayer.subpixelAccumulation() }; |
| 2145 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); | 2144 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); |
| 2146 } | 2145 } |
| 2147 | 2146 |
| 2148 void CompositedLayerMapping::invalidateDisplayItemClientOnScrollingContentsLayer
(const DisplayItemClient& displayItemClient, PaintInvalidationReason paintInvali
dationReason, const LayoutRect* visualRect) | |
| 2149 { | |
| 2150 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval
idationReason, visualRect, m_owningLayer.subpixelAccumulation() }; | |
| 2151 ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentsLayer); | |
| 2152 } | |
| 2153 | |
| 2154 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co
nst LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, un
signed maxSquashedLayerIndex) | 2147 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co
nst LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, un
signed maxSquashedLayerIndex) |
| 2155 { | 2148 { |
| 2156 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { | 2149 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { |
| 2157 if (layoutObject->isDescendantOf(layers[i].paintLayer->layoutObject())) | 2150 if (layoutObject->isDescendantOf(layers[i].paintLayer->layoutObject())) |
| 2158 return &layers[i]; | 2151 return &layers[i]; |
| 2159 } | 2152 } |
| 2160 return nullptr; | 2153 return nullptr; |
| 2161 } | 2154 } |
| 2162 | 2155 |
| 2163 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co
nst LayoutObject* layoutObject, unsigned maxSquashedLayerIndex) | 2156 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co
nst LayoutObject* layoutObject, unsigned maxSquashedLayerIndex) |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2607 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2600 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2608 name = "Scrolling Block Selection Layer"; | 2601 name = "Scrolling Block Selection Layer"; |
| 2609 } else { | 2602 } else { |
| 2610 ASSERT_NOT_REACHED(); | 2603 ASSERT_NOT_REACHED(); |
| 2611 } | 2604 } |
| 2612 | 2605 |
| 2613 return name; | 2606 return name; |
| 2614 } | 2607 } |
| 2615 | 2608 |
| 2616 } // namespace blink | 2609 } // namespace blink |
| OLD | NEW |