Chromium Code Reviews| 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 | 552 |
| 553 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer)) | 553 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer)) |
| 554 layerConfigChanged = true; | 554 layerConfigChanged = true; |
| 555 | 555 |
| 556 bool scrollingConfigChanged = false; | 556 bool scrollingConfigChanged = false; |
| 557 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { | 557 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { |
| 558 layerConfigChanged = true; | 558 layerConfigChanged = true; |
| 559 scrollingConfigChanged = true; | 559 scrollingConfigChanged = true; |
| 560 } | 560 } |
| 561 | 561 |
| 562 // If the outline needs to draw over the composited scrolling contents layer | |
| 563 // or scrollbar layers it needs to be drawn into a separate layer. | |
| 564 int minBorderWidth = | |
| 565 std::min(layoutObject->style()->borderTopWidth(), | |
| 566 std::min(layoutObject->style()->borderLeftWidth(), | |
| 567 std::min(layoutObject->style()->borderRightWidth(), | |
| 568 layoutObject->style()->borderBottomWidth()))); | |
| 569 bool needsDecorationLayer = | |
| 570 m_owningLayer.getScrollableArea() && | |
| 571 m_owningLayer.getScrollableArea()->usesCompositedScrolling() && | |
| 572 layoutObject->style()->hasOutline() && | |
| 573 layoutObject->style()->outlineOffset() < -minBorderWidth; | |
| 574 | |
| 575 if (updateDecorationLayer(needsDecorationLayer)) | |
| 576 layerConfigChanged = true; | |
| 577 | |
| 562 if (updateOverflowControlsLayers( | 578 if (updateOverflowControlsLayers( |
| 563 requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), | 579 requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), |
| 564 requiresScrollCornerLayer(), needsAncestorClip)) | 580 requiresScrollCornerLayer(), needsAncestorClip)) |
| 565 layerConfigChanged = true; | 581 layerConfigChanged = true; |
| 566 | 582 |
| 567 bool hasPerspective = style.hasPerspective(); | 583 bool hasPerspective = style.hasPerspective(); |
| 568 bool needsChildTransformLayer = hasPerspective && layoutObject->isBox(); | 584 bool needsChildTransformLayer = hasPerspective && layoutObject->isBox(); |
| 569 if (updateChildTransformLayer(needsChildTransformLayer)) | 585 if (updateChildTransformLayer(needsChildTransformLayer)) |
| 570 layerConfigChanged = true; | 586 layerConfigChanged = true; |
| 571 | 587 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 937 clippingBox = clipBox(toLayoutBox(layoutObject())); | 953 clippingBox = clipBox(toLayoutBox(layoutObject())); |
| 938 | 954 |
| 939 updateChildTransformLayerGeometry(); | 955 updateChildTransformLayerGeometry(); |
| 940 updateChildContainmentLayerGeometry(clippingBox, localCompositingBounds); | 956 updateChildContainmentLayerGeometry(clippingBox, localCompositingBounds); |
| 941 | 957 |
| 942 updateMaskLayerGeometry(); | 958 updateMaskLayerGeometry(); |
| 943 updateTransformGeometry(snappedOffsetFromCompositedAncestor, | 959 updateTransformGeometry(snappedOffsetFromCompositedAncestor, |
| 944 relativeCompositingBounds); | 960 relativeCompositingBounds); |
| 945 updateForegroundLayerGeometry(contentsSize, clippingBox); | 961 updateForegroundLayerGeometry(contentsSize, clippingBox); |
| 946 updateBackgroundLayerGeometry(contentsSize); | 962 updateBackgroundLayerGeometry(contentsSize); |
| 963 // TODO(yigu): Currently the decoration layer uses the same contentSize | |
| 964 // as background layer and foreground layer. There are scenarios that | |
| 965 // the sizes could be different. The actual size of the decoration layer | |
| 966 // should be calculated separately. | |
| 967 // The size of the background layer should be differnet as well. We need to | |
|
flackr
2016/11/15 20:40:40
nit:s/differnet/different
yigu
2016/11/15 23:30:16
Done.
| |
| 968 // check whether we are painting the decoration layer into the background and | |
| 969 // then ignore or consider the outline when determining the contentSize. | |
| 970 updateDecorationLayerGeometry(contentsSize); | |
| 947 updateScrollingLayerGeometry(localCompositingBounds); | 971 updateScrollingLayerGeometry(localCompositingBounds); |
| 948 updateChildClippingMaskLayerGeometry(); | 972 updateChildClippingMaskLayerGeometry(); |
| 949 | 973 |
| 950 if (m_owningLayer.getScrollableArea() && | 974 if (m_owningLayer.getScrollableArea() && |
| 951 m_owningLayer.getScrollableArea()->scrollsOverflow()) | 975 m_owningLayer.getScrollableArea()->scrollsOverflow()) |
| 952 m_owningLayer.getScrollableArea()->positionOverflowControls(); | 976 m_owningLayer.getScrollableArea()->positionOverflowControls(); |
| 953 | 977 |
| 954 updateLayerBlendMode(layoutObject()->styleRef()); | 978 updateLayerBlendMode(layoutObject()->styleRef()); |
| 955 updateIsRootForIsolatedGroup(); | 979 updateIsRootForIsolatedGroup(); |
| 956 updateContentsRect(); | 980 updateContentsRect(); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1364 } | 1388 } |
| 1365 m_backgroundLayer->setPosition(FloatPoint()); | 1389 m_backgroundLayer->setPosition(FloatPoint()); |
| 1366 if (backgroundSize != m_backgroundLayer->size()) { | 1390 if (backgroundSize != m_backgroundLayer->size()) { |
| 1367 m_backgroundLayer->setSize(backgroundSize); | 1391 m_backgroundLayer->setSize(backgroundSize); |
| 1368 m_backgroundLayer->setNeedsDisplay(); | 1392 m_backgroundLayer->setNeedsDisplay(); |
| 1369 } | 1393 } |
| 1370 m_backgroundLayer->setOffsetFromLayoutObject( | 1394 m_backgroundLayer->setOffsetFromLayoutObject( |
| 1371 m_graphicsLayer->offsetFromLayoutObject()); | 1395 m_graphicsLayer->offsetFromLayoutObject()); |
| 1372 } | 1396 } |
| 1373 | 1397 |
| 1398 void CompositedLayerMapping::updateDecorationLayerGeometry( | |
| 1399 const FloatSize& relativeCompositingBoundsSize) { | |
| 1400 if (!m_decorationLayer) | |
| 1401 return; | |
| 1402 FloatSize decorationSize = relativeCompositingBoundsSize; | |
| 1403 m_decorationLayer->setPosition(FloatPoint()); | |
| 1404 if (decorationSize != m_decorationLayer->size()) { | |
| 1405 m_decorationLayer->setSize(decorationSize); | |
| 1406 m_decorationLayer->setNeedsDisplay(); | |
| 1407 } | |
| 1408 m_decorationLayer->setOffsetFromLayoutObject( | |
| 1409 m_graphicsLayer->offsetFromLayoutObject()); | |
| 1410 } | |
| 1411 | |
| 1374 void CompositedLayerMapping::registerScrollingLayers() { | 1412 void CompositedLayerMapping::registerScrollingLayers() { |
| 1375 // Register fixed position layers and their containers with the scrolling | 1413 // Register fixed position layers and their containers with the scrolling |
| 1376 // coordinator. | 1414 // coordinator. |
| 1377 ScrollingCoordinator* scrollingCoordinator = | 1415 ScrollingCoordinator* scrollingCoordinator = |
| 1378 scrollingCoordinatorFromLayer(m_owningLayer); | 1416 scrollingCoordinatorFromLayer(m_owningLayer); |
| 1379 if (!scrollingCoordinator) | 1417 if (!scrollingCoordinator) |
| 1380 return; | 1418 return; |
| 1381 | 1419 |
| 1382 scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer); | 1420 scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer); |
| 1383 | 1421 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1431 .containerLayer(); | 1469 .containerLayer(); |
| 1432 updateBottomLayer(m_overflowControlsAncestorClippingLayer.get()); | 1470 updateBottomLayer(m_overflowControlsAncestorClippingLayer.get()); |
| 1433 updateBottomLayer(m_overflowControlsHostLayer.get()); | 1471 updateBottomLayer(m_overflowControlsHostLayer.get()); |
| 1434 if (m_layerForHorizontalScrollbar) | 1472 if (m_layerForHorizontalScrollbar) |
| 1435 m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get()); | 1473 m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get()); |
| 1436 if (m_layerForVerticalScrollbar) | 1474 if (m_layerForVerticalScrollbar) |
| 1437 m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()); | 1475 m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()); |
| 1438 if (m_layerForScrollCorner) | 1476 if (m_layerForScrollCorner) |
| 1439 m_overflowControlsHostLayer->addChild(m_layerForScrollCorner.get()); | 1477 m_overflowControlsHostLayer->addChild(m_layerForScrollCorner.get()); |
| 1440 | 1478 |
| 1479 // Now add the DecorationLayer as a subtree to GraphicsLayer | |
| 1480 if (m_decorationLayer.get()) | |
| 1481 m_graphicsLayer->addChild(m_decorationLayer.get()); | |
| 1482 | |
| 1441 // The squashing containment layer, if it exists, becomes a no-op parent. | 1483 // The squashing containment layer, if it exists, becomes a no-op parent. |
| 1442 if (m_squashingLayer) { | 1484 if (m_squashingLayer) { |
| 1443 ASSERT((m_ancestorClippingLayer && !m_squashingContainmentLayer) || | 1485 ASSERT((m_ancestorClippingLayer && !m_squashingContainmentLayer) || |
| 1444 (!m_ancestorClippingLayer && m_squashingContainmentLayer)); | 1486 (!m_ancestorClippingLayer && m_squashingContainmentLayer)); |
| 1445 | 1487 |
| 1446 if (m_squashingContainmentLayer) { | 1488 if (m_squashingContainmentLayer) { |
| 1447 m_squashingContainmentLayer->removeAllChildren(); | 1489 m_squashingContainmentLayer->removeAllChildren(); |
| 1448 m_squashingContainmentLayer->addChild(m_graphicsLayer.get()); | 1490 m_squashingContainmentLayer->addChild(m_graphicsLayer.get()); |
| 1449 m_squashingContainmentLayer->addChild(m_squashingLayer.get()); | 1491 m_squashingContainmentLayer->addChild(m_squashingLayer.get()); |
| 1450 } else { | 1492 } else { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1562 } | 1604 } |
| 1563 contentLayer->setBackgroundColor(bgColor.rgb()); | 1605 contentLayer->setBackgroundColor(bgColor.rgb()); |
| 1564 } | 1606 } |
| 1565 } | 1607 } |
| 1566 | 1608 |
| 1567 // FIXME: we could refine this to only allocate backings for one of these | 1609 // FIXME: we could refine this to only allocate backings for one of these |
| 1568 // layers if possible. | 1610 // layers if possible. |
| 1569 if (m_foregroundLayer) | 1611 if (m_foregroundLayer) |
| 1570 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 1612 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
| 1571 | 1613 |
| 1614 // TODO(yigu): The background should no longer setDrawsContent(true) if we | |
| 1615 // only have an outline and we are drawing the outline into the decoration | |
| 1616 // layer (i.e. if there is nothing actually drawn into the | |
| 1617 // background anymore.) | |
| 1618 // "hasPaintedContent" should be calculated in a way that does not take the | |
| 1619 // outline into consideration. | |
| 1572 if (m_backgroundLayer) | 1620 if (m_backgroundLayer) |
| 1573 m_backgroundLayer->setDrawsContent(hasPaintedContent); | 1621 m_backgroundLayer->setDrawsContent(hasPaintedContent); |
| 1574 | 1622 |
| 1623 if (m_decorationLayer) | |
| 1624 m_decorationLayer->setDrawsContent(true); | |
| 1625 | |
| 1575 if (m_maskLayer) | 1626 if (m_maskLayer) |
| 1576 m_maskLayer->setDrawsContent(true); | 1627 m_maskLayer->setDrawsContent(true); |
| 1577 | 1628 |
| 1578 if (m_childClippingMaskLayer) | 1629 if (m_childClippingMaskLayer) |
| 1579 m_childClippingMaskLayer->setDrawsContent(true); | 1630 m_childClippingMaskLayer->setDrawsContent(true); |
| 1580 } | 1631 } |
| 1581 | 1632 |
| 1582 void CompositedLayerMapping::updateChildrenTransform() { | 1633 void CompositedLayerMapping::updateChildrenTransform() { |
| 1583 if (GraphicsLayer* childTransformLayer = this->childTransformLayer()) { | 1634 if (GraphicsLayer* childTransformLayer = this->childTransformLayer()) { |
| 1584 childTransformLayer->setTransform(owningLayer().perspectiveTransform()); | 1635 childTransformLayer->setTransform(owningLayer().perspectiveTransform()); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1764 ApplyToLayersAffectedByPreserve3D = (1 << 0), | 1815 ApplyToLayersAffectedByPreserve3D = (1 << 0), |
| 1765 ApplyToSquashingLayer = (1 << 1), | 1816 ApplyToSquashingLayer = (1 << 1), |
| 1766 ApplyToScrollbarLayers = (1 << 2), | 1817 ApplyToScrollbarLayers = (1 << 2), |
| 1767 ApplyToBackgroundLayer = (1 << 3), | 1818 ApplyToBackgroundLayer = (1 << 3), |
| 1768 ApplyToMaskLayers = (1 << 4), | 1819 ApplyToMaskLayers = (1 << 4), |
| 1769 ApplyToContentLayers = (1 << 5), | 1820 ApplyToContentLayers = (1 << 5), |
| 1770 ApplyToChildContainingLayers = | 1821 ApplyToChildContainingLayers = |
| 1771 (1 << 6), // layers between m_graphicsLayer and children | 1822 (1 << 6), // layers between m_graphicsLayer and children |
| 1772 ApplyToNonScrollingContentLayers = (1 << 7), | 1823 ApplyToNonScrollingContentLayers = (1 << 7), |
| 1773 ApplyToScrollingContentLayers = (1 << 8), | 1824 ApplyToScrollingContentLayers = (1 << 8), |
| 1825 ApplyToDecorationLayer = (1 << 9), | |
| 1774 ApplyToAllGraphicsLayers = | 1826 ApplyToAllGraphicsLayers = |
| 1775 (ApplyToSquashingLayer | ApplyToScrollbarLayers | ApplyToBackgroundLayer | | 1827 (ApplyToSquashingLayer | ApplyToScrollbarLayers | ApplyToBackgroundLayer | |
| 1776 ApplyToMaskLayers | | 1828 ApplyToMaskLayers | |
| 1777 ApplyToLayersAffectedByPreserve3D | | 1829 ApplyToLayersAffectedByPreserve3D | |
| 1778 ApplyToContentLayers | | 1830 ApplyToContentLayers | |
| 1779 ApplyToScrollingContentLayers) | 1831 ApplyToScrollingContentLayers | |
| 1832 ApplyToDecorationLayer) | |
| 1780 }; | 1833 }; |
| 1781 typedef unsigned ApplyToGraphicsLayersMode; | 1834 typedef unsigned ApplyToGraphicsLayersMode; |
| 1782 | 1835 |
| 1783 template <typename Func> | 1836 template <typename Func> |
| 1784 static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, | 1837 static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, |
| 1785 const Func& f, | 1838 const Func& f, |
| 1786 ApplyToGraphicsLayersMode mode) { | 1839 ApplyToGraphicsLayersMode mode) { |
| 1787 ASSERT(mode); | 1840 ASSERT(mode); |
| 1788 | 1841 |
| 1789 if ((mode & ApplyToLayersAffectedByPreserve3D) && | 1842 if ((mode & ApplyToLayersAffectedByPreserve3D) && |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1832 (mode & ApplyToNonScrollingContentLayers)) && | 1885 (mode & ApplyToNonScrollingContentLayers)) && |
| 1833 mapping->backgroundLayer()) | 1886 mapping->backgroundLayer()) |
| 1834 f(mapping->backgroundLayer()); | 1887 f(mapping->backgroundLayer()); |
| 1835 | 1888 |
| 1836 if ((mode & ApplyToScrollbarLayers) && mapping->layerForHorizontalScrollbar()) | 1889 if ((mode & ApplyToScrollbarLayers) && mapping->layerForHorizontalScrollbar()) |
| 1837 f(mapping->layerForHorizontalScrollbar()); | 1890 f(mapping->layerForHorizontalScrollbar()); |
| 1838 if ((mode & ApplyToScrollbarLayers) && mapping->layerForVerticalScrollbar()) | 1891 if ((mode & ApplyToScrollbarLayers) && mapping->layerForVerticalScrollbar()) |
| 1839 f(mapping->layerForVerticalScrollbar()); | 1892 f(mapping->layerForVerticalScrollbar()); |
| 1840 if ((mode & ApplyToScrollbarLayers) && mapping->layerForScrollCorner()) | 1893 if ((mode & ApplyToScrollbarLayers) && mapping->layerForScrollCorner()) |
| 1841 f(mapping->layerForScrollCorner()); | 1894 f(mapping->layerForScrollCorner()); |
| 1895 | |
| 1896 if (((mode & ApplyToDecorationLayer) || | |
| 1897 (mode & ApplyToNonScrollingContentLayers)) && | |
| 1898 mapping->decorationLayer()) | |
| 1899 f(mapping->decorationLayer()); | |
| 1842 } | 1900 } |
| 1843 | 1901 |
| 1844 struct UpdateRenderingContextFunctor { | 1902 struct UpdateRenderingContextFunctor { |
| 1845 void operator()(GraphicsLayer* layer) const { | 1903 void operator()(GraphicsLayer* layer) const { |
| 1846 layer->setRenderingContext(renderingContext); | 1904 layer->setRenderingContext(renderingContext); |
| 1847 } | 1905 } |
| 1848 int renderingContext; | 1906 int renderingContext; |
| 1849 }; | 1907 }; |
| 1850 | 1908 |
| 1851 void CompositedLayerMapping::updateRenderingContext() { | 1909 void CompositedLayerMapping::updateRenderingContext() { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2010 layerChanged = true; | 2068 layerChanged = true; |
| 2011 } | 2069 } |
| 2012 } | 2070 } |
| 2013 | 2071 |
| 2014 if (layerChanged && !m_owningLayer.layoutObject()->documentBeingDestroyed()) | 2072 if (layerChanged && !m_owningLayer.layoutObject()->documentBeingDestroyed()) |
| 2015 compositor()->rootFixedBackgroundsChanged(); | 2073 compositor()->rootFixedBackgroundsChanged(); |
| 2016 | 2074 |
| 2017 return layerChanged; | 2075 return layerChanged; |
| 2018 } | 2076 } |
| 2019 | 2077 |
| 2078 bool CompositedLayerMapping::updateDecorationLayer(bool needsDecorationLayer) { | |
| 2079 bool layerChanged = false; | |
| 2080 if (needsDecorationLayer) { | |
| 2081 if (!m_decorationLayer) { | |
| 2082 m_decorationLayer = | |
| 2083 createGraphicsLayer(CompositingReasonLayerForDecoration); | |
| 2084 m_decorationLayer->setPaintingPhase(GraphicsLayerPaintDecoration); | |
| 2085 layerChanged = true; | |
| 2086 } | |
| 2087 } else if (m_decorationLayer) { | |
| 2088 m_decorationLayer = nullptr; | |
| 2089 layerChanged = true; | |
| 2090 } | |
| 2091 | |
| 2092 return layerChanged; | |
| 2093 } | |
| 2094 | |
| 2020 bool CompositedLayerMapping::updateMaskLayer(bool needsMaskLayer) { | 2095 bool CompositedLayerMapping::updateMaskLayer(bool needsMaskLayer) { |
| 2021 bool layerChanged = false; | 2096 bool layerChanged = false; |
| 2022 if (needsMaskLayer) { | 2097 if (needsMaskLayer) { |
| 2023 if (!m_maskLayer) { | 2098 if (!m_maskLayer) { |
| 2024 m_maskLayer = createGraphicsLayer(CompositingReasonLayerForMask); | 2099 m_maskLayer = createGraphicsLayer(CompositingReasonLayerForMask); |
| 2025 m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); | 2100 m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); |
| 2026 layerChanged = true; | 2101 layerChanged = true; |
| 2027 } | 2102 } |
| 2028 } else if (m_maskLayer) { | 2103 } else if (m_maskLayer) { |
| 2029 m_maskLayer = nullptr; | 2104 m_maskLayer = nullptr; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2212 | 2287 |
| 2213 GraphicsLayerPaintingPhase | 2288 GraphicsLayerPaintingPhase |
| 2214 CompositedLayerMapping::paintingPhaseForPrimaryLayer() const { | 2289 CompositedLayerMapping::paintingPhaseForPrimaryLayer() const { |
| 2215 unsigned phase = 0; | 2290 unsigned phase = 0; |
| 2216 if (!m_backgroundLayer) | 2291 if (!m_backgroundLayer) |
| 2217 phase |= GraphicsLayerPaintBackground; | 2292 phase |= GraphicsLayerPaintBackground; |
| 2218 if (!m_foregroundLayer) | 2293 if (!m_foregroundLayer) |
| 2219 phase |= GraphicsLayerPaintForeground; | 2294 phase |= GraphicsLayerPaintForeground; |
| 2220 if (!m_maskLayer) | 2295 if (!m_maskLayer) |
| 2221 phase |= GraphicsLayerPaintMask; | 2296 phase |= GraphicsLayerPaintMask; |
| 2297 if (!m_decorationLayer) | |
| 2298 phase |= GraphicsLayerPaintDecoration; | |
| 2222 | 2299 |
| 2223 if (m_scrollingContentsLayer) { | 2300 if (m_scrollingContentsLayer) { |
| 2224 phase &= ~GraphicsLayerPaintForeground; | 2301 phase &= ~GraphicsLayerPaintForeground; |
| 2225 phase |= GraphicsLayerPaintCompositedScroll; | 2302 phase |= GraphicsLayerPaintCompositedScroll; |
| 2226 } | 2303 } |
| 2227 | 2304 |
| 2228 return static_cast<GraphicsLayerPaintingPhase>(phase); | 2305 return static_cast<GraphicsLayerPaintingPhase>(phase); |
| 2229 } | 2306 } |
| 2230 | 2307 |
| 2231 float CompositedLayerMapping::compositingOpacity( | 2308 float CompositedLayerMapping::compositingOpacity( |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2950 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) | 3027 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) |
| 2951 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; | 3028 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; |
| 2952 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) | 3029 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) |
| 2953 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; | 3030 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; |
| 2954 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) | 3031 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) |
| 2955 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; | 3032 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; |
| 2956 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) | 3033 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) |
| 2957 paintLayerFlags |= PaintLayerPaintingOverflowContents; | 3034 paintLayerFlags |= PaintLayerPaintingOverflowContents; |
| 2958 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) | 3035 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) |
| 2959 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; | 3036 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; |
| 3037 if (graphicsLayerPaintingPhase & GraphicsLayerPaintDecoration) | |
| 3038 paintLayerFlags |= PaintLayerPaintingCompositingDecorationPhase; | |
| 2960 | 3039 |
| 2961 if (graphicsLayer == m_backgroundLayer.get()) | 3040 if (graphicsLayer == m_backgroundLayer.get()) |
| 2962 paintLayerFlags |= PaintLayerPaintingRootBackgroundOnly; | 3041 paintLayerFlags |= PaintLayerPaintingRootBackgroundOnly; |
| 2963 else if (compositor()->fixedRootBackgroundLayer() && | 3042 else if (compositor()->fixedRootBackgroundLayer() && |
| 2964 m_owningLayer.isRootLayer()) | 3043 m_owningLayer.isRootLayer()) |
| 2965 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3044 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2966 | 3045 |
| 2967 if (graphicsLayer == m_graphicsLayer.get() || | 3046 if (graphicsLayer == m_graphicsLayer.get() || |
| 2968 graphicsLayer == m_foregroundLayer.get() || | 3047 graphicsLayer == m_foregroundLayer.get() || |
| 2969 graphicsLayer == m_backgroundLayer.get() || | 3048 graphicsLayer == m_backgroundLayer.get() || |
| 2970 graphicsLayer == m_maskLayer.get() || | 3049 graphicsLayer == m_maskLayer.get() || |
| 2971 graphicsLayer == m_childClippingMaskLayer.get() || | 3050 graphicsLayer == m_childClippingMaskLayer.get() || |
| 2972 graphicsLayer == m_scrollingContentsLayer.get()) { | 3051 graphicsLayer == m_scrollingContentsLayer.get() || |
| 3052 graphicsLayer == m_decorationLayer.get()) { | |
| 2973 bool paintRootBackgroundOntoScrollingContentsLayer = | 3053 bool paintRootBackgroundOntoScrollingContentsLayer = |
| 2974 m_backgroundPaintsOntoScrollingContentsLayer; | 3054 m_backgroundPaintsOntoScrollingContentsLayer; |
| 2975 DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || | 3055 DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || |
| 2976 (!m_backgroundLayer && !m_foregroundLayer)); | 3056 (!m_backgroundLayer && !m_foregroundLayer)); |
| 2977 if (paintRootBackgroundOntoScrollingContentsLayer) { | 3057 if (paintRootBackgroundOntoScrollingContentsLayer) { |
| 2978 if (graphicsLayer == m_scrollingContentsLayer.get()) | 3058 if (graphicsLayer == m_scrollingContentsLayer.get()) |
| 2979 paintLayerFlags &= ~PaintLayerPaintingSkipRootBackground; | 3059 paintLayerFlags &= ~PaintLayerPaintingSkipRootBackground; |
| 2980 else | 3060 else |
| 2981 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3061 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2982 } | 3062 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3243 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 3323 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
| 3244 name = "Scroll Corner Layer"; | 3324 name = "Scroll Corner Layer"; |
| 3245 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { | 3325 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { |
| 3246 name = "Overflow Controls Host Layer"; | 3326 name = "Overflow Controls Host Layer"; |
| 3247 } else if (graphicsLayer == m_overflowControlsAncestorClippingLayer.get()) { | 3327 } else if (graphicsLayer == m_overflowControlsAncestorClippingLayer.get()) { |
| 3248 name = "Overflow Controls Ancestor Clipping Layer"; | 3328 name = "Overflow Controls Ancestor Clipping Layer"; |
| 3249 } else if (graphicsLayer == m_scrollingLayer.get()) { | 3329 } else if (graphicsLayer == m_scrollingLayer.get()) { |
| 3250 name = "Scrolling Layer"; | 3330 name = "Scrolling Layer"; |
| 3251 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 3331 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 3252 name = "Scrolling Contents Layer"; | 3332 name = "Scrolling Contents Layer"; |
| 3333 } else if (graphicsLayer == m_decorationLayer.get()) { | |
| 3334 name = "Decoration Layer"; | |
| 3253 } else { | 3335 } else { |
| 3254 ASSERT_NOT_REACHED(); | 3336 ASSERT_NOT_REACHED(); |
| 3255 } | 3337 } |
| 3256 | 3338 |
| 3257 return name; | 3339 return name; |
| 3258 } | 3340 } |
| 3259 | 3341 |
| 3260 } // namespace blink | 3342 } // namespace blink |
| OLD | NEW |