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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 Vector<PaintLayer*>& layersNeedingPaintInvalidation) { | 839 Vector<PaintLayer*>& layersNeedingPaintInvalidation) { |
840 if (!squashingLayer) | 840 if (!squashingLayer) |
841 return; | 841 return; |
842 | 842 |
843 LayoutPoint compositingContainerOffsetFromParentGraphicsLayer = | 843 LayoutPoint compositingContainerOffsetFromParentGraphicsLayer = |
844 -graphicsLayerParentLocation; | 844 -graphicsLayerParentLocation; |
845 if (compositingContainer) | 845 if (compositingContainer) |
846 compositingContainerOffsetFromParentGraphicsLayer += | 846 compositingContainerOffsetFromParentGraphicsLayer += |
847 compositingContainer->subpixelAccumulation(); | 847 compositingContainer->subpixelAccumulation(); |
848 | 848 |
849 #if DCHECK_IS_ON() | 849 #if 0 && DCHECK_IS_ON() |
| 850 // TODO(trchen): We should enable this for below comment out |DCHECK()| once |
| 851 // we have simple reproduce case and fix it. See http://crbug.com/646437 for |
| 852 // details. |
850 const PaintLayer* commonTransformAncestor = nullptr; | 853 const PaintLayer* commonTransformAncestor = nullptr; |
851 if (compositingContainer && compositingContainer->transform()) | 854 if (compositingContainer && compositingContainer->transform()) |
852 commonTransformAncestor = compositingContainer; | 855 commonTransformAncestor = compositingContainer; |
853 else if (compositingContainer) | 856 else if (compositingContainer) |
854 commonTransformAncestor = compositingContainer->transformAncestor(); | 857 commonTransformAncestor = compositingContainer->transformAncestor(); |
855 #endif | 858 #endif |
856 // FIXME: Cache these offsets. | 859 // FIXME: Cache these offsets. |
857 LayoutPoint compositingContainerOffsetFromTransformedAncestor; | 860 LayoutPoint compositingContainerOffsetFromTransformedAncestor; |
858 if (compositingContainer && !compositingContainer->transform()) | 861 if (compositingContainer && !compositingContainer->transform()) |
859 compositingContainerOffsetFromTransformedAncestor = | 862 compositingContainerOffsetFromTransformedAncestor = |
860 compositingContainer->computeOffsetFromTransformedAncestor(); | 863 compositingContainer->computeOffsetFromTransformedAncestor(); |
861 | 864 |
862 LayoutRect totalSquashBounds; | 865 LayoutRect totalSquashBounds; |
863 for (size_t i = 0; i < layers.size(); ++i) { | 866 for (size_t i = 0; i < layers.size(); ++i) { |
864 LayoutRect squashedBounds = | 867 LayoutRect squashedBounds = |
865 layers[i].paintLayer->boundingBoxForCompositing(); | 868 layers[i].paintLayer->boundingBoxForCompositing(); |
866 | 869 |
867 // Store the local bounds of the Layer subtree before applying the offset. | 870 // Store the local bounds of the Layer subtree before applying the offset. |
868 layers[i].compositedBounds = squashedBounds; | 871 layers[i].compositedBounds = squashedBounds; |
869 | 872 |
870 #if DCHECK_IS_ON() | 873 #if 0 && DCHECK_IS_ON() |
| 874 // TODO(trchen): We should enable this |DCHECK()| once we have simple |
| 875 // reproduce case and fix it. See http://crbug.com/646437 for details. |
871 DCHECK(layers[i].paintLayer->transformAncestor() == | 876 DCHECK(layers[i].paintLayer->transformAncestor() == |
872 commonTransformAncestor); | 877 commonTransformAncestor); |
873 #endif | 878 #endif |
874 LayoutPoint squashedLayerOffsetFromTransformedAncestor = | 879 LayoutPoint squashedLayerOffsetFromTransformedAncestor = |
875 layers[i].paintLayer->computeOffsetFromTransformedAncestor(); | 880 layers[i].paintLayer->computeOffsetFromTransformedAncestor(); |
876 LayoutSize squashedLayerOffsetFromCompositingContainer = | 881 LayoutSize squashedLayerOffsetFromCompositingContainer = |
877 squashedLayerOffsetFromTransformedAncestor - | 882 squashedLayerOffsetFromTransformedAncestor - |
878 compositingContainerOffsetFromTransformedAncestor; | 883 compositingContainerOffsetFromTransformedAncestor; |
879 | 884 |
880 squashedBounds.move(squashedLayerOffsetFromCompositingContainer); | 885 squashedBounds.move(squashedLayerOffsetFromCompositingContainer); |
(...skipping 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3469 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { | 3474 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
3470 name = "Decoration Layer"; | 3475 name = "Decoration Layer"; |
3471 } else { | 3476 } else { |
3472 ASSERT_NOT_REACHED(); | 3477 ASSERT_NOT_REACHED(); |
3473 } | 3478 } |
3474 | 3479 |
3475 return name; | 3480 return name; |
3476 } | 3481 } |
3477 | 3482 |
3478 } // namespace blink | 3483 } // namespace blink |
OLD | NEW |