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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 m_graphicsLayer = nullptr; | 248 m_graphicsLayer = nullptr; |
249 m_foregroundLayer = nullptr; | 249 m_foregroundLayer = nullptr; |
250 m_backgroundLayer = nullptr; | 250 m_backgroundLayer = nullptr; |
251 m_childContainmentLayer = nullptr; | 251 m_childContainmentLayer = nullptr; |
252 m_childTransformLayer = nullptr; | 252 m_childTransformLayer = nullptr; |
253 m_maskLayer = nullptr; | 253 m_maskLayer = nullptr; |
254 m_childClippingMaskLayer = nullptr; | 254 m_childClippingMaskLayer = nullptr; |
255 | 255 |
256 m_scrollingLayer = nullptr; | 256 m_scrollingLayer = nullptr; |
257 m_scrollingContentsLayer = nullptr; | 257 m_scrollingContentsLayer = nullptr; |
258 m_scrollingBlockSelectionLayer = nullptr; | |
259 } | 258 } |
260 | 259 |
261 void CompositedLayerMapping::updateOpacity(const ComputedStyle& style) | 260 void CompositedLayerMapping::updateOpacity(const ComputedStyle& style) |
262 { | 261 { |
263 m_graphicsLayer->setOpacity(compositingOpacity(style.opacity())); | 262 m_graphicsLayer->setOpacity(compositingOpacity(style.opacity())); |
264 } | 263 } |
265 | 264 |
266 void CompositedLayerMapping::updateTransform(const ComputedStyle& style) | 265 void CompositedLayerMapping::updateTransform(const ComputedStyle& style) |
267 { | 266 { |
268 // FIXME: This could use m_owningLayer.transform(), but that currently has t
ransform-origin | 267 // FIXME: This could use m_owningLayer.transform(), but that currently has t
ransform-origin |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 m_scrollingContentsLayer->setSize(FloatSize(scrollSize)); | 993 m_scrollingContentsLayer->setSize(FloatSize(scrollSize)); |
995 // FIXME: The paint offset and the scroll offset should really be separate c
oncepts. | 994 // FIXME: The paint offset and the scroll offset should really be separate c
oncepts. |
996 m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(scrollingContentsO
ffset, GraphicsLayer::DontSetNeedsDisplay); | 995 m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(scrollingContentsO
ffset, GraphicsLayer::DontSetNeedsDisplay); |
997 | 996 |
998 if (m_foregroundLayer) { | 997 if (m_foregroundLayer) { |
999 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) | 998 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) |
1000 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); | 999 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); |
1001 m_foregroundLayer->setNeedsDisplay(); | 1000 m_foregroundLayer->setNeedsDisplay(); |
1002 m_foregroundLayer->setOffsetFromLayoutObject(m_scrollingContentsLayer->o
ffsetFromLayoutObject()); | 1001 m_foregroundLayer->setOffsetFromLayoutObject(m_scrollingContentsLayer->o
ffsetFromLayoutObject()); |
1003 } | 1002 } |
1004 | |
1005 updateScrollingBlockSelection(); | |
1006 } | 1003 } |
1007 | 1004 |
1008 void CompositedLayerMapping::updateChildClippingMaskLayerGeometry() | 1005 void CompositedLayerMapping::updateChildClippingMaskLayerGeometry() |
1009 { | 1006 { |
1010 if (!m_childClippingMaskLayer || !layoutObject()->style()->clipPath()) | 1007 if (!m_childClippingMaskLayer || !layoutObject()->style()->clipPath()) |
1011 return; | 1008 return; |
1012 LayoutBox* layoutBox = toLayoutBox(layoutObject()); | 1009 LayoutBox* layoutBox = toLayoutBox(layoutObject()); |
1013 IntRect clientBox = enclosingIntRect(layoutBox->clientBoxRect()); | 1010 IntRect clientBox = enclosingIntRect(layoutBox->clientBoxRect()); |
1014 | 1011 |
1015 m_childClippingMaskLayer->setPosition(m_graphicsLayer->position()); | 1012 m_childClippingMaskLayer->setPosition(m_graphicsLayer->position()); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 } | 1140 } |
1144 | 1141 |
1145 void CompositedLayerMapping::updatePaintingPhases() | 1142 void CompositedLayerMapping::updatePaintingPhases() |
1146 { | 1143 { |
1147 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); | 1144 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); |
1148 if (m_scrollingContentsLayer) { | 1145 if (m_scrollingContentsLayer) { |
1149 GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowConten
ts | GraphicsLayerPaintCompositedScroll; | 1146 GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowConten
ts | GraphicsLayerPaintCompositedScroll; |
1150 if (!m_foregroundLayer) | 1147 if (!m_foregroundLayer) |
1151 paintPhase |= GraphicsLayerPaintForeground; | 1148 paintPhase |= GraphicsLayerPaintForeground; |
1152 m_scrollingContentsLayer->setPaintingPhase(paintPhase); | 1149 m_scrollingContentsLayer->setPaintingPhase(paintPhase); |
1153 if (m_scrollingBlockSelectionLayer) | |
1154 m_scrollingBlockSelectionLayer->setPaintingPhase(paintPhase); | |
1155 } | 1150 } |
1156 } | 1151 } |
1157 | 1152 |
1158 void CompositedLayerMapping::updateContentsRect() | 1153 void CompositedLayerMapping::updateContentsRect() |
1159 { | 1154 { |
1160 m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox())); | 1155 m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox())); |
1161 } | 1156 } |
1162 | 1157 |
1163 void CompositedLayerMapping::updateContentsOffsetInCompositingLayer(const IntPoi
nt& snappedOffsetFromCompositedAncestor, const IntPoint& graphicsLayerParentLoca
tion) | 1158 void CompositedLayerMapping::updateContentsOffsetInCompositingLayer(const IntPoi
nt& snappedOffsetFromCompositedAncestor, const IntPoint& graphicsLayerParentLoca
tion) |
1164 { | 1159 { |
(...skipping 26 matching lines...) Expand all Loading... |
1191 // graphics layers. | 1186 // graphics layers. |
1192 // | 1187 // |
1193 // And drawing of composited children takes into account the subpixel | 1188 // And drawing of composited children takes into account the subpixel |
1194 // accumulation of this CLM already (through its own | 1189 // accumulation of this CLM already (through its own |
1195 // graphicsLayerParentLocation it appears). | 1190 // graphicsLayerParentLocation it appears). |
1196 FloatPoint offsetDueToAncestorGraphicsLayers = m_graphicsLayer->position() +
graphicsLayerParentLocation; | 1191 FloatPoint offsetDueToAncestorGraphicsLayers = m_graphicsLayer->position() +
graphicsLayerParentLocation; |
1197 m_contentOffsetInCompositingLayer = LayoutSize(snappedOffsetFromCompositedAn
cestor - offsetDueToAncestorGraphicsLayers); | 1192 m_contentOffsetInCompositingLayer = LayoutSize(snappedOffsetFromCompositedAn
cestor - offsetDueToAncestorGraphicsLayers); |
1198 m_contentOffsetInCompositingLayerDirty = false; | 1193 m_contentOffsetInCompositingLayerDirty = false; |
1199 } | 1194 } |
1200 | 1195 |
1201 void CompositedLayerMapping::updateScrollingBlockSelection() | |
1202 { | |
1203 if (RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEnabled()) | |
1204 return; | |
1205 | |
1206 if (!m_scrollingBlockSelectionLayer) | |
1207 return; | |
1208 | |
1209 if (!m_scrollingContentsAreEmpty) { | |
1210 // In this case, the selection will be painted directly into m_scrolling
ContentsLayer. | |
1211 m_scrollingBlockSelectionLayer->setDrawsContent(false); | |
1212 return; | |
1213 } | |
1214 | |
1215 const IntRect blockSelectionGapsBounds = m_owningLayer.blockSelectionGapsBou
nds(); | |
1216 const bool shouldDrawContent = !blockSelectionGapsBounds.isEmpty(); | |
1217 m_scrollingBlockSelectionLayer->setDrawsContent(shouldDrawContent); | |
1218 if (!shouldDrawContent) | |
1219 return; | |
1220 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283. | |
1221 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi
ze(m_owningLayer.scrollableArea()->adjustedScrollOffset()); | |
1222 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size(
) && m_scrollingBlockSelectionLayer->position() == position) | |
1223 return; | |
1224 | |
1225 m_scrollingBlockSelectionLayer->setPosition(position); | |
1226 m_scrollingBlockSelectionLayer->setSize(FloatSize(blockSelectionGapsBounds.s
ize())); | |
1227 m_scrollingBlockSelectionLayer->setOffsetFromLayoutObject(toIntSize(blockSel
ectionGapsBounds.location()), GraphicsLayer::SetNeedsDisplay); | |
1228 } | |
1229 | |
1230 void CompositedLayerMapping::updateDrawsContent() | 1196 void CompositedLayerMapping::updateDrawsContent() |
1231 { | 1197 { |
1232 bool hasPaintedContent = containsPaintedContent(); | 1198 bool hasPaintedContent = containsPaintedContent(); |
1233 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 1199 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
1234 | 1200 |
1235 if (m_scrollingLayer) { | 1201 if (m_scrollingLayer) { |
1236 // m_scrollingLayer never has backing store. | 1202 // m_scrollingLayer never has backing store. |
1237 // m_scrollingContentsLayer only needs backing store if the scrolled con
tents need to paint. | 1203 // m_scrollingContentsLayer only needs backing store if the scrolled con
tents need to paint. |
1238 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(la
youtObject()->hasBackground() || paintsChildren()); | 1204 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(la
youtObject()->hasBackground() || paintsChildren()); |
1239 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); | 1205 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); |
1240 updateScrollingBlockSelection(); | |
1241 } | 1206 } |
1242 | 1207 |
1243 if (hasPaintedContent && isAcceleratedCanvas(layoutObject())) { | 1208 if (hasPaintedContent && isAcceleratedCanvas(layoutObject())) { |
1244 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no
de())->renderingContext(); | 1209 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no
de())->renderingContext(); |
1245 // Content layer may be null if context is lost. | 1210 // Content layer may be null if context is lost. |
1246 if (WebLayer* contentLayer = context->platformLayer()) { | 1211 if (WebLayer* contentLayer = context->platformLayer()) { |
1247 Color bgColor(Color::transparent); | 1212 Color bgColor(Color::transparent); |
1248 if (contentLayerSupportsDirectBackgroundComposition(layoutObject()))
{ | 1213 if (contentLayerSupportsDirectBackgroundComposition(layoutObject()))
{ |
1249 bgColor = layoutObjectBackgroundColor(); | 1214 bgColor = layoutObjectBackgroundColor(); |
1250 hasPaintedContent = false; | 1215 hasPaintedContent = false; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 ASSERT(mode); | 1387 ASSERT(mode); |
1423 | 1388 |
1424 if ((mode & ApplyToLayersAffectedByPreserve3D) && mapping->childTransformLay
er()) | 1389 if ((mode & ApplyToLayersAffectedByPreserve3D) && mapping->childTransformLay
er()) |
1425 f(mapping->childTransformLayer()); | 1390 f(mapping->childTransformLayer()); |
1426 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->mainGraphicsLayer()) | 1391 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->mainGraphicsLayer()) |
1427 f(mapping->mainGraphicsLayer()); | 1392 f(mapping->mainGraphicsLayer()); |
1428 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->clippingLayer()) | 1393 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->clippingLayer()) |
1429 f(mapping->clippingLayer()); | 1394 f(mapping->clippingLayer()); |
1430 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingLayer()) | 1395 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingLayer()) |
1431 f(mapping->scrollingLayer()); | 1396 f(mapping->scrollingLayer()); |
1432 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildConta
iningLayers)) && mapping->scrollingBlockSelectionLayer()) | |
1433 f(mapping->scrollingBlockSelectionLayer()); | |
1434 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingContentsLaye
r()) | 1397 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingContentsLaye
r()) |
1435 f(mapping->scrollingContentsLayer()); | 1398 f(mapping->scrollingContentsLayer()); |
1436 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->foregroundLayer()) | 1399 if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLay
ers)) && mapping->foregroundLayer()) |
1437 f(mapping->foregroundLayer()); | 1400 f(mapping->foregroundLayer()); |
1438 | 1401 |
1439 if ((mode & ApplyToChildContainingLayers) && mapping->childTransformLayer()) | 1402 if ((mode & ApplyToChildContainingLayers) && mapping->childTransformLayer()) |
1440 f(mapping->childTransformLayer()); | 1403 f(mapping->childTransformLayer()); |
1441 | 1404 |
1442 if ((mode & ApplyToSquashingLayer) && mapping->squashingLayer()) | 1405 if ((mode & ApplyToSquashingLayer) && mapping->squashingLayer()) |
1443 f(mapping->squashingLayer()); | 1406 f(mapping->squashingLayer()); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 }, ApplyToChildContainingLayers); | 1471 }, ApplyToChildContainingLayers); |
1509 } | 1472 } |
1510 | 1473 |
1511 // Regardless, mark the graphics layer, scrolling layer and scrolling block | 1474 // Regardless, mark the graphics layer, scrolling layer and scrolling block |
1512 // selection layer (if they exist) as not flattening. Having them flatten | 1475 // selection layer (if they exist) as not flattening. Having them flatten |
1513 // causes unclipped render surfaces which cause bugs. | 1476 // causes unclipped render surfaces which cause bugs. |
1514 // http://crbug.com/521768 | 1477 // http://crbug.com/521768 |
1515 if (hasScrollingLayer()) { | 1478 if (hasScrollingLayer()) { |
1516 m_graphicsLayer->setShouldFlattenTransform(false); | 1479 m_graphicsLayer->setShouldFlattenTransform(false); |
1517 m_scrollingLayer->setShouldFlattenTransform(false); | 1480 m_scrollingLayer->setShouldFlattenTransform(false); |
1518 if (m_scrollingBlockSelectionLayer) | |
1519 m_scrollingBlockSelectionLayer->setShouldFlattenTransform(false); | |
1520 } | 1481 } |
1521 } | 1482 } |
1522 | 1483 |
1523 void CompositedLayerMapping::updateElementIdAndCompositorMutableProperties() | 1484 void CompositedLayerMapping::updateElementIdAndCompositorMutableProperties() |
1524 { | 1485 { |
1525 if (!RuntimeEnabledFeatures::compositorWorkerEnabled()) | 1486 if (!RuntimeEnabledFeatures::compositorWorkerEnabled()) |
1526 return; | 1487 return; |
1527 | 1488 |
1528 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositedLaye
rMapping::updateElementId()"); | 1489 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositedLaye
rMapping::updateElementId()"); |
1529 | 1490 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 if (!m_scrollingLayer) { | 1593 if (!m_scrollingLayer) { |
1633 // Outer layer which corresponds with the scroll view. | 1594 // Outer layer which corresponds with the scroll view. |
1634 m_scrollingLayer = createGraphicsLayer(CompositingReasonLayerForScro
llingContainer); | 1595 m_scrollingLayer = createGraphicsLayer(CompositingReasonLayerForScro
llingContainer); |
1635 m_scrollingLayer->setDrawsContent(false); | 1596 m_scrollingLayer->setDrawsContent(false); |
1636 m_scrollingLayer->setMasksToBounds(true); | 1597 m_scrollingLayer->setMasksToBounds(true); |
1637 | 1598 |
1638 // Inner layer which renders the content that scrolls. | 1599 // Inner layer which renders the content that scrolls. |
1639 m_scrollingContentsLayer = createGraphicsLayer(CompositingReasonLaye
rForScrollingContents); | 1600 m_scrollingContentsLayer = createGraphicsLayer(CompositingReasonLaye
rForScrollingContents); |
1640 m_scrollingLayer->addChild(m_scrollingContentsLayer.get()); | 1601 m_scrollingLayer->addChild(m_scrollingContentsLayer.get()); |
1641 | 1602 |
1642 if (!RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEn
abled()) { | |
1643 m_scrollingBlockSelectionLayer = createGraphicsLayer(Compositing
ReasonLayerForScrollingBlockSelection); | |
1644 m_scrollingBlockSelectionLayer->setDrawsContent(true); | |
1645 m_scrollingContentsLayer->addChild(m_scrollingBlockSelectionLaye
r.get()); | |
1646 } | |
1647 | |
1648 layerChanged = true; | 1603 layerChanged = true; |
1649 if (scrollingCoordinator) { | 1604 if (scrollingCoordinator) { |
1650 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_ownin
gLayer.scrollableArea()); | 1605 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_ownin
gLayer.scrollableArea()); |
1651 scrollingCoordinator->scrollableAreasDidChange(); | 1606 scrollingCoordinator->scrollableAreasDidChange(); |
1652 } | 1607 } |
1653 } | 1608 } |
1654 } else if (m_scrollingLayer) { | 1609 } else if (m_scrollingLayer) { |
1655 m_scrollingLayer = nullptr; | 1610 m_scrollingLayer = nullptr; |
1656 m_scrollingContentsLayer = nullptr; | 1611 m_scrollingContentsLayer = nullptr; |
1657 m_scrollingBlockSelectionLayer = nullptr; | |
1658 layerChanged = true; | 1612 layerChanged = true; |
1659 if (scrollingCoordinator) { | 1613 if (scrollingCoordinator) { |
1660 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_owningLay
er.scrollableArea()); | 1614 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_owningLay
er.scrollableArea()); |
1661 scrollingCoordinator->scrollableAreasDidChange(); | 1615 scrollingCoordinator->scrollableAreasDidChange(); |
1662 } | 1616 } |
1663 } | 1617 } |
1664 | 1618 |
1665 return layerChanged; | 1619 return layerChanged; |
1666 } | 1620 } |
1667 | 1621 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 { | 1961 { |
2008 GraphicsLayer* host = m_overflowControlsAncestorClippingLayer.get(); | 1962 GraphicsLayer* host = m_overflowControlsAncestorClippingLayer.get(); |
2009 if (!host) | 1963 if (!host) |
2010 host = m_overflowControlsHostLayer.get(); | 1964 host = m_overflowControlsHostLayer.get(); |
2011 host->removeFromParent(); | 1965 host->removeFromParent(); |
2012 return host; | 1966 return host; |
2013 } | 1967 } |
2014 | 1968 |
2015 GraphicsLayer* CompositedLayerMapping::parentForSublayers() const | 1969 GraphicsLayer* CompositedLayerMapping::parentForSublayers() const |
2016 { | 1970 { |
2017 if (m_scrollingBlockSelectionLayer) | |
2018 return m_scrollingBlockSelectionLayer.get(); | |
2019 | |
2020 if (m_scrollingContentsLayer) | 1971 if (m_scrollingContentsLayer) |
2021 return m_scrollingContentsLayer.get(); | 1972 return m_scrollingContentsLayer.get(); |
2022 | 1973 |
2023 if (m_childContainmentLayer) | 1974 if (m_childContainmentLayer) |
2024 return m_childContainmentLayer.get(); | 1975 return m_childContainmentLayer.get(); |
2025 | 1976 |
2026 if (m_childTransformLayer) | 1977 if (m_childTransformLayer) |
2027 return m_childTransformLayer.get(); | 1978 return m_childTransformLayer.get(); |
2028 | 1979 |
2029 return m_graphicsLayer.get(); | 1980 return m_graphicsLayer.get(); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2370 if (graphicsLayer == m_backgroundLayer) | 2321 if (graphicsLayer == m_backgroundLayer) |
2371 paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPai
ntingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroun
dPhase to walk child layers. | 2322 paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPai
ntingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroun
dPhase to walk child layers. |
2372 else if (compositor()->fixedRootBackgroundLayer()) | 2323 else if (compositor()->fixedRootBackgroundLayer()) |
2373 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 2324 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
2374 | 2325 |
2375 if (graphicsLayer == m_graphicsLayer.get() | 2326 if (graphicsLayer == m_graphicsLayer.get() |
2376 || graphicsLayer == m_foregroundLayer.get() | 2327 || graphicsLayer == m_foregroundLayer.get() |
2377 || graphicsLayer == m_backgroundLayer.get() | 2328 || graphicsLayer == m_backgroundLayer.get() |
2378 || graphicsLayer == m_maskLayer.get() | 2329 || graphicsLayer == m_maskLayer.get() |
2379 || graphicsLayer == m_childClippingMaskLayer.get() | 2330 || graphicsLayer == m_childClippingMaskLayer.get() |
2380 || graphicsLayer == m_scrollingContentsLayer.get() | 2331 || graphicsLayer == m_scrollingContentsLayer.get()) { |
2381 || graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | |
2382 | 2332 |
2383 GraphicsLayerPaintInfo paintInfo; | 2333 GraphicsLayerPaintInfo paintInfo; |
2384 paintInfo.paintLayer = &m_owningLayer; | 2334 paintInfo.paintLayer = &m_owningLayer; |
2385 paintInfo.compositedBounds = compositedBounds(); | 2335 paintInfo.compositedBounds = compositedBounds(); |
2386 paintInfo.offsetFromLayoutObject = graphicsLayer->offsetFromLayoutObject
(); | 2336 paintInfo.offsetFromLayoutObject = graphicsLayer->offsetFromLayoutObject
(); |
2387 | 2337 |
2388 // We have to use the same root as for hit testing, because both methods
can compute and cache clipRects. | 2338 // We have to use the same root as for hit testing, because both methods
can compute and cache clipRects. |
2389 doPaintTask(paintInfo, *graphicsLayer, paintLayerFlags, context, interes
tRect); | 2339 doPaintTask(paintInfo, *graphicsLayer, paintLayerFlags, context, interes
tRect); |
2390 } else if (graphicsLayer == m_squashingLayer.get()) { | 2340 } else if (graphicsLayer == m_squashingLayer.get()) { |
2391 for (size_t i = 0; i < m_squashedLayers.size(); ++i) | 2341 for (size_t i = 0; i < m_squashedLayers.size(); ++i) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2575 } else if (graphicsLayer == m_layerForScrollCorner.get()) { | 2525 } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
2576 name = "Scroll Corner Layer"; | 2526 name = "Scroll Corner Layer"; |
2577 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { | 2527 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { |
2578 name = "Overflow Controls Host Layer"; | 2528 name = "Overflow Controls Host Layer"; |
2579 } else if (graphicsLayer == m_overflowControlsAncestorClippingLayer.get()) { | 2529 } else if (graphicsLayer == m_overflowControlsAncestorClippingLayer.get()) { |
2580 name = "Overflow Controls Ancestor Clipping Layer"; | 2530 name = "Overflow Controls Ancestor Clipping Layer"; |
2581 } else if (graphicsLayer == m_scrollingLayer.get()) { | 2531 } else if (graphicsLayer == m_scrollingLayer.get()) { |
2582 name = "Scrolling Layer"; | 2532 name = "Scrolling Layer"; |
2583 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2533 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2584 name = "Scrolling Contents Layer"; | 2534 name = "Scrolling Contents Layer"; |
2585 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | |
2586 name = "Scrolling Block Selection Layer"; | |
2587 } else { | 2535 } else { |
2588 ASSERT_NOT_REACHED(); | 2536 ASSERT_NOT_REACHED(); |
2589 } | 2537 } |
2590 | 2538 |
2591 return name; | 2539 return name; |
2592 } | 2540 } |
2593 | 2541 |
2594 } // namespace blink | 2542 } // namespace blink |
OLD | NEW |