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 needsDecorationOutlineLayer = |
| 570 m_owningLayer.getScrollableArea() && |
| 571 m_owningLayer.getScrollableArea()->usesCompositedScrolling() && |
| 572 layoutObject->style()->hasOutline() && |
| 573 layoutObject->style()->outlineOffset() < -minBorderWidth; |
| 574 |
| 575 if (updateDecorationOutlineLayer(needsDecorationOutlineLayer)) |
| 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 different as well. We need to |
| 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 updateDecorationOutlineLayerGeometry(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::updateDecorationOutlineLayerGeometry( |
| 1399 const FloatSize& relativeCompositingBoundsSize) { |
| 1400 if (!m_decorationOutlineLayer) |
| 1401 return; |
| 1402 FloatSize decorationSize = relativeCompositingBoundsSize; |
| 1403 m_decorationOutlineLayer->setPosition(FloatPoint()); |
| 1404 if (decorationSize != m_decorationOutlineLayer->size()) { |
| 1405 m_decorationOutlineLayer->setSize(decorationSize); |
| 1406 m_decorationOutlineLayer->setNeedsDisplay(); |
| 1407 } |
| 1408 m_decorationOutlineLayer->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 DecorationOutlineLayer as a subtree to GraphicsLayer |
| 1480 if (m_decorationOutlineLayer.get()) |
| 1481 m_graphicsLayer->addChild(m_decorationOutlineLayer.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_decorationOutlineLayer) |
| 1624 m_decorationOutlineLayer->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 ApplyToDecorationOutlineLayer = (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 ApplyToDecorationOutlineLayer) |
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 & ApplyToDecorationOutlineLayer) || |
| 1897 (mode & ApplyToNonScrollingContentLayers)) && |
| 1898 mapping->decorationOutlineLayer()) |
| 1899 f(mapping->decorationOutlineLayer()); |
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::updateDecorationOutlineLayer( |
| 2079 bool needsDecorationOutlineLayer) { |
| 2080 bool layerChanged = false; |
| 2081 if (needsDecorationOutlineLayer) { |
| 2082 if (!m_decorationOutlineLayer) { |
| 2083 m_decorationOutlineLayer = |
| 2084 createGraphicsLayer(CompositingReasonLayerForDecoration); |
| 2085 m_decorationOutlineLayer->setPaintingPhase(GraphicsLayerPaintDecoration); |
| 2086 layerChanged = true; |
| 2087 } |
| 2088 } else if (m_decorationOutlineLayer) { |
| 2089 m_decorationOutlineLayer = nullptr; |
| 2090 layerChanged = true; |
| 2091 } |
| 2092 |
| 2093 return layerChanged; |
| 2094 } |
| 2095 |
2020 bool CompositedLayerMapping::updateMaskLayer(bool needsMaskLayer) { | 2096 bool CompositedLayerMapping::updateMaskLayer(bool needsMaskLayer) { |
2021 bool layerChanged = false; | 2097 bool layerChanged = false; |
2022 if (needsMaskLayer) { | 2098 if (needsMaskLayer) { |
2023 if (!m_maskLayer) { | 2099 if (!m_maskLayer) { |
2024 m_maskLayer = createGraphicsLayer(CompositingReasonLayerForMask); | 2100 m_maskLayer = createGraphicsLayer(CompositingReasonLayerForMask); |
2025 m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); | 2101 m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); |
2026 layerChanged = true; | 2102 layerChanged = true; |
2027 } | 2103 } |
2028 } else if (m_maskLayer) { | 2104 } else if (m_maskLayer) { |
2029 m_maskLayer = nullptr; | 2105 m_maskLayer = nullptr; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 | 2288 |
2213 GraphicsLayerPaintingPhase | 2289 GraphicsLayerPaintingPhase |
2214 CompositedLayerMapping::paintingPhaseForPrimaryLayer() const { | 2290 CompositedLayerMapping::paintingPhaseForPrimaryLayer() const { |
2215 unsigned phase = 0; | 2291 unsigned phase = 0; |
2216 if (!m_backgroundLayer) | 2292 if (!m_backgroundLayer) |
2217 phase |= GraphicsLayerPaintBackground; | 2293 phase |= GraphicsLayerPaintBackground; |
2218 if (!m_foregroundLayer) | 2294 if (!m_foregroundLayer) |
2219 phase |= GraphicsLayerPaintForeground; | 2295 phase |= GraphicsLayerPaintForeground; |
2220 if (!m_maskLayer) | 2296 if (!m_maskLayer) |
2221 phase |= GraphicsLayerPaintMask; | 2297 phase |= GraphicsLayerPaintMask; |
| 2298 if (!m_decorationOutlineLayer) |
| 2299 phase |= GraphicsLayerPaintDecoration; |
2222 | 2300 |
2223 if (m_scrollingContentsLayer) { | 2301 if (m_scrollingContentsLayer) { |
2224 phase &= ~GraphicsLayerPaintForeground; | 2302 phase &= ~GraphicsLayerPaintForeground; |
2225 phase |= GraphicsLayerPaintCompositedScroll; | 2303 phase |= GraphicsLayerPaintCompositedScroll; |
2226 } | 2304 } |
2227 | 2305 |
2228 return static_cast<GraphicsLayerPaintingPhase>(phase); | 2306 return static_cast<GraphicsLayerPaintingPhase>(phase); |
2229 } | 2307 } |
2230 | 2308 |
2231 float CompositedLayerMapping::compositingOpacity( | 2309 float CompositedLayerMapping::compositingOpacity( |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2950 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) | 3028 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) |
2951 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; | 3029 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; |
2952 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) | 3030 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) |
2953 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; | 3031 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; |
2954 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) | 3032 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) |
2955 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; | 3033 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; |
2956 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) | 3034 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) |
2957 paintLayerFlags |= PaintLayerPaintingOverflowContents; | 3035 paintLayerFlags |= PaintLayerPaintingOverflowContents; |
2958 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) | 3036 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) |
2959 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; | 3037 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; |
| 3038 if (graphicsLayerPaintingPhase & GraphicsLayerPaintDecoration) |
| 3039 paintLayerFlags |= PaintLayerPaintingCompositingDecorationPhase; |
2960 | 3040 |
2961 if (graphicsLayer == m_backgroundLayer.get()) | 3041 if (graphicsLayer == m_backgroundLayer.get()) |
2962 paintLayerFlags |= PaintLayerPaintingRootBackgroundOnly; | 3042 paintLayerFlags |= PaintLayerPaintingRootBackgroundOnly; |
2963 else if (compositor()->fixedRootBackgroundLayer() && | 3043 else if (compositor()->fixedRootBackgroundLayer() && |
2964 m_owningLayer.isRootLayer()) | 3044 m_owningLayer.isRootLayer()) |
2965 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3045 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
2966 | 3046 |
2967 if (graphicsLayer == m_graphicsLayer.get() || | 3047 if (graphicsLayer == m_graphicsLayer.get() || |
2968 graphicsLayer == m_foregroundLayer.get() || | 3048 graphicsLayer == m_foregroundLayer.get() || |
2969 graphicsLayer == m_backgroundLayer.get() || | 3049 graphicsLayer == m_backgroundLayer.get() || |
2970 graphicsLayer == m_maskLayer.get() || | 3050 graphicsLayer == m_maskLayer.get() || |
2971 graphicsLayer == m_childClippingMaskLayer.get() || | 3051 graphicsLayer == m_childClippingMaskLayer.get() || |
2972 graphicsLayer == m_scrollingContentsLayer.get()) { | 3052 graphicsLayer == m_scrollingContentsLayer.get() || |
| 3053 graphicsLayer == m_decorationOutlineLayer.get()) { |
2973 bool paintRootBackgroundOntoScrollingContentsLayer = | 3054 bool paintRootBackgroundOntoScrollingContentsLayer = |
2974 m_backgroundPaintsOntoScrollingContentsLayer; | 3055 m_backgroundPaintsOntoScrollingContentsLayer; |
2975 DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || | 3056 DCHECK(!paintRootBackgroundOntoScrollingContentsLayer || |
2976 (!m_backgroundLayer && !m_foregroundLayer)); | 3057 (!m_backgroundLayer && !m_foregroundLayer)); |
2977 if (paintRootBackgroundOntoScrollingContentsLayer) { | 3058 if (paintRootBackgroundOntoScrollingContentsLayer) { |
2978 if (graphicsLayer == m_scrollingContentsLayer.get()) | 3059 if (graphicsLayer == m_scrollingContentsLayer.get()) |
2979 paintLayerFlags &= ~PaintLayerPaintingSkipRootBackground; | 3060 paintLayerFlags &= ~PaintLayerPaintingSkipRootBackground; |
2980 else | 3061 else |
2981 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 3062 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
2982 } | 3063 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3243 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 3324 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
3244 name = "Scroll Corner Layer"; | 3325 name = "Scroll Corner Layer"; |
3245 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { | 3326 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { |
3246 name = "Overflow Controls Host Layer"; | 3327 name = "Overflow Controls Host Layer"; |
3247 } else if (graphicsLayer == m_overflowControlsAncestorClippingLayer.get()) { | 3328 } else if (graphicsLayer == m_overflowControlsAncestorClippingLayer.get()) { |
3248 name = "Overflow Controls Ancestor Clipping Layer"; | 3329 name = "Overflow Controls Ancestor Clipping Layer"; |
3249 } else if (graphicsLayer == m_scrollingLayer.get()) { | 3330 } else if (graphicsLayer == m_scrollingLayer.get()) { |
3250 name = "Scrolling Layer"; | 3331 name = "Scrolling Layer"; |
3251 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 3332 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
3252 name = "Scrolling Contents Layer"; | 3333 name = "Scrolling Contents Layer"; |
| 3334 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
| 3335 name = "Decoration Layer"; |
3253 } else { | 3336 } else { |
3254 ASSERT_NOT_REACHED(); | 3337 ASSERT_NOT_REACHED(); |
3255 } | 3338 } |
3256 | 3339 |
3257 return name; | 3340 return name; |
3258 } | 3341 } |
3259 | 3342 |
3260 } // namespace blink | 3343 } // namespace blink |
OLD | NEW |