| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // Return true if this layer or any preserve-3d descendants have 3d. | 298 // Return true if this layer or any preserve-3d descendants have 3d. |
| 299 bool RenderLayer::update3DTransformedDescendantStatus() | 299 bool RenderLayer::update3DTransformedDescendantStatus() |
| 300 { | 300 { |
| 301 if (m_3DTransformedDescendantStatusDirty) { | 301 if (m_3DTransformedDescendantStatusDirty) { |
| 302 m_has3DTransformedDescendant = false; | 302 m_has3DTransformedDescendant = false; |
| 303 | 303 |
| 304 m_stackingNode->updateZOrderLists(); | 304 m_stackingNode->updateZOrderLists(); |
| 305 | 305 |
| 306 // Transformed or preserve-3d descendants can only be in the z-order lis
ts, not | 306 // Transformed or preserve-3d descendants can only be in the z-order lis
ts, not |
| 307 // in the normal flow list, so we only need to check those. | 307 // in the normal flow list, so we only need to check those. |
| 308 RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), Positive
ZOrderChildren | NegativeZOrderChildren); | 308 RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), Positive
ZOrderChildren); |
| 309 while (RenderLayerStackingNode* node = iterator.next()) | 309 while (RenderLayerStackingNode* node = iterator.next()) |
| 310 m_has3DTransformedDescendant |= node->layer()->update3DTransformedDe
scendantStatus(); | 310 m_has3DTransformedDescendant |= node->layer()->update3DTransformedDe
scendantStatus(); |
| 311 | 311 |
| 312 m_3DTransformedDescendantStatusDirty = false; | 312 m_3DTransformedDescendantStatusDirty = false; |
| 313 } | 313 } |
| 314 | 314 |
| 315 // If we live in a 3d hierarchy, then the layer at the root of that hierarch
y needs | 315 // If we live in a 3d hierarchy, then the layer at the root of that hierarch
y needs |
| 316 // the m_has3DTransformedDescendant set. | 316 // the m_has3DTransformedDescendant set. |
| 317 if (preserves3D()) | 317 if (preserves3D()) |
| 318 return has3DTransform() || m_has3DTransformedDescendant; | 318 return has3DTransform() || m_has3DTransformedDescendant; |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 // If this layer's renderer is a child of the paintingRoot, we render uncond
itionally, which | 1036 // If this layer's renderer is a child of the paintingRoot, we render uncond
itionally, which |
| 1037 // is done by passing a nil paintingRoot down to our renderer (as if no pain
tingRoot was ever set). | 1037 // is done by passing a nil paintingRoot down to our renderer (as if no pain
tingRoot was ever set). |
| 1038 // Else, our renderer tree may or may not contain the painting root, so we p
ass that root along | 1038 // Else, our renderer tree may or may not contain the painting root, so we p
ass that root along |
| 1039 // so it will be tested against as we descend through the renderers. | 1039 // so it will be tested against as we descend through the renderers. |
| 1040 RenderObject* paintingRootForRenderer = 0; | 1040 RenderObject* paintingRootForRenderer = 0; |
| 1041 if (localPaintingInfo.paintingRoot && !renderer()->isDescendantOf(localPaint
ingInfo.paintingRoot)) | 1041 if (localPaintingInfo.paintingRoot && !renderer()->isDescendantOf(localPaint
ingInfo.paintingRoot)) |
| 1042 paintingRootForRenderer = localPaintingInfo.paintingRoot; | 1042 paintingRootForRenderer = localPaintingInfo.paintingRoot; |
| 1043 | 1043 |
| 1044 LayoutPoint layerLocation = toPoint(layerBounds.location() - renderBoxLocati
on() + localPaintingInfo.subPixelAccumulation); | 1044 LayoutPoint layerLocation = toPoint(layerBounds.location() - renderBoxLocati
on() + localPaintingInfo.subPixelAccumulation); |
| 1045 | 1045 |
| 1046 paintChildren(NegativeZOrderChildren, context, paintingInfo, paintFlags); | |
| 1047 | |
| 1048 if (shouldPaintContent) { | 1046 if (shouldPaintContent) { |
| 1049 paintForeground(context, transparencyLayerContext, paintingInfo.paintDir
tyRect, haveTransparency, | 1047 paintForeground(context, transparencyLayerContext, paintingInfo.paintDir
tyRect, haveTransparency, |
| 1050 localPaintingInfo, paintingRootForRenderer, layerLocation, foregroun
dRect); | 1048 localPaintingInfo, paintingRootForRenderer, layerLocation, foregroun
dRect); |
| 1051 } | 1049 } |
| 1052 | 1050 |
| 1053 paintOutline(context, localPaintingInfo, paintingRootForRenderer, layerLocat
ion, outlineRect); | 1051 paintOutline(context, localPaintingInfo, paintingRootForRenderer, layerLocat
ion, outlineRect); |
| 1054 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, painting
Info, paintFlags); | 1052 paintChildren(NormalFlowChildren | PositiveZOrderChildren, context, painting
Info, paintFlags); |
| 1055 | 1053 |
| 1056 if (isPaintingOverlayScrollbars) | 1054 if (isPaintingOverlayScrollbars) |
| 1057 paintOverflowControls(context, localPaintingInfo, layerLocation, backgro
undRect); | 1055 paintOverflowControls(context, localPaintingInfo, layerLocation, backgro
undRect); |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 result = tempResult; | 1432 result = tempResult; |
| 1435 if (!depthSortDescendants) | 1433 if (!depthSortDescendants) |
| 1436 return this; | 1434 return this; |
| 1437 // Foreground can depth-sort with descendant layers, so keep this as
a candidate. | 1435 // Foreground can depth-sort with descendant layers, so keep this as
a candidate. |
| 1438 candidateLayer = this; | 1436 candidateLayer = this; |
| 1439 } else if (result.isRectBasedTest()) { | 1437 } else if (result.isRectBasedTest()) { |
| 1440 result.append(tempResult); | 1438 result.append(tempResult); |
| 1441 } | 1439 } |
| 1442 } | 1440 } |
| 1443 | 1441 |
| 1444 // Now check our negative z-index children. | |
| 1445 hitLayer = hitTestChildren(NegativeZOrderChildren, rootLayer, request, resul
t, hitTestRect, hitTestLocation, | |
| 1446 localTransformState.get(), zOffsetForDescendantsPtr, zOffset, unflattene
dTransformState.get(), depthSortDescendants); | |
| 1447 if (hitLayer) { | |
| 1448 if (!depthSortDescendants) | |
| 1449 return hitLayer; | |
| 1450 candidateLayer = hitLayer; | |
| 1451 } | |
| 1452 | |
| 1453 // If we found a layer, return. Child layers, and foreground always render i
n front of background. | 1442 // If we found a layer, return. Child layers, and foreground always render i
n front of background. |
| 1454 if (candidateLayer) | 1443 if (candidateLayer) |
| 1455 return candidateLayer; | 1444 return candidateLayer; |
| 1456 | 1445 |
| 1457 if (isSelfPaintingLayer() && backgroundRect.intersects(hitTestLocation)) { | 1446 if (isSelfPaintingLayer() && backgroundRect.intersects(hitTestLocation)) { |
| 1458 HitTestResult tempResult(result.hitTestLocation()); | 1447 HitTestResult tempResult(result.hitTestLocation()); |
| 1459 if (hitTestContents(request, tempResult, layerBounds, hitTestLocation, H
itTestSelf) | 1448 if (hitTestContents(request, tempResult, layerBounds, hitTestLocation, H
itTestSelf) |
| 1460 && isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTra
nsformState.get())) { | 1449 && isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTra
nsformState.get())) { |
| 1461 if (result.isRectBasedTest()) | 1450 if (result.isRectBasedTest()) |
| 1462 result.append(tempResult); | 1451 result.append(tempResult); |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 } | 1847 } |
| 1859 } | 1848 } |
| 1860 | 1849 |
| 1861 void showLayerTree(const blink::RenderObject* renderer) | 1850 void showLayerTree(const blink::RenderObject* renderer) |
| 1862 { | 1851 { |
| 1863 if (!renderer) | 1852 if (!renderer) |
| 1864 return; | 1853 return; |
| 1865 showLayerTree(renderer->enclosingLayer()); | 1854 showLayerTree(renderer->enclosingLayer()); |
| 1866 } | 1855 } |
| 1867 #endif | 1856 #endif |
| OLD | NEW |