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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 RenderReplaced::removeChild(child); | 351 RenderReplaced::removeChild(child); |
352 } | 352 } |
353 | 353 |
354 // RenderBox methods will expect coordinates w/o any transforms in coordinates | 354 // RenderBox methods will expect coordinates w/o any transforms in coordinates |
355 // relative to our borderBox origin. This method gives us exactly that. | 355 // relative to our borderBox origin. This method gives us exactly that. |
356 void RenderSVGRoot::buildLocalToBorderBoxTransform() | 356 void RenderSVGRoot::buildLocalToBorderBoxTransform() |
357 { | 357 { |
358 SVGSVGElement* svg = toSVGSVGElement(node()); | 358 SVGSVGElement* svg = toSVGSVGElement(node()); |
359 ASSERT(svg); | 359 ASSERT(svg); |
360 float scale = style()->effectiveZoom(); | 360 float scale = style()->effectiveZoom(); |
361 FloatPoint translate = svg->currentTranslate(); | 361 SVGPoint translate = svg->currentTranslate(); |
362 LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + padd
ingTop()); | 362 LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + padd
ingTop()); |
363 m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / s
cale, contentHeight() / scale); | 363 m_localToBorderBoxTransform = svg->viewBoxToViewTransform(contentWidth() / s
cale, contentHeight() / scale); |
364 if (borderAndPadding.isEmpty() && scale == 1 && translate == FloatPoint::zer
o()) | 364 if (borderAndPadding.isEmpty() && scale == 1 && translate == SVGPoint::zero(
)) |
365 return; | 365 return; |
366 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP
adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l
ocalToBorderBoxTransform; | 366 m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndP
adding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_l
ocalToBorderBoxTransform; |
367 } | 367 } |
368 | 368 |
369 const AffineTransform& RenderSVGRoot::localToParentTransform() const | 369 const AffineTransform& RenderSVGRoot::localToParentTransform() const |
370 { | 370 { |
371 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; | 371 // Slightly optimized version of m_localToParentTransform = AffineTransform:
:translation(x(), y()) * m_localToBorderBoxTransform; |
372 m_localToParentTransform = m_localToBorderBoxTransform; | 372 m_localToParentTransform = m_localToBorderBoxTransform; |
373 if (x()) | 373 if (x()) |
374 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); | 374 m_localToParentTransform.setE(m_localToParentTransform.e() + roundToInt(
x())); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 { | 490 { |
491 RenderObject* svgRoot = resource->parent(); | 491 RenderObject* svgRoot = resource->parent(); |
492 while (svgRoot && !svgRoot->isSVGRoot()) | 492 while (svgRoot && !svgRoot->isSVGRoot()) |
493 svgRoot = svgRoot->parent(); | 493 svgRoot = svgRoot->parent(); |
494 if (!svgRoot) | 494 if (!svgRoot) |
495 return; | 495 return; |
496 toRenderSVGRoot(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource
); | 496 toRenderSVGRoot(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource
); |
497 } | 497 } |
498 | 498 |
499 } | 499 } |
OLD | NEW |