| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
| 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 { | 313 { |
| 314 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; | 314 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; |
| 315 m_localToParentTransform = m_localToBorderBoxTransform; | 315 m_localToParentTransform = m_localToBorderBoxTransform; |
| 316 if (location().x()) | 316 if (location().x()) |
| 317 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
location().x())); | 317 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
location().x())); |
| 318 if (location().y()) | 318 if (location().y()) |
| 319 m_localToParentTransform.setF(m_localToParentTransform.f() + roundToInt(
location().y())); | 319 m_localToParentTransform.setF(m_localToParentTransform.f() + roundToInt(
location().y())); |
| 320 return m_localToParentTransform; | 320 return m_localToParentTransform; |
| 321 } | 321 } |
| 322 | 322 |
| 323 LayoutRect LayoutSVGRoot::clippedOverflowRectForPaintInvalidation(const LayoutLa
yerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintI
nvalidationState) const | 323 LayoutRect LayoutSVGRoot::clippedOverflowRectForPaintInvalidation(const LayoutBo
xModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInv
alidationState) const |
| 324 { | 324 { |
| 325 // This is an open-coded aggregate of SVGLayoutSupport::clippedOverflowRectF
orPaintInvalidation, | 325 // This is an open-coded aggregate of SVGLayoutSupport::clippedOverflowRectF
orPaintInvalidation, |
| 326 // LayoutSVGRoot::mapRectToPaintInvalidationBacking and LayoutReplaced::clip
pedOverflowRectForPaintInvalidation. | 326 // LayoutSVGRoot::mapRectToPaintInvalidationBacking and LayoutReplaced::clip
pedOverflowRectForPaintInvalidation. |
| 327 // The reason for this is to optimize/minimize the paint invalidation rect w
hen the box is not "decorated" | 327 // The reason for this is to optimize/minimize the paint invalidation rect w
hen the box is not "decorated" |
| 328 // (does not have background/border/etc.) | 328 // (does not have background/border/etc.) |
| 329 | 329 |
| 330 // Return early for any cases where we don't actually paint. | 330 // Return early for any cases where we don't actually paint. |
| 331 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent
()) | 331 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent
()) |
| 332 return LayoutRect(); | 332 return LayoutRect(); |
| 333 | 333 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 347 LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect
(false), visualOverflowRect()); | 347 LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect
(false), visualOverflowRect()); |
| 348 paintInvalidationRect.unite(decoratedPaintInvalidationRect); | 348 paintInvalidationRect.unite(decoratedPaintInvalidationRect); |
| 349 } | 349 } |
| 350 | 350 |
| 351 // Compute the paint invalidation rect in the parent coordinate space. | 351 // Compute the paint invalidation rect in the parent coordinate space. |
| 352 LayoutRect rect = enclosingIntRect(paintInvalidationRect); | 352 LayoutRect rect = enclosingIntRect(paintInvalidationRect); |
| 353 LayoutReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); | 353 LayoutReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); |
| 354 return rect; | 354 return rect; |
| 355 } | 355 } |
| 356 | 356 |
| 357 void LayoutSVGRoot::mapRectToPaintInvalidationBacking(const LayoutLayerModelObje
ct* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState*
paintInvalidationState) const | 357 void LayoutSVGRoot::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject
* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pa
intInvalidationState) const |
| 358 { | 358 { |
| 359 // Note that we don't apply the border-box transform here - it's assumed | 359 // Note that we don't apply the border-box transform here - it's assumed |
| 360 // that whoever called us has done that already. | 360 // that whoever called us has done that already. |
| 361 | 361 |
| 362 // Apply initial viewport clip | 362 // Apply initial viewport clip |
| 363 if (shouldApplyViewportClip()) | 363 if (shouldApplyViewportClip()) |
| 364 rect.intersect(pixelSnappedBorderBoxRect()); | 364 rect.intersect(pixelSnappedBorderBoxRect()); |
| 365 | 365 |
| 366 LayoutReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); | 366 LayoutReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); |
| 367 } | 367 } |
| 368 | 368 |
| 369 // This method expects local CSS box coordinates. | 369 // This method expects local CSS box coordinates. |
| 370 // Callers with local SVG viewport coordinates should first apply the localToBor
derBoxTransform | 370 // Callers with local SVG viewport coordinates should first apply the localToBor
derBoxTransform |
| 371 // to convert from SVG viewport coordinates to local CSS box coordinates. | 371 // to convert from SVG viewport coordinates to local CSS box coordinates. |
| 372 void LayoutSVGRoot::mapLocalToContainer(const LayoutLayerModelObject* paintInval
idationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool
* wasFixed, const PaintInvalidationState* paintInvalidationState) const | 372 void LayoutSVGRoot::mapLocalToContainer(const LayoutBoxModelObject* paintInvalid
ationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool*
wasFixed, const PaintInvalidationState* paintInvalidationState) const |
| 373 { | 373 { |
| 374 ASSERT(mode & ~IsFixed); // We should have no fixed content in the SVG rende
ring tree. | 374 ASSERT(mode & ~IsFixed); // We should have no fixed content in the SVG rende
ring tree. |
| 375 // We used to have this ASSERT here, but we removed it when enabling layer s
quashing. | 375 // We used to have this ASSERT here, but we removed it when enabling layer s
quashing. |
| 376 // See http://crbug.com/364901 | 376 // See http://crbug.com/364901 |
| 377 // ASSERT(mode & UseTransforms); // mapping a point through SVG w/o respecti
ng trasnforms is useless. | 377 // ASSERT(mode & UseTransforms); // mapping a point through SVG w/o respecti
ng trasnforms is useless. |
| 378 | 378 |
| 379 LayoutReplaced::mapLocalToContainer(paintInvalidationContainer, transformSta
te, mode | ApplyContainerFlip, wasFixed, paintInvalidationState); | 379 LayoutReplaced::mapLocalToContainer(paintInvalidationContainer, transformSta
te, mode | ApplyContainerFlip, wasFixed, paintInvalidationState); |
| 380 } | 380 } |
| 381 | 381 |
| 382 const LayoutObject* LayoutSVGRoot::pushMappingToContainer(const LayoutLayerModel
Object* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 382 const LayoutObject* LayoutSVGRoot::pushMappingToContainer(const LayoutBoxModelOb
ject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
| 383 { | 383 { |
| 384 return LayoutReplaced::pushMappingToContainer(ancestorToStopAt, geometryMap)
; | 384 return LayoutReplaced::pushMappingToContainer(ancestorToStopAt, geometryMap)
; |
| 385 } | 385 } |
| 386 | 386 |
| 387 void LayoutSVGRoot::updateCachedBoundaries() | 387 void LayoutSVGRoot::updateCachedBoundaries() |
| 388 { | 388 { |
| 389 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m
_objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); | 389 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m
_objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); |
| 390 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); | 390 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); |
| 391 } | 391 } |
| 392 | 392 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 updateHitTestResult(result, pointInBorderBox); | 425 updateHitTestResult(result, pointInBorderBox); |
| 426 if (!result.addNodeToListBasedTestResult(node(), request, locationIn
Container, boundsRect)) | 426 if (!result.addNodeToListBasedTestResult(node(), request, locationIn
Container, boundsRect)) |
| 427 return true; | 427 return true; |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 return false; | 431 return false; |
| 432 } | 432 } |
| 433 | 433 |
| 434 } | 434 } |
| OLD | NEW |