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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1537133002: Renaming: distinguish ancestor, container and paintInvalidationContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SelectionInvalidation
Patch Set: Created 4 years, 12 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
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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 LayoutPoint offset; 846 LayoutPoint offset;
847 compositingContainer->convertToLayerCoords(compositingStackingCo ntext, offset); 847 compositingContainer->convertToLayerCoords(compositingStackingCo ntext, offset);
848 FloatSize offsetFromStackingContainer = toFloatSize(FloatPoint(o ffset)); 848 FloatSize offsetFromStackingContainer = toFloatSize(FloatPoint(o ffset));
849 position += offsetFromStackingContainer; 849 position += offsetFromStackingContainer;
850 } 850 }
851 851
852 m_overflowControlsAncestorClippingLayer->setPosition(position); 852 m_overflowControlsAncestorClippingLayer->setPosition(position);
853 } else { 853 } else {
854 // The controls are in the same 2D space as the compositing containe r, so we can map them into the space of the container. 854 // The controls are in the same 2D space as the compositing containe r, so we can map them into the space of the container.
855 TransformState transformState(TransformState::ApplyTransformDirectio n, FloatPoint()); 855 TransformState transformState(TransformState::ApplyTransformDirectio n, FloatPoint());
856 m_owningLayer.layoutObject()->mapLocalToContainer(compositingStackin gContext->layoutObject(), transformState, ApplyContainerFlip); 856 m_owningLayer.layoutObject()->mapLocalToAncestor(compositingStacking Context->layoutObject(), transformState, ApplyContainerFlip);
857 transformState.flatten(); 857 transformState.flatten();
858 hostLayerPosition = LayoutPoint(transformState.lastPlanarPoint()); 858 hostLayerPosition = LayoutPoint(transformState.lastPlanarPoint());
859 if (PaintLayerScrollableArea* scrollableArea = compositingStackingCo ntext->scrollableArea()) 859 if (PaintLayerScrollableArea* scrollableArea = compositingStackingCo ntext->scrollableArea())
860 hostLayerPosition.move(LayoutSize(scrollableArea->adjustedScroll Offset())); 860 hostLayerPosition.move(LayoutSize(scrollableArea->adjustedScroll Offset()));
861 } 861 }
862 } 862 }
863 863
864 // To clip correctly, m_overflowControlsHostLayer should match the border bo x rect, which is at 864 // To clip correctly, m_overflowControlsHostLayer should match the border bo x rect, which is at
865 // the origin of the LayoutObject. The parent is m_graphicsLayer, so we must adjust the position 865 // the origin of the LayoutObject. The parent is m_graphicsLayer, so we must adjust the position
866 // by the distance from m_graphicsLayer to the LayoutObject. 866 // by the distance from m_graphicsLayer to the LayoutObject.
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 2271
2272 // Start with the bounds of the graphics layer in the space of the anchor La youtObject. 2272 // Start with the bounds of the graphics layer in the space of the anchor La youtObject.
2273 FloatRect graphicsLayerBoundsInObjectSpace(graphicsLayerBounds); 2273 FloatRect graphicsLayerBoundsInObjectSpace(graphicsLayerBounds);
2274 graphicsLayerBoundsInObjectSpace.move(offsetFromAnchorLayoutObject); 2274 graphicsLayerBoundsInObjectSpace.move(offsetFromAnchorLayoutObject);
2275 2275
2276 // Now map the bounds to its visible content rect in screen space, including applying clips along the way. 2276 // Now map the bounds to its visible content rect in screen space, including applying clips along the way.
2277 LayoutRect visibleContentRect(graphicsLayerBoundsInObjectSpace); 2277 LayoutRect visibleContentRect(graphicsLayerBoundsInObjectSpace);
2278 LayoutView* rootView = anchorLayoutObject->view(); 2278 LayoutView* rootView = anchorLayoutObject->view();
2279 while (rootView->frame()->ownerLayoutObject()) 2279 while (rootView->frame()->ownerLayoutObject())
2280 rootView = rootView->frame()->ownerLayoutObject()->view(); 2280 rootView = rootView->frame()->ownerLayoutObject()->view();
2281 anchorLayoutObject->mapToVisibleRectInContainerSpace(rootView, visibleConten tRect, 0); 2281 anchorLayoutObject->mapToVisibleRectInAncestorSpace(rootView, visibleContent Rect, 0);
2282 visibleContentRect.intersect(LayoutRect(rootView->frameView()->visibleConten tRect())); 2282 visibleContentRect.intersect(LayoutRect(rootView->frameView()->visibleConten tRect()));
2283 2283
2284 // Map the visible content rect from screen space to local graphics layer sp ace. 2284 // Map the visible content rect from screen space to local graphics layer sp ace.
2285 IntRect localInterestRect; 2285 IntRect localInterestRect;
2286 // If the visible content rect is empty, then it makes no sense to map it ba ck since there is nothing to map. 2286 // If the visible content rect is empty, then it makes no sense to map it ba ck since there is nothing to map.
2287 if (!visibleContentRect.isEmpty()) { 2287 if (!visibleContentRect.isEmpty()) {
2288 localInterestRect = anchorLayoutObject->absoluteToLocalQuad(FloatRect(vi sibleContentRect), UseTransforms | TraverseDocumentBoundaries).enclosingBounding Box(); 2288 localInterestRect = anchorLayoutObject->absoluteToLocalQuad(FloatRect(vi sibleContentRect), UseTransforms | TraverseDocumentBoundaries).enclosingBounding Box();
2289 localInterestRect.move(-offsetFromAnchorLayoutObject); 2289 localInterestRect.move(-offsetFromAnchorLayoutObject);
2290 } 2290 }
2291 // Expand by interest rect padding amount. 2291 // Expand by interest rect padding amount.
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2598 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2599 name = "Scrolling Block Selection Layer"; 2599 name = "Scrolling Block Selection Layer";
2600 } else { 2600 } else {
2601 ASSERT_NOT_REACHED(); 2601 ASSERT_NOT_REACHED();
2602 } 2602 }
2603 2603
2604 return name; 2604 return name;
2605 } 2605 }
2606 2606
2607 } // namespace blink 2607 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698