|
Lines 578-584
void RenderLayerCompositor::logLayerInfo(const RenderLayer* layer, int depth)
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec1
|
| 578 |
|
578 |
|
| 579 |
LOG(Compositing, "%*p %dx%d %.2fKB (%s) %s\n", 12 + depth * 2, layer, backing->compositedBounds().width(), backing->compositedBounds().height(), |
579 |
LOG(Compositing, "%*p %dx%d %.2fKB (%s) %s\n", 12 + depth * 2, layer, backing->compositedBounds().width(), backing->compositedBounds().height(), |
| 580 |
backing->backingStoreMemoryEstimate() / 1024, |
580 |
backing->backingStoreMemoryEstimate() / 1024, |
| 581 |
reasonForCompositing(layer), layer->name().utf8().data()); |
581 |
logReasonsForCompositing(layer), layer->name().utf8().data()); |
| 582 |
} |
582 |
} |
| 583 |
#endif |
583 |
#endif |
| 584 |
|
584 |
|
|
Lines 1713-1721
bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec2
|
| 1713 |
return false; |
1713 |
return false; |
| 1714 |
} |
1714 |
} |
| 1715 |
|
1715 |
|
| 1716 |
#if !LOG_DISABLED |
1716 |
CompositingReasons RenderLayerCompositor::reasonsForCompositing(const RenderLayer* layer) const |
| 1717 |
const char* RenderLayerCompositor::reasonForCompositing(const RenderLayer* layer) |
|
|
| 1718 |
{ |
1717 |
{ |
|
|
1718 |
CompositingReasons reasons = CompositingReasonNone; |
| 1719 |
|
| 1720 |
if (!layer || !layer->isComposited()) |
| 1721 |
return reasons; |
| 1722 |
|
| 1719 |
RenderObject* renderer = layer->renderer(); |
1723 |
RenderObject* renderer = layer->renderer(); |
| 1720 |
if (layer->isReflection()) { |
1724 |
if (layer->isReflection()) { |
| 1721 |
renderer = renderer->parent(); |
1725 |
renderer = renderer->parent(); |
|
Lines 1723-1796
const char* RenderLayerCompositor::reasonForCompositing(const RenderLayer* layer
a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec3
|
| 1723 |
} |
1727 |
} |
| 1724 |
|
1728 |
|
| 1725 |
if (requiresCompositingForTransform(renderer)) |
1729 |
if (requiresCompositingForTransform(renderer)) |
| 1726 |
return "3D transform"; |
1730 |
reasons |= CompositingReason3DTransform; |
| 1727 |
|
1731 |
|
| 1728 |
if (requiresCompositingForVideo(renderer)) |
1732 |
if (requiresCompositingForVideo(renderer)) |
| 1729 |
return "video"; |
1733 |
reasons |= CompositingReasonVideo; |
| 1730 |
|
1734 |
|
| 1731 |
if (requiresCompositingForCanvas(renderer)) |
1735 |
if (requiresCompositingForCanvas(renderer)) |
| 1732 |
return "canvas"; |
1736 |
reasons |= CompositingReasonCanvas; |
| 1733 |
|
1737 |
|
| 1734 |
if (requiresCompositingForPlugin(renderer)) |
1738 |
if (requiresCompositingForPlugin(renderer)) |
| 1735 |
return "plugin"; |
1739 |
reasons |= CompositingReasonPlugin; |
| 1736 |
|
1740 |
|
| 1737 |
if (requiresCompositingForFrame(renderer)) |
1741 |
if (requiresCompositingForFrame(renderer)) |
| 1738 |
return "iframe"; |
1742 |
reasons |= CompositingReasonIFrame; |
| 1739 |
|
1743 |
|
| 1740 |
if ((canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden)) |
1744 |
if ((canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden)) |
| 1741 |
return "backface-visibility: hidden"; |
1745 |
reasons |= CompositingReasonBackfaceVisibilityHidden; |
| 1742 |
|
1746 |
|
| 1743 |
if (clipsCompositingDescendants(layer)) |
1747 |
if (clipsCompositingDescendants(layer)) |
| 1744 |
return "clips compositing descendants"; |
1748 |
reasons |= CompositingReasonClipsCompositingDescendants; |
| 1745 |
|
1749 |
|
| 1746 |
if (requiresCompositingForAnimation(renderer)) |
1750 |
if (requiresCompositingForAnimation(renderer)) |
| 1747 |
return "animation"; |
1751 |
reasons |= CompositingReasonAnimation; |
| 1748 |
|
1752 |
|
| 1749 |
if (requiresCompositingForFilters(renderer)) |
1753 |
if (requiresCompositingForFilters(renderer)) |
| 1750 |
return "filters"; |
1754 |
reasons |= CompositingReasonFilters; |
| 1751 |
|
1755 |
|
| 1752 |
if (requiresCompositingForPosition(renderer, layer)) |
1756 |
if (requiresCompositingForPosition(renderer, layer)) |
| 1753 |
return renderer->style()->position() == FixedPosition ? "position: fixed" : "position: sticky"; |
1757 |
reasons |= renderer->style()->position() == FixedPosition ? CompositingReasonPositionFixed : CompositingReasonPositionSticky; |
| 1754 |
|
1758 |
|
| 1755 |
if (requiresCompositingForOverflowScrolling(layer)) |
1759 |
if (requiresCompositingForOverflowScrolling(layer)) |
| 1756 |
return "-webkit-overflow-scrolling: touch"; |
1760 |
reasons |= CompositingReasonOverflowScrollingTouch; |
| 1757 |
|
1761 |
|
| 1758 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForStacking) |
1762 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForStacking) |
| 1759 |
return "stacking"; |
1763 |
reasons |= CompositingReasonStacking; |
| 1760 |
|
1764 |
else if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForOverlap) |
| 1761 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForOverlap) |
1765 |
reasons |= CompositingReasonOverlap; |
| 1762 |
return "overlap"; |
1766 |
else if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForBackgroundLayer) |
| 1763 |
|
1767 |
reasons |= CompositingReasonNegativeZIndexChildren; |
| 1764 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForBackgroundLayer) |
1768 |
else if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForGraphicalEffect) { |
| 1765 |
return "negative z-index children"; |
|
|
| 1766 |
|
| 1767 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForGraphicalEffect) { |
| 1768 |
if (layer->transform()) |
1769 |
if (layer->transform()) |
| 1769 |
return "transform with composited descendants"; |
1770 |
reasons |= CompositingReasonTransformWithCompositedDescendants; |
| 1770 |
|
1771 |
|
| 1771 |
if (renderer->isTransparent()) |
1772 |
if (renderer->isTransparent()) |
| 1772 |
return "opacity with composited descendants"; |
1773 |
reasons |= CompositingReasonOpacityWithCompositedDescendants; |
| 1773 |
|
1774 |
|
| 1774 |
if (renderer->hasMask()) |
1775 |
if (renderer->hasMask()) |
| 1775 |
return "mask with composited descendants"; |
1776 |
reasons |= CompositingReasonMaskWithCompositedDescendants; |
| 1776 |
|
1777 |
|
| 1777 |
if (renderer->hasReflection()) |
1778 |
if (renderer->hasReflection()) |
| 1778 |
return "reflection with composited descendants"; |
1779 |
reasons |= CompositingReasonReflectionWithCompositedDescendants; |
| 1779 |
|
1780 |
|
| 1780 |
if (renderer->hasFilter()) |
1781 |
if (renderer->hasFilter()) |
| 1781 |
return "filter with composited descendants"; |
1782 |
reasons |= CompositingReasonFilterWithCompositedDescendants; |
| 1782 |
|
1783 |
|
| 1783 |
if (renderer->hasBlendMode()) |
1784 |
if (renderer->hasBlendMode()) |
| 1784 |
return "blending with composited descendants"; |
1785 |
reasons |= CompositingReasonBlendingWithCompositedDescendants; |
| 1785 |
} |
1786 |
} else if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForPerspective) |
|
|
1787 |
reasons |= CompositingReasonPerspective; |
| 1788 |
else if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForPreserve3D) |
| 1789 |
reasons |= CompositingReasonPreserve3D; |
| 1790 |
|
| 1791 |
if (inCompositingMode() && layer->isRootLayer()) |
| 1792 |
reasons |= CompositingReasonRoot; |
| 1793 |
|
| 1794 |
return reasons; |
| 1795 |
} |
| 1796 |
|
| 1797 |
#if !LOG_DISABLED |
| 1798 |
const char* RenderLayerCompositor::logReasonsForCompositing(const RenderLayer* layer) |
| 1799 |
{ |
| 1800 |
CompositingReasons reasons = reasonsForCompositing(layer); |
| 1801 |
|
| 1802 |
if (reasons & CompositingReason3DTransform) |
| 1803 |
return "3D transform"; |
| 1804 |
|
| 1805 |
if (reasons & CompositingReasonVideo) |
| 1806 |
return "video"; |
| 1786 |
|
1807 |
|
| 1787 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForPerspective) |
1808 |
if (reasons & CompositingReasonCanvas) |
|
|
1809 |
return "canvas"; |
| 1810 |
|
| 1811 |
if (reasons & CompositingReasonPlugin) |
| 1812 |
return "plugin"; |
| 1813 |
|
| 1814 |
if (reasons & CompositingReasonIFrame) |
| 1815 |
return "iframe"; |
| 1816 |
|
| 1817 |
if (reasons & CompositingReasonBackfaceVisibilityHidden) |
| 1818 |
return "backface-visibility: hidden"; |
| 1819 |
|
| 1820 |
if (reasons & CompositingReasonClipsCompositingDescendants) |
| 1821 |
return "clips compositing descendants"; |
| 1822 |
|
| 1823 |
if (reasons & CompositingReasonAnimation) |
| 1824 |
return "animation"; |
| 1825 |
|
| 1826 |
if (reasons & CompositingReasonFilters) |
| 1827 |
return "filters"; |
| 1828 |
|
| 1829 |
if (reasons & CompositingReasonPositionFixed) |
| 1830 |
return "position: fixed"; |
| 1831 |
|
| 1832 |
if (reasons & CompositingReasonPositionSticky) |
| 1833 |
return "position: sticky"; |
| 1834 |
|
| 1835 |
if (reasons & CompositingReasonOverflowScrollingTouch) |
| 1836 |
return "-webkit-overflow-scrolling: touch"; |
| 1837 |
|
| 1838 |
if (reasons & CompositingReasonStacking) |
| 1839 |
return "stacking"; |
| 1840 |
|
| 1841 |
if (reasons & CompositingReasonOverlap) |
| 1842 |
return "overlap"; |
| 1843 |
|
| 1844 |
if (reasons & CompositingReasonNegativeZIndexChildren) |
| 1845 |
return "negative z-index children"; |
| 1846 |
|
| 1847 |
if (reasons & CompositingReasonTransformWithCompositedDescendants) |
| 1848 |
return "transform with composited descendants"; |
| 1849 |
|
| 1850 |
if (reasons & CompositingReasonOpacityWithCompositedDescendants) |
| 1851 |
return "opacity with composited descendants"; |
| 1852 |
|
| 1853 |
if (reasons & CompositingReasonMaskWithCompositedDescendants) |
| 1854 |
return "mask with composited descendants"; |
| 1855 |
|
| 1856 |
if (reasons & CompositingReasonReflectionWithCompositedDescendants) |
| 1857 |
return "reflection with composited descendants"; |
| 1858 |
|
| 1859 |
if (reasons & CompositingReasonFilterWithCompositedDescendants) |
| 1860 |
return "filter with composited descendants"; |
| 1861 |
|
| 1862 |
if (reasons & CompositingReasonBlendingWithCompositedDescendants) |
| 1863 |
return "blending with composited descendants"; |
| 1864 |
|
| 1865 |
if (reasons & CompositingReasonPerspective) |
| 1788 |
return "perspective"; |
1866 |
return "perspective"; |
| 1789 |
|
1867 |
|
| 1790 |
if (layer->indirectCompositingReason() == RenderLayer::IndirectCompositingForPreserve3D) |
1868 |
if (reasons & CompositingReasonPreserve3D) |
| 1791 |
return "preserve-3d"; |
1869 |
return "preserve-3d"; |
| 1792 |
|
1870 |
|
| 1793 |
if (inCompositingMode() && layer->isRootLayer()) |
1871 |
if (reasons & CompositingReasonRoot) |
| 1794 |
return "root"; |
1872 |
return "root"; |
| 1795 |
|
1873 |
|
| 1796 |
return ""; |
1874 |
return ""; |