| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 if (m_geometryMapper) { | 207 if (m_geometryMapper) { |
| 208 ClipRect clipRect = applyOverflowClipToBackgroundRectWithGeometryMapper( | 208 ClipRect clipRect = applyOverflowClipToBackgroundRectWithGeometryMapper( |
| 209 context, clipRectWithGeometryMapper(context, false)); | 209 context, clipRectWithGeometryMapper(context, false)); |
| 210 | 210 |
| 211 // The rect now needs to be transformed to the local space of this | 211 // The rect now needs to be transformed to the local space of this |
| 212 // PaintLayer. | 212 // PaintLayer. |
| 213 bool success = false; | 213 bool success = false; |
| 214 FloatRect clippedRectInLocalSpace = | 214 FloatRect clippedRectInLocalSpace = |
| 215 m_geometryMapper->mapRectToDestinationSpace( | 215 m_geometryMapper->mapRectToDestinationSpace( |
| 216 FloatRect(clipRect.rect()), clippingRootLayer->layoutObject() | 216 FloatRect(clipRect.rect()), clippingRootLayer->layoutObject() |
| 217 ->objectPaintProperties() | 217 ->paintProperties() |
| 218 ->localBorderBoxProperties() | 218 ->localBorderBoxProperties() |
| 219 ->propertyTreeState, | 219 ->propertyTreeState, |
| 220 m_layer.layoutObject() | 220 m_layer.layoutObject() |
| 221 ->objectPaintProperties() | 221 ->paintProperties() |
| 222 ->localBorderBoxProperties() | 222 ->localBorderBoxProperties() |
| 223 ->propertyTreeState, | 223 ->propertyTreeState, |
| 224 success); | 224 success); |
| 225 DCHECK(success); | 225 DCHECK(success); |
| 226 | 226 |
| 227 return LayoutRect(clippedRectInLocalSpace); | 227 return LayoutRect(clippedRectInLocalSpace); |
| 228 } | 228 } |
| 229 | 229 |
| 230 LayoutRect layerBounds; | 230 LayoutRect layerBounds; |
| 231 ClipRect backgroundRect, foregroundRect; | 231 ClipRect backgroundRect, foregroundRect; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 250 << "expected=" << expected.toString() << " actual=" << actual.toString() | 250 << "expected=" << expected.toString() << " actual=" << actual.toString() |
| 251 #endif | 251 #endif |
| 252 | 252 |
| 253 void PaintLayerClipper::mapLocalToRootWithGeometryMapper( | 253 void PaintLayerClipper::mapLocalToRootWithGeometryMapper( |
| 254 const ClipRectsContext& context, | 254 const ClipRectsContext& context, |
| 255 LayoutRect& layoutRect) const { | 255 LayoutRect& layoutRect) const { |
| 256 DCHECK(m_geometryMapper); | 256 DCHECK(m_geometryMapper); |
| 257 bool success; | 257 bool success; |
| 258 | 258 |
| 259 const ObjectPaintProperties::PropertyTreeStateWithOffset* | 259 const ObjectPaintProperties::PropertyTreeStateWithOffset* |
| 260 layerBorderBoxProperties = m_layer.layoutObject() | 260 layerBorderBoxProperties = |
| 261 ->objectPaintProperties() | 261 m_layer.layoutObject()->paintProperties()->localBorderBoxProperties(); |
| 262 ->localBorderBoxProperties(); | |
| 263 FloatRect localRect(layoutRect); | 262 FloatRect localRect(layoutRect); |
| 264 localRect.moveBy(FloatPoint(layerBorderBoxProperties->paintOffset)); | 263 localRect.moveBy(FloatPoint(layerBorderBoxProperties->paintOffset)); |
| 265 | 264 |
| 266 layoutRect = LayoutRect(m_geometryMapper->mapRectToDestinationSpace( | 265 layoutRect = LayoutRect(m_geometryMapper->mapRectToDestinationSpace( |
| 267 localRect, layerBorderBoxProperties->propertyTreeState, | 266 localRect, layerBorderBoxProperties->propertyTreeState, |
| 268 context.rootLayer->layoutObject() | 267 context.rootLayer->layoutObject() |
| 269 ->objectPaintProperties() | 268 ->paintProperties() |
| 270 ->localBorderBoxProperties() | 269 ->localBorderBoxProperties() |
| 271 ->propertyTreeState, | 270 ->propertyTreeState, |
| 272 success)); | 271 success)); |
| 273 DCHECK(success); | 272 DCHECK(success); |
| 274 } | 273 } |
| 275 | 274 |
| 276 void PaintLayerClipper::calculateRectsWithGeometryMapper( | 275 void PaintLayerClipper::calculateRectsWithGeometryMapper( |
| 277 const ClipRectsContext& context, | 276 const ClipRectsContext& context, |
| 278 const LayoutRect& paintDirtyRect, | 277 const LayoutRect& paintDirtyRect, |
| 279 LayoutRect& layerBounds, | 278 LayoutRect& layerBounds, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 428 |
| 430 return parentRects.overflowClipRect(); | 429 return parentRects.overflowClipRect(); |
| 431 } | 430 } |
| 432 | 431 |
| 433 ClipRect PaintLayerClipper::clipRectWithGeometryMapper( | 432 ClipRect PaintLayerClipper::clipRectWithGeometryMapper( |
| 434 const ClipRectsContext& context, | 433 const ClipRectsContext& context, |
| 435 bool isForeground) const { | 434 bool isForeground) const { |
| 436 DCHECK(m_geometryMapper); | 435 DCHECK(m_geometryMapper); |
| 437 LayoutRect source(LayoutRect::infiniteIntRect()); | 436 LayoutRect source(LayoutRect::infiniteIntRect()); |
| 438 bool success = false; | 437 bool success = false; |
| 439 const ObjectPaintProperties* properties = | 438 const auto* properties = m_layer.layoutObject()->paintProperties(); |
| 440 m_layer.layoutObject()->objectPaintProperties(); | |
| 441 PropertyTreeState propertyTreeState = | 439 PropertyTreeState propertyTreeState = |
| 442 properties->localBorderBoxProperties()->propertyTreeState; | 440 properties->localBorderBoxProperties()->propertyTreeState; |
| 443 | 441 |
| 444 if (properties->cssClip()) | 442 if (properties->cssClip()) |
| 445 propertyTreeState.setClip(properties->cssClip()); | 443 propertyTreeState.setClip(properties->cssClip()); |
| 446 | 444 |
| 447 if (isForeground && shouldClipOverflow(context) && properties->overflowClip()) | 445 if (isForeground && shouldClipOverflow(context) && properties->overflowClip()) |
| 448 propertyTreeState.setClip(properties->overflowClip()); | 446 propertyTreeState.setClip(properties->overflowClip()); |
| 449 | 447 |
| 450 const ObjectPaintProperties* ancestorProperties = | 448 const auto* ancestorProperties = |
| 451 context.rootLayer->layoutObject()->objectPaintProperties(); | 449 context.rootLayer->layoutObject()->paintProperties(); |
| 452 PropertyTreeState destinationPropertyTreeState = | 450 PropertyTreeState destinationPropertyTreeState = |
| 453 ancestorProperties->localBorderBoxProperties()->propertyTreeState; | 451 ancestorProperties->localBorderBoxProperties()->propertyTreeState; |
| 454 if (!context.rootLayer->clipper().shouldRespectOverflowClip(context)) { | 452 if (!context.rootLayer->clipper().shouldRespectOverflowClip(context)) { |
| 455 if (ancestorProperties->overflowClip()) | 453 if (ancestorProperties->overflowClip()) |
| 456 destinationPropertyTreeState.setClip(ancestorProperties->overflowClip()); | 454 destinationPropertyTreeState.setClip(ancestorProperties->overflowClip()); |
| 457 } | 455 } |
| 458 FloatRect clippedRectInRootLayerSpace = | 456 FloatRect clippedRectInRootLayerSpace = |
| 459 m_geometryMapper->mapToVisualRectInDestinationSpace( | 457 m_geometryMapper->mapToVisualRectInDestinationSpace( |
| 460 FloatRect(source), propertyTreeState, destinationPropertyTreeState, | 458 FloatRect(source), propertyTreeState, destinationPropertyTreeState, |
| 461 success); | 459 success); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 const LayoutSize& subpixelAccumulation) const { | 554 const LayoutSize& subpixelAccumulation) const { |
| 557 DCHECK(!m_geometryMapper); | 555 DCHECK(!m_geometryMapper); |
| 558 ClipRectsContext context(rootLayer, PaintingClipRects, | 556 ClipRectsContext context(rootLayer, PaintingClipRects, |
| 559 IgnoreOverlayScrollbarSize, subpixelAccumulation); | 557 IgnoreOverlayScrollbarSize, subpixelAccumulation); |
| 560 if (respectOverflowClip == IgnoreOverflowClip) | 558 if (respectOverflowClip == IgnoreOverflowClip) |
| 561 context.setIgnoreOverflowClip(); | 559 context.setIgnoreOverflowClip(); |
| 562 return getClipRects(context); | 560 return getClipRects(context); |
| 563 } | 561 } |
| 564 | 562 |
| 565 } // namespace blink | 563 } // namespace blink |
| OLD | NEW |