OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 return true; | 651 return true; |
652 } | 652 } |
653 return false; | 653 return false; |
654 } | 654 } |
655 | 655 |
656 bool RenderLayerCompositor::squashingWouldExceedSparsityTolerance(const RenderLa
yer* candidate, const RenderLayerCompositor::SquashingState& squashingState) | 656 bool RenderLayerCompositor::squashingWouldExceedSparsityTolerance(const RenderLa
yer* candidate, const RenderLayerCompositor::SquashingState& squashingState) |
657 { | 657 { |
658 IntRect bounds = candidate->ancestorDependentProperties().clippedAbsoluteBou
ndingBox; | 658 IntRect bounds = candidate->ancestorDependentProperties().clippedAbsoluteBou
ndingBox; |
659 IntRect newBoundingRect = squashingState.boundingRect; | 659 IntRect newBoundingRect = squashingState.boundingRect; |
660 newBoundingRect.unite(bounds); | 660 newBoundingRect.unite(bounds); |
661 const uint64_t newBoundingRectArea = newBoundingRect.size().area_safe(); | 661 const uint64_t newBoundingRectArea = newBoundingRect.size().area(); |
662 const uint64_t newSquashedArea = squashingState.totalAreaOfSquashedRects + b
ounds.size().area_safe(); | 662 const uint64_t newSquashedArea = squashingState.totalAreaOfSquashedRects + b
ounds.size().area(); |
663 return newBoundingRectArea > gSquashingSparsityTolerance * newSquashedArea; | 663 return newBoundingRectArea > gSquashingSparsityTolerance * newSquashedArea; |
664 } | 664 } |
665 | 665 |
666 bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer
* layer, const RenderLayerCompositor::SquashingState& squashingState) | 666 bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer
* layer, const RenderLayerCompositor::SquashingState& squashingState) |
667 { | 667 { |
668 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) | 668 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) |
669 return false; | 669 return false; |
670 | 670 |
671 // FIXME: this is not efficient, since it walks up the tree . We should stor
e these values on the AncestorDependentPropertiesCache. | 671 // FIXME: this is not efficient, since it walks up the tree . We should stor
e these values on the AncestorDependentPropertiesCache. |
672 ASSERT(squashingState.hasMostRecentMapping); | 672 ASSERT(squashingState.hasMostRecentMapping); |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 } else if (graphicsLayer == m_scrollLayer.get()) { | 1700 } else if (graphicsLayer == m_scrollLayer.get()) { |
1701 name = "LocalFrame Scrolling Layer"; | 1701 name = "LocalFrame Scrolling Layer"; |
1702 } else { | 1702 } else { |
1703 ASSERT_NOT_REACHED(); | 1703 ASSERT_NOT_REACHED(); |
1704 } | 1704 } |
1705 | 1705 |
1706 return name; | 1706 return name; |
1707 } | 1707 } |
1708 | 1708 |
1709 } // namespace WebCore | 1709 } // namespace WebCore |
OLD | NEW |