Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2242 RenderBox* box = renderBox(); | 2242 RenderBox* box = renderBox(); |
| 2243 ASSERT(box); | 2243 ASSERT(box); |
| 2244 result = box->borderBoxRect(); | 2244 result = box->borderBoxRect(); |
| 2245 result.unite(box->visualOverflowRect()); | 2245 result.unite(box->visualOverflowRect()); |
| 2246 } | 2246 } |
| 2247 | 2247 |
| 2248 ASSERT(renderer()->view()); | 2248 ASSERT(renderer()->view()); |
| 2249 return result; | 2249 return result; |
| 2250 } | 2250 } |
| 2251 | 2251 |
| 2252 LayoutRect RenderLayer::flippedLogicalBoundingBox() const | 2252 static inline LayoutRect flippedLogicalBoundingBox(LayoutRect boundingBox, Rende rObject* renderer) |
|
pdr.
2014/10/21 22:11:26
I don't understand the purpose of making this a st
eae
2014/10/21 22:21:46
Allows it to be inlined easier. It is a very hot f
pdr.
2014/10/21 22:38:15
Could we just make this inline then?
| |
| 2253 { | 2253 { |
| 2254 LayoutRect result = logicalBoundingBox(); | 2254 if (!UNLIKELY(renderer->document().hasVerticalWritingMode())) |
| 2255 if (m_renderer->isBox()) | 2255 return boundingBox; |
| 2256 renderBox()->flipForWritingMode(result); | 2256 |
| 2257 LayoutRect result = boundingBox; | |
| 2258 if (renderer->isBox()) | |
| 2259 toRenderBox(renderer)->flipForWritingMode(result); | |
| 2257 else | 2260 else |
| 2258 m_renderer->containingBlock()->flipForWritingMode(result); | 2261 renderer->containingBlock()->flipForWritingMode(result); |
| 2259 return result; | 2262 return result; |
| 2260 } | 2263 } |
| 2261 | 2264 |
| 2262 LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, co nst LayoutPoint* offsetFromRoot) const | 2265 LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, co nst LayoutPoint* offsetFromRoot) const |
| 2263 { | 2266 { |
| 2264 LayoutRect result = flippedLogicalBoundingBox(); | 2267 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), renderer ()); |
| 2265 if (offsetFromRoot) | 2268 if (offsetFromRoot) |
| 2266 result.moveBy(*offsetFromRoot); | 2269 result.moveBy(*offsetFromRoot); |
| 2267 else | 2270 else |
| 2268 convertToLayerCoords(ancestorLayer, result); | 2271 convertToLayerCoords(ancestorLayer, result); |
| 2269 return result; | 2272 return result; |
| 2270 } | 2273 } |
| 2271 | 2274 |
| 2272 LayoutRect RenderLayer::fragmentsBoundingBox(const RenderLayer* ancestorLayer) c onst | 2275 LayoutRect RenderLayer::fragmentsBoundingBox(const RenderLayer* ancestorLayer) c onst |
| 2273 { | 2276 { |
| 2274 if (!enclosingPaginationLayer()) | 2277 if (!enclosingPaginationLayer()) |
| 2275 return physicalBoundingBox(ancestorLayer); | 2278 return physicalBoundingBox(ancestorLayer); |
| 2276 | 2279 |
| 2277 LayoutRect result = flippedLogicalBoundingBox(); | 2280 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), renderer ()); |
| 2278 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, resu lt); | 2281 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, resu lt); |
| 2279 return result; | 2282 return result; |
| 2280 } | 2283 } |
| 2281 | 2284 |
| 2285 LayoutRect RenderLayer::boundingBoxForCompositingOverlapTest() const | |
| 2286 { | |
| 2287 return overlapBoundsIncludeChildren() ? boundingBoxForCompositing() : flippe dLogicalBoundingBox(logicalBoundingBox(), renderer()); | |
| 2288 } | |
| 2289 | |
| 2282 static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancest orLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result) | 2290 static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancest orLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result) |
| 2283 { | 2291 { |
| 2284 if (ancestorLayer->reflectionInfo() && !ancestorLayer->reflectionInfo()->ref lectionLayer()->hasCompositedLayerMapping()) | 2292 if (ancestorLayer->reflectionInfo() && !ancestorLayer->reflectionInfo()->ref lectionLayer()->hasCompositedLayerMapping()) |
| 2285 result.unite(ancestorLayer->reflectionInfo()->reflectionLayer()->boundin gBoxForCompositing(ancestorLayer)); | 2293 result.unite(ancestorLayer->reflectionInfo()->reflectionLayer()->boundin gBoxForCompositing(ancestorLayer)); |
| 2286 | 2294 |
| 2287 ASSERT(ancestorLayer->stackingNode()->isStackingContext() || !ancestorLayer- >stackingNode()->hasPositiveZOrderList()); | 2295 ASSERT(ancestorLayer->stackingNode()->isStackingContext() || !ancestorLayer- >stackingNode()->hasPositiveZOrderList()); |
| 2288 | 2296 |
| 2289 #if ENABLE(ASSERT) | 2297 #if ENABLE(ASSERT) |
| 2290 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(ancestorL ayer)->stackingNode()); | 2298 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(ancestorL ayer)->stackingNode()); |
| 2291 #endif | 2299 #endif |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2863 } | 2871 } |
| 2864 } | 2872 } |
| 2865 | 2873 |
| 2866 void showLayerTree(const blink::RenderObject* renderer) | 2874 void showLayerTree(const blink::RenderObject* renderer) |
| 2867 { | 2875 { |
| 2868 if (!renderer) | 2876 if (!renderer) |
| 2869 return; | 2877 return; |
| 2870 showLayerTree(renderer->enclosingLayer()); | 2878 showLayerTree(renderer->enclosingLayer()); |
| 2871 } | 2879 } |
| 2872 #endif | 2880 #endif |
| OLD | NEW |