| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (x()) | 290 if (x()) |
| 291 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); | 291 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); |
| 292 if (y()) | 292 if (y()) |
| 293 m_localToParentTransform.setF(m_localToParentTransform.f() + roundToInt(
y())); | 293 m_localToParentTransform.setF(m_localToParentTransform.f() + roundToInt(
y())); |
| 294 return m_localToParentTransform; | 294 return m_localToParentTransform; |
| 295 } | 295 } |
| 296 | 296 |
| 297 LayoutRect RenderSVGRoot::clippedOverflowRectForPaintInvalidation(const RenderLa
yerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintI
nvalidationState) const | 297 LayoutRect RenderSVGRoot::clippedOverflowRectForPaintInvalidation(const RenderLa
yerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintI
nvalidationState) const |
| 298 { | 298 { |
| 299 // This is an open-coded aggregate of SVGRenderSupport::clippedOverflowRectF
orPaintInvalidation, | 299 // This is an open-coded aggregate of SVGRenderSupport::clippedOverflowRectF
orPaintInvalidation, |
| 300 // RenderSVGRoot::computeFloatRectForPaintInvalidation and RenderReplaced::c
lippedOverflowRectForPaintInvalidation. | 300 // RenderSVGRoot::mapRectToPaintInvalidationBacking and RenderReplaced::clip
pedOverflowRectForPaintInvalidation. |
| 301 // The reason for this is to optimize/minimize the paint invalidation rect w
hen the box is not "decorated" | 301 // The reason for this is to optimize/minimize the paint invalidation rect w
hen the box is not "decorated" |
| 302 // (does not have background/border/etc.) | 302 // (does not have background/border/etc.) |
| 303 | 303 |
| 304 // Return early for any cases where we don't actually paint. | 304 // Return early for any cases where we don't actually paint. |
| 305 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent
()) | 305 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent
()) |
| 306 return LayoutRect(); | 306 return LayoutRect(); |
| 307 | 307 |
| 308 // Compute the paint invalidation rect of the content of the SVG in the bord
er-box coordinate space. | 308 // Compute the paint invalidation rect of the content of the SVG in the bord
er-box coordinate space. |
| 309 FloatRect contentPaintInvalidationRect = paintInvalidationRectInLocalCoordin
ates(); | 309 FloatRect contentPaintInvalidationRect = paintInvalidationRectInLocalCoordin
ates(); |
| 310 contentPaintInvalidationRect = m_localToBorderBoxTransform.mapRect(contentPa
intInvalidationRect); | 310 contentPaintInvalidationRect = m_localToBorderBoxTransform.mapRect(contentPa
intInvalidationRect); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 321 LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect
(false), visualOverflowRect()); | 321 LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect
(false), visualOverflowRect()); |
| 322 paintInvalidationRect.unite(decoratedPaintInvalidationRect); | 322 paintInvalidationRect.unite(decoratedPaintInvalidationRect); |
| 323 } | 323 } |
| 324 | 324 |
| 325 // Compute the paint invalidation rect in the parent coordinate space. | 325 // Compute the paint invalidation rect in the parent coordinate space. |
| 326 LayoutRect rect = enclosingIntRect(paintInvalidationRect); | 326 LayoutRect rect = enclosingIntRect(paintInvalidationRect); |
| 327 RenderReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); | 327 RenderReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); |
| 328 return rect; | 328 return rect; |
| 329 } | 329 } |
| 330 | 330 |
| 331 void RenderSVGRoot::computeFloatRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer, FloatRect& paintInvalidationRect, const Paint
InvalidationState* paintInvalidationState) const | 331 void RenderSVGRoot::mapRectToPaintInvalidationBacking(const RenderLayerModelObje
ct* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState*
paintInvalidationState) const |
| 332 { | 332 { |
| 333 // Apply our local transforms (except for x/y translation), then our shadow, | 333 // Note that we don't apply the border-box transform here - it's assumed |
| 334 // and then call RenderBox's method to handle all the normal CSS Box model b
its | 334 // that whoever called us has done that already. |
| 335 paintInvalidationRect = m_localToBorderBoxTransform.mapRect(paintInvalidatio
nRect); | |
| 336 | 335 |
| 337 // Apply initial viewport clip | 336 // Apply initial viewport clip |
| 338 if (shouldApplyViewportClip()) | 337 if (shouldApplyViewportClip()) |
| 339 paintInvalidationRect.intersect(pixelSnappedBorderBoxRect()); | 338 rect.intersect(pixelSnappedBorderBoxRect()); |
| 340 | 339 |
| 341 LayoutRect rect = enclosingIntRect(paintInvalidationRect); | |
| 342 RenderReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); | 340 RenderReplaced::mapRectToPaintInvalidationBacking(paintInvalidationContainer
, rect, paintInvalidationState); |
| 343 paintInvalidationRect = rect; | |
| 344 } | 341 } |
| 345 | 342 |
| 346 // This method expects local CSS box coordinates. | 343 // This method expects local CSS box coordinates. |
| 347 // Callers with local SVG viewport coordinates should first apply the localToBor
derBoxTransform | 344 // Callers with local SVG viewport coordinates should first apply the localToBor
derBoxTransform |
| 348 // to convert from SVG viewport coordinates to local CSS box coordinates. | 345 // to convert from SVG viewport coordinates to local CSS box coordinates. |
| 349 void RenderSVGRoot::mapLocalToContainer(const RenderLayerModelObject* paintInval
idationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool
* wasFixed, const PaintInvalidationState* paintInvalidationState) const | 346 void RenderSVGRoot::mapLocalToContainer(const RenderLayerModelObject* paintInval
idationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool
* wasFixed, const PaintInvalidationState* paintInvalidationState) const |
| 350 { | 347 { |
| 351 ASSERT(mode & ~IsFixed); // We should have no fixed content in the SVG rende
ring tree. | 348 ASSERT(mode & ~IsFixed); // We should have no fixed content in the SVG rende
ring tree. |
| 352 // We used to have this ASSERT here, but we removed it when enabling layer s
quashing. | 349 // We used to have this ASSERT here, but we removed it when enabling layer s
quashing. |
| 353 // See http://crbug.com/364901 | 350 // See http://crbug.com/364901 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 updateHitTestResult(result, pointInBorderBox); | 399 updateHitTestResult(result, pointInBorderBox); |
| 403 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn
Container, boundsRect)) | 400 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn
Container, boundsRect)) |
| 404 return true; | 401 return true; |
| 405 } | 402 } |
| 406 } | 403 } |
| 407 | 404 |
| 408 return false; | 405 return false; |
| 409 } | 406 } |
| 410 | 407 |
| 411 } | 408 } |
| OLD | NEW |