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

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

Issue 1516683002: Introducing LayoutObject::mapToVisibleRectInContainerSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix flipping logic Created 5 years 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 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2280 2280
2281 // Start with the bounds of the graphics layer in the space of the anchor La youtObject. 2281 // Start with the bounds of the graphics layer in the space of the anchor La youtObject.
2282 FloatRect graphicsLayerBoundsInObjectSpace(graphicsLayerBounds); 2282 FloatRect graphicsLayerBoundsInObjectSpace(graphicsLayerBounds);
2283 graphicsLayerBoundsInObjectSpace.move(offsetFromAnchorLayoutObject); 2283 graphicsLayerBoundsInObjectSpace.move(offsetFromAnchorLayoutObject);
2284 2284
2285 // Now map the bounds to its visible content rect in screen space, including applying clips along the way. 2285 // Now map the bounds to its visible content rect in screen space, including applying clips along the way.
2286 LayoutRect visibleContentRect(graphicsLayerBoundsInObjectSpace); 2286 LayoutRect visibleContentRect(graphicsLayerBoundsInObjectSpace);
2287 LayoutView* rootView = anchorLayoutObject->view(); 2287 LayoutView* rootView = anchorLayoutObject->view();
2288 while (rootView->frame()->ownerLayoutObject()) 2288 while (rootView->frame()->ownerLayoutObject())
2289 rootView = rootView->frame()->ownerLayoutObject()->view(); 2289 rootView = rootView->frame()->ownerLayoutObject()->view();
2290 anchorLayoutObject->mapRectToPaintInvalidationBacking(rootView, visibleConte ntRect, 0); 2290 anchorLayoutObject->mapToVisibleRectInContainerSpace(rootView, visibleConten tRect, 0);
2291 visibleContentRect.intersect(LayoutRect(rootView->frameView()->visibleConten tRect())); 2291 visibleContentRect.intersect(LayoutRect(rootView->frameView()->visibleConten tRect()));
2292 2292
2293 // Map the visible content rect from screen space to local graphics layer sp ace. 2293 // Map the visible content rect from screen space to local graphics layer sp ace.
2294 IntRect localInterestRect; 2294 IntRect localInterestRect;
2295 // If the visible content rect is empty, then it makes no sense to map it ba ck since there is nothing to map. 2295 // If the visible content rect is empty, then it makes no sense to map it ba ck since there is nothing to map.
2296 if (!visibleContentRect.isEmpty()) { 2296 if (!visibleContentRect.isEmpty()) {
2297 localInterestRect = anchorLayoutObject->absoluteToLocalQuad(FloatRect(vi sibleContentRect), UseTransforms | TraverseDocumentBoundaries).enclosingBounding Box(); 2297 localInterestRect = anchorLayoutObject->absoluteToLocalQuad(FloatRect(vi sibleContentRect), UseTransforms | TraverseDocumentBoundaries).enclosingBounding Box();
2298 localInterestRect.move(-offsetFromAnchorLayoutObject); 2298 localInterestRect.move(-offsetFromAnchorLayoutObject);
2299 } 2299 }
2300 // Expand by interest rect padding amount. 2300 // Expand by interest rect padding amount.
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2602 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2603 name = "Scrolling Block Selection Layer"; 2603 name = "Scrolling Block Selection Layer";
2604 } else { 2604 } else {
2605 ASSERT_NOT_REACHED(); 2605 ASSERT_NOT_REACHED();
2606 } 2606 }
2607 2607
2608 return name; 2608 return name;
2609 } 2609 }
2610 2610
2611 } // namespace blink 2611 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698