Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: Source/core/rendering/RenderLayerBacking.cpp

Issue 23903012: Set up scroll and clip parents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressing enne's review. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (page && page->mainFrame() == &frame) { 164 if (page && page->mainFrame() == &frame) {
165 m_isMainFrameRenderViewLayer = true; 165 m_isMainFrameRenderViewLayer = true;
166 } 166 }
167 } 167 }
168 168
169 createPrimaryGraphicsLayer(); 169 createPrimaryGraphicsLayer();
170 } 170 }
171 171
172 RenderLayerBacking::~RenderLayerBacking() 172 RenderLayerBacking::~RenderLayerBacking()
173 { 173 {
174 updateClippingLayers(false, false); 174 updateClippingLayers(false, false, false);
175 updateOverflowControlsLayers(false, false, false); 175 updateOverflowControlsLayers(false, false, false);
176 updateForegroundLayer(false); 176 updateForegroundLayer(false);
177 updateBackgroundLayer(false); 177 updateBackgroundLayer(false);
178 updateMaskLayer(false); 178 updateMaskLayer(false);
179 updateScrollingLayers(false); 179 updateScrollingLayers(false);
180 destroyGraphicsLayers(); 180 destroyGraphicsLayers();
181 } 181 }
182 182
183 PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(CompositingRea sons reasons) 183 PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(CompositingRea sons reasons)
184 { 184 {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(m_owning Layer))) 412 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(m_owning Layer)))
413 layerConfigChanged = true; 413 layerConfigChanged = true;
414 414
415 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants (m_owningLayer); 415 bool needsDescendentsClippingLayer = compositor->clipsCompositingDescendants (m_owningLayer);
416 416
417 // Our scrolling layer will clip. 417 // Our scrolling layer will clip.
418 if (m_owningLayer->needsCompositedScrolling()) 418 if (m_owningLayer->needsCompositedScrolling())
419 needsDescendentsClippingLayer = false; 419 needsDescendentsClippingLayer = false;
420 420
421 if (updateClippingLayers(compositor->clippedByAncestor(m_owningLayer), needs DescendentsClippingLayer)) 421 RenderLayer* scrollParent = m_owningLayer->scrollParent();
422 bool needsAncestorClip = compositor->clippedByAncestor(m_owningLayer);
423 bool needsScrollClip = !!scrollParent;
424 if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer, n eedsScrollClip))
422 layerConfigChanged = true; 425 layerConfigChanged = true;
423 426
424 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require sVerticalScrollbarLayer(), requiresScrollCornerLayer())) 427 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require sVerticalScrollbarLayer(), requiresScrollCornerLayer()))
425 layerConfigChanged = true; 428 layerConfigChanged = true;
426 429
427 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling())) 430 if (updateScrollingLayers(m_owningLayer->needsCompositedScrolling()))
428 layerConfigChanged = true; 431 layerConfigChanged = true;
429 432
433 updateScrollParent(scrollParent);
434 updateClipParent(m_owningLayer->clipParent());
435
430 if (layerConfigChanged) 436 if (layerConfigChanged)
431 updateInternalHierarchy(); 437 updateInternalHierarchy();
432 438
433 if (updateMaskLayer(renderer->hasMask())) 439 if (updateMaskLayer(renderer->hasMask()))
434 m_graphicsLayer->setMaskLayer(m_maskLayer.get()); 440 m_graphicsLayer->setMaskLayer(m_maskLayer.get());
435 441
436 if (m_owningLayer->hasReflection()) { 442 if (m_owningLayer->hasReflection()) {
437 if (m_owningLayer->reflectionLayer()->backing()) { 443 if (m_owningLayer->reflectionLayer()->backing()) {
438 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->b acking()->graphicsLayer(); 444 GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->b acking()->graphicsLayer();
439 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); 445 m_graphicsLayer->setReplicatedByLayer(reflectionLayer);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 else 542 else
537 graphicsLayerParentLocation = renderer()->view()->documentRect().locatio n(); 543 graphicsLayerParentLocation = renderer()->view()->documentRect().locatio n();
538 544
539 if (compAncestor && compAncestor->needsCompositedScrolling()) { 545 if (compAncestor && compAncestor->needsCompositedScrolling()) {
540 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); 546 RenderBox* renderBox = toRenderBox(compAncestor->renderer());
541 IntSize scrollOffset = compAncestor->scrolledContentOffset(); 547 IntSize scrollOffset = compAncestor->scrolledContentOffset();
542 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); 548 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop());
543 graphicsLayerParentLocation = scrollOrigin - scrollOffset; 549 graphicsLayerParentLocation = scrollOrigin - scrollOffset;
544 } 550 }
545 551
552 if (compAncestor && m_ancestorScrollClippingLayer) {
553 // Our scroll parent must have been processed before us. The code in Ren derLayerCompositor
554 // that coordinates updating graphics layer geometry has been set up to guarantee that this is the case.
555 RenderLayer* scrollParent = m_owningLayer->ancestorScrollingLayer();
556 GraphicsLayer* scrollParentClippingLayer = scrollParent->backing()->scro llingLayer();
557
558 // Not relative to our parent graphics layer.
559 FloatPoint position;
560 GraphicsLayer* scrollParentChildForSuperlayers = scrollParent->backing() ->childForSuperlayers();
561
562 for (GraphicsLayer* scrollAncestor = scrollParentClippingLayer; scrollAn cestor; scrollAncestor = scrollAncestor->parent()) {
563 ASSERT(scrollAncestor->transform().isIdentity());
564 position = position + toFloatSize(scrollAncestor->position());
565 if (scrollAncestor == scrollParentChildForSuperlayers)
566 break;
567 }
568
569 m_ancestorScrollClippingLayer->setPosition(position);
570 m_ancestorScrollClippingLayer->setSize(scrollParentClippingLayer->size() );
571 m_ancestorScrollClippingLayer->setOffsetFromRenderer(toIntSize(roundedIn tPoint(-position)));
572
573 graphicsLayerParentLocation = roundedIntPoint(position);
574 }
575
546 if (compAncestor && m_ancestorClippingLayer) { 576 if (compAncestor && m_ancestorClippingLayer) {
547 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this 577 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this
548 // layer. Note that we call it with temporaryClipRects = true because no rmally when computing clip rects 578 // layer. Note that we call it with temporaryClipRects = true because no rmally when computing clip rects
549 // for a compositing layer, rootLayer is the layer itself. 579 // for a compositing layer, rootLayer is the layer itself.
550 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip); 580 RenderLayer::ClipRectsContext clipRectsContext(compAncestor, 0, Temporar yClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip);
551 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. 581 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundCl ipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions.
552 ASSERT(parentClipRect != PaintInfo::infiniteRect()); 582 ASSERT(parentClipRect != PaintInfo::infiniteRect());
553 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation)); 583 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation));
554 m_ancestorClippingLayer->setSize(parentClipRect.size()); 584 m_ancestorClippingLayer->setSize(parentClipRect.size());
555 585
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 772
743 // Page scale is applied as a transform on the root render view layer. Becau se the scroll 773 // Page scale is applied as a transform on the root render view layer. Becau se the scroll
744 // layer is further up in the hierarchy, we need to avoid marking the root r ender view 774 // layer is further up in the hierarchy, we need to avoid marking the root r ender view
745 // layer as a container. 775 // layer as a container.
746 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa yer(); 776 bool isContainer = m_owningLayer->hasTransform() && !m_owningLayer->isRootLa yer();
747 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer); 777 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer);
748 } 778 }
749 779
750 void RenderLayerBacking::updateInternalHierarchy() 780 void RenderLayerBacking::updateInternalHierarchy()
751 { 781 {
782 if (m_ancestorScrollClippingLayer)
783 m_ancestorScrollClippingLayer->removeAllChildren();
784
752 // m_foregroundLayer has to be inserted in the correct order with child laye rs, 785 // m_foregroundLayer has to be inserted in the correct order with child laye rs,
753 // so it's not inserted here. 786 // so it's not inserted here.
754 if (m_ancestorClippingLayer) 787 if (m_ancestorClippingLayer)
755 m_ancestorClippingLayer->removeAllChildren(); 788 m_ancestorClippingLayer->removeAllChildren();
756 789
757 m_graphicsLayer->removeFromParent(); 790 m_graphicsLayer->removeFromParent();
758 791
759 if (m_ancestorClippingLayer) 792 if (m_ancestorClippingLayer)
760 m_ancestorClippingLayer->addChild(m_graphicsLayer.get()); 793 m_ancestorClippingLayer->addChild(m_graphicsLayer.get());
761 794
795 if (m_ancestorScrollClippingLayer) {
796 if (m_ancestorClippingLayer)
797 m_ancestorScrollClippingLayer->addChild(m_ancestorClippingLayer.get( ));
798 else
799 m_ancestorScrollClippingLayer->addChild(m_graphicsLayer.get());
800 }
801
762 if (m_childContainmentLayer) { 802 if (m_childContainmentLayer) {
763 m_childContainmentLayer->removeFromParent(); 803 m_childContainmentLayer->removeFromParent();
764 m_graphicsLayer->addChild(m_childContainmentLayer.get()); 804 m_graphicsLayer->addChild(m_childContainmentLayer.get());
765 } 805 }
766 806
767 if (m_scrollingLayer) { 807 if (m_scrollingLayer) {
768 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment Layer.get() : m_graphicsLayer.get(); 808 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainment Layer.get() : m_graphicsLayer.get();
769 m_scrollingLayer->removeFromParent(); 809 m_scrollingLayer->removeFromParent();
770 superlayer->addChild(m_scrollingLayer.get()); 810 superlayer->addChild(m_scrollingLayer.get());
771 } 811 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 // FIXME: we could refine this to only allocate backing for one of these lay ers if possible. 870 // FIXME: we could refine this to only allocate backing for one of these lay ers if possible.
831 m_graphicsLayer->setDrawsContent(hasPaintedContent); 871 m_graphicsLayer->setDrawsContent(hasPaintedContent);
832 if (m_foregroundLayer) 872 if (m_foregroundLayer)
833 m_foregroundLayer->setDrawsContent(hasPaintedContent); 873 m_foregroundLayer->setDrawsContent(hasPaintedContent);
834 874
835 if (m_backgroundLayer) 875 if (m_backgroundLayer)
836 m_backgroundLayer->setDrawsContent(hasPaintedContent); 876 m_backgroundLayer->setDrawsContent(hasPaintedContent);
837 } 877 }
838 878
839 // Return true if the layers changed. 879 // Return true if the layers changed.
840 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs DescendantClip) 880 bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs DescendantClip, bool needsScrollClip)
841 { 881 {
842 bool layersChanged = false; 882 bool layersChanged = false;
843 883
844 if (needsAncestorClip) { 884 if (needsAncestorClip) {
845 if (!m_ancestorClippingLayer) { 885 if (!m_ancestorClippingLayer) {
846 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer ForClip); 886 m_ancestorClippingLayer = createGraphicsLayer(CompositingReasonLayer ForClip);
847 m_ancestorClippingLayer->setMasksToBounds(true); 887 m_ancestorClippingLayer->setMasksToBounds(true);
848 layersChanged = true; 888 layersChanged = true;
849 } 889 }
850 } else if (m_ancestorClippingLayer) { 890 } else if (m_ancestorClippingLayer) {
851 m_ancestorClippingLayer->removeFromParent(); 891 m_ancestorClippingLayer->removeFromParent();
852 m_ancestorClippingLayer = nullptr; 892 m_ancestorClippingLayer = nullptr;
853 layersChanged = true; 893 layersChanged = true;
854 } 894 }
855 895
856 if (needsDescendantClip) { 896 if (needsDescendantClip) {
857 // We don't need a child containment layer if we're the main frame rende r view 897 // We don't need a child containment layer if we're the main frame rende r view
858 // layer. It's redundant as the frame clip above us will handle this cli pping. 898 // layer. It's redundant as the frame clip above us will handle this cli pping.
859 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) { 899 if (!m_childContainmentLayer && !m_isMainFrameRenderViewLayer) {
860 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer ForClip); 900 m_childContainmentLayer = createGraphicsLayer(CompositingReasonLayer ForClip);
861 m_childContainmentLayer->setMasksToBounds(true); 901 m_childContainmentLayer->setMasksToBounds(true);
862 layersChanged = true; 902 layersChanged = true;
863 } 903 }
864 } else if (hasClippingLayer()) { 904 } else if (hasClippingLayer()) {
865 m_childContainmentLayer->removeFromParent(); 905 m_childContainmentLayer->removeFromParent();
866 m_childContainmentLayer = nullptr; 906 m_childContainmentLayer = nullptr;
867 layersChanged = true; 907 layersChanged = true;
868 } 908 }
869 909
910 if (needsScrollClip) {
911 if (!m_ancestorScrollClippingLayer) {
912 m_ancestorScrollClippingLayer = createGraphicsLayer(CompositingReaso nLayerForClip);
913 m_ancestorScrollClippingLayer->setMasksToBounds(true);
914 layersChanged = true;
915 }
916 } else if (m_ancestorScrollClippingLayer) {
917 m_ancestorScrollClippingLayer->removeFromParent();
918 m_ancestorScrollClippingLayer = nullptr;
919 layersChanged = true;
920 }
921
870 return layersChanged; 922 return layersChanged;
871 } 923 }
872 924
873 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr oundLayerPaintsFixedRootBackground) 925 void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgr oundLayerPaintsFixedRootBackground)
874 { 926 {
875 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB ackground; 927 m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootB ackground;
876 } 928 }
877 929
878 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer) 930 bool RenderLayerBacking::updateOverflowControlsLayers(bool needsHorizontalScroll barLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer)
879 { 931 {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 updateInternalHierarchy(); 1134 updateInternalHierarchy();
1083 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); 1135 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer());
1084 m_graphicsLayer->setNeedsDisplay(); 1136 m_graphicsLayer->setNeedsDisplay();
1085 if (renderer()->view()) 1137 if (renderer()->view())
1086 compositor()->scrollingLayerDidChange(m_owningLayer); 1138 compositor()->scrollingLayerDidChange(m_owningLayer);
1087 } 1139 }
1088 1140
1089 return layerChanged; 1141 return layerChanged;
1090 } 1142 }
1091 1143
1144 void RenderLayerBacking::updateScrollParent(RenderLayer* scrollParent)
1145 {
1146 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer))
1147 scrollingCoordinator->updateScrollParentForLayer(m_owningLayer, scrollPa rent);
1148 }
1149
1150 void RenderLayerBacking::updateClipParent(RenderLayer* clipParent)
1151 {
1152 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer))
1153 scrollingCoordinator->updateClipParentForLayer(m_owningLayer, clipParent );
1154 }
1155
1092 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co nst 1156 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co nst
1093 { 1157 {
1094 unsigned phase = 0; 1158 unsigned phase = 0;
1095 if (!m_backgroundLayer) 1159 if (!m_backgroundLayer)
1096 phase |= GraphicsLayerPaintBackground; 1160 phase |= GraphicsLayerPaintBackground;
1097 if (!m_foregroundLayer) 1161 if (!m_foregroundLayer)
1098 phase |= GraphicsLayerPaintForeground; 1162 phase |= GraphicsLayerPaintForeground;
1099 if (!m_maskLayer) 1163 if (!m_maskLayer)
1100 phase |= GraphicsLayerPaintMask; 1164 phase |= GraphicsLayerPaintMask;
1101 1165
1102 if (m_scrollingContentsLayer) { 1166 if (m_scrollingContentsLayer) {
1103 phase &= ~GraphicsLayerPaintForeground; 1167 phase &= ~GraphicsLayerPaintForeground;
1104 phase |= GraphicsLayerPaintCompositedScroll; 1168 phase |= GraphicsLayerPaintCompositedScroll;
1105 } 1169 }
1106 1170
1171 if (m_owningLayer->compositingReasons() & CompositingReasonOverflowScrolling Parent)
1172 phase |= GraphicsLayerPaintCompositedScroll;
1173
1107 return static_cast<GraphicsLayerPaintingPhase>(phase); 1174 return static_cast<GraphicsLayerPaintingPhase>(phase);
1108 } 1175 }
1109 1176
1110 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const 1177 float RenderLayerBacking::compositingOpacity(float rendererOpacity) const
1111 { 1178 {
1112 float finalOpacity = rendererOpacity; 1179 float finalOpacity = rendererOpacity;
1113 1180
1114 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent( )) { 1181 for (RenderLayer* curr = m_owningLayer->parent(); curr; curr = curr->parent( )) {
1115 // We only care about parents that are stacking contexts. 1182 // We only care about parents that are stacking contexts.
1116 // Recall that opacity creates stacking context. 1183 // Recall that opacity creates stacking context.
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 GraphicsLayer* RenderLayerBacking::parentForSublayers() const 1501 GraphicsLayer* RenderLayerBacking::parentForSublayers() const
1435 { 1502 {
1436 if (m_scrollingContentsLayer) 1503 if (m_scrollingContentsLayer)
1437 return m_scrollingContentsLayer.get(); 1504 return m_scrollingContentsLayer.get();
1438 1505
1439 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL ayer.get(); 1506 return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsL ayer.get();
1440 } 1507 }
1441 1508
1442 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const 1509 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const
1443 { 1510 {
1511 if (m_ancestorScrollClippingLayer)
1512 return m_ancestorScrollClippingLayer.get();
1513
1444 if (m_ancestorClippingLayer) 1514 if (m_ancestorClippingLayer)
1445 return m_ancestorClippingLayer.get(); 1515 return m_ancestorClippingLayer.get();
1446 1516
1447 return m_graphicsLayer.get(); 1517 return m_graphicsLayer.get();
1448 } 1518 }
1449 1519
1450 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) 1520 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
1451 { 1521 {
1452 if (requiresOwnBacking == m_requiresOwnBackingStore) 1522 if (requiresOwnBacking == m_requiresOwnBackingStore)
1453 return; 1523 return;
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate(); 1970 backingMemory += m_layerForScrollCorner->backingStoreMemoryEstimate();
1901 1971
1902 return backingMemory; 1972 return backingMemory;
1903 } 1973 }
1904 1974
1905 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer) 1975 String RenderLayerBacking::debugName(const GraphicsLayer* graphicsLayer)
1906 { 1976 {
1907 String name; 1977 String name;
1908 if (graphicsLayer == m_graphicsLayer.get()) { 1978 if (graphicsLayer == m_graphicsLayer.get()) {
1909 name = m_owningLayer->debugName(); 1979 name = m_owningLayer->debugName();
1980 } else if (graphicsLayer == m_ancestorScrollClippingLayer.get()) {
1981 name = "Ancestor Scroll Clipping Layer";
1910 } else if (graphicsLayer == m_ancestorClippingLayer.get()) { 1982 } else if (graphicsLayer == m_ancestorClippingLayer.get()) {
1911 name = "Ancestor Clipping Layer"; 1983 name = "Ancestor Clipping Layer";
1912 } else if (graphicsLayer == m_foregroundLayer.get()) { 1984 } else if (graphicsLayer == m_foregroundLayer.get()) {
1913 name = m_owningLayer->debugName() + " (foreground) Layer"; 1985 name = m_owningLayer->debugName() + " (foreground) Layer";
1914 } else if (graphicsLayer == m_backgroundLayer.get()) { 1986 } else if (graphicsLayer == m_backgroundLayer.get()) {
1915 name = m_owningLayer->debugName() + " (background) Layer"; 1987 name = m_owningLayer->debugName() + " (background) Layer";
1916 } else if (graphicsLayer == m_childContainmentLayer.get()) { 1988 } else if (graphicsLayer == m_childContainmentLayer.get()) {
1917 name = "Child Containment Layer"; 1989 name = "Child Containment Layer";
1918 } else if (graphicsLayer == m_maskLayer.get()) { 1990 } else if (graphicsLayer == m_maskLayer.get()) {
1919 name = "Mask Layer"; 1991 name = "Mask Layer";
1920 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { 1992 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) {
1921 name = "Horizontal Scrollbar Layer"; 1993 name = "Horizontal Scrollbar Layer";
1922 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { 1994 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) {
1923 name = "Vertical Scrollbar Layer"; 1995 name = "Vertical Scrollbar Layer";
1924 } else if (graphicsLayer == m_layerForScrollCorner.get()) { 1996 } else if (graphicsLayer == m_layerForScrollCorner.get()) {
1925 name = "Scroll Corner Layer"; 1997 name = "Scroll Corner Layer";
1926 } else if (graphicsLayer == m_scrollingLayer.get()) { 1998 } else if (graphicsLayer == m_scrollingLayer.get()) {
1927 name = "Scrolling Layer"; 1999 name = "Scrolling Layer";
1928 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2000 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
1929 name = "Scrolling Contents Layer"; 2001 name = "Scrolling Contents Layer";
1930 } else { 2002 } else {
1931 ASSERT_NOT_REACHED(); 2003 ASSERT_NOT_REACHED();
1932 } 2004 }
1933 2005
1934 return name; 2006 return name;
1935 } 2007 }
1936 2008
1937 } // namespace WebCore 2009 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698