| 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 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1837 return m_childTransformLayer.get(); | 1837 return m_childTransformLayer.get(); |
| 1838 } | 1838 } |
| 1839 | 1839 |
| 1840 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForAncestorReasons(con
st RenderLayer* compositingAncestorLayer) | 1840 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForAncestorReasons(con
st RenderLayer* compositingAncestorLayer) |
| 1841 { | 1841 { |
| 1842 unsigned previousRequiresOwnBackingStoreForAncestorReasons = m_requiresOwnBa
ckingStoreForAncestorReasons; | 1842 unsigned previousRequiresOwnBackingStoreForAncestorReasons = m_requiresOwnBa
ckingStoreForAncestorReasons; |
| 1843 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); | 1843 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); |
| 1844 bool canPaintIntoAncestor = compositingAncestorLayer | 1844 bool canPaintIntoAncestor = compositingAncestorLayer |
| 1845 && (compositingAncestorLayer->compositedLayerMapping()->mainGraphicsLaye
r()->drawsContent() | 1845 && (compositingAncestorLayer->compositedLayerMapping()->mainGraphicsLaye
r()->drawsContent() |
| 1846 || compositingAncestorLayer->compositedLayerMapping()->paintsIntoCom
positedAncestor()); | 1846 || compositingAncestorLayer->compositedLayerMapping()->paintsIntoCom
positedAncestor()); |
| 1847 |
| 1848 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) |
| 1849 compositor()->repaintOnCompositingChange(&m_owningLayer); |
| 1850 |
| 1847 m_requiresOwnBackingStoreForAncestorReasons = !canPaintIntoAncestor; | 1851 m_requiresOwnBackingStoreForAncestorReasons = !canPaintIntoAncestor; |
| 1848 | 1852 |
| 1849 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) | |
| 1850 paintsIntoCompositedAncestorChanged(); | |
| 1851 return m_requiresOwnBackingStoreForAncestorReasons != previousRequiresOwnBac
kingStoreForAncestorReasons; | 1853 return m_requiresOwnBackingStoreForAncestorReasons != previousRequiresOwnBac
kingStoreForAncestorReasons; |
| 1852 } | 1854 } |
| 1853 | 1855 |
| 1854 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForIntrinsicReasons() | 1856 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForIntrinsicReasons() |
| 1855 { | 1857 { |
| 1856 unsigned previousRequiresOwnBackingStoreForIntrinsicReasons = m_requiresOwnB
ackingStoreForIntrinsicReasons; | 1858 unsigned previousRequiresOwnBackingStoreForIntrinsicReasons = m_requiresOwnB
ackingStoreForIntrinsicReasons; |
| 1857 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); | 1859 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); |
| 1858 RenderObject* renderer = m_owningLayer.renderer(); | 1860 RenderObject* renderer = m_owningLayer.renderer(); |
| 1859 m_requiresOwnBackingStoreForIntrinsicReasons = m_owningLayer.isRootLayer() | 1861 m_requiresOwnBackingStoreForIntrinsicReasons = m_owningLayer.isRootLayer() |
| 1860 || (m_owningLayer.compositingReasons() & CompositingReasonComboReasonsTh
atRequireOwnBacking) | 1862 || (m_owningLayer.compositingReasons() & CompositingReasonComboReasonsTh
atRequireOwnBacking) |
| 1861 || m_owningLayer.transform() | 1863 || m_owningLayer.transform() |
| 1862 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME:
Revisit this if the paintsIntoCompositedAncestor state is removed. | 1864 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME:
Revisit this if the paintsIntoCompositedAncestor state is removed. |
| 1863 || renderer->isTransparent() | 1865 || renderer->isTransparent() |
| 1864 || renderer->hasMask() | 1866 || renderer->hasMask() |
| 1865 || renderer->hasReflection() | 1867 || renderer->hasReflection() |
| 1866 || renderer->hasFilter(); | 1868 || renderer->hasFilter(); |
| 1867 | 1869 |
| 1868 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) | 1870 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor) |
| 1869 paintsIntoCompositedAncestorChanged(); | 1871 compositor()->repaintOnCompositingChange(&m_owningLayer); |
| 1872 |
| 1873 |
| 1870 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa
ckingStoreForIntrinsicReasons; | 1874 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa
ckingStoreForIntrinsicReasons; |
| 1871 } | 1875 } |
| 1872 | 1876 |
| 1873 void CompositedLayerMapping::paintsIntoCompositedAncestorChanged() | |
| 1874 { | |
| 1875 // The answer to paintsIntoCompositedAncestor() affects cached clip rects, s
o when | |
| 1876 // it changes we have to clear clip rects on descendants. | |
| 1877 m_owningLayer.clipper().clearClipRectsIncludingDescendants(PaintingClipRects
); | |
| 1878 m_owningLayer.repainter().computeRepaintRectsIncludingNonCompositingDescenda
nts(); | |
| 1879 | |
| 1880 compositor()->repaintInCompositedAncestor(&m_owningLayer, compositedBounds()
); | |
| 1881 } | |
| 1882 | |
| 1883 void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode) | 1877 void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode) |
| 1884 { | 1878 { |
| 1885 if (m_ancestorClippingLayer) { | 1879 if (m_ancestorClippingLayer) { |
| 1886 m_ancestorClippingLayer->setBlendMode(blendMode); | 1880 m_ancestorClippingLayer->setBlendMode(blendMode); |
| 1887 m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal); | 1881 m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal); |
| 1888 } else { | 1882 } else { |
| 1889 m_graphicsLayer->setBlendMode(blendMode); | 1883 m_graphicsLayer->setBlendMode(blendMode); |
| 1890 } | 1884 } |
| 1891 } | 1885 } |
| 1892 | 1886 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2248 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2242 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2249 name = "Scrolling Block Selection Layer"; | 2243 name = "Scrolling Block Selection Layer"; |
| 2250 } else { | 2244 } else { |
| 2251 ASSERT_NOT_REACHED(); | 2245 ASSERT_NOT_REACHED(); |
| 2252 } | 2246 } |
| 2253 | 2247 |
| 2254 return name; | 2248 return name; |
| 2255 } | 2249 } |
| 2256 | 2250 |
| 2257 } // namespace WebCore | 2251 } // namespace WebCore |
| OLD | NEW |