Chromium Code Reviews| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 m_localToBorderBoxTransform = svg->viewBoxToViewTransform( | 335 m_localToBorderBoxTransform = svg->viewBoxToViewTransform( |
| 336 contentWidth() / scale, contentHeight() / scale); | 336 contentWidth() / scale, contentHeight() / scale); |
| 337 | 337 |
| 338 AffineTransform viewToBorderBoxTransform( | 338 AffineTransform viewToBorderBoxTransform( |
| 339 scale, 0, 0, scale, borderAndPadding.width() + translate.x(), | 339 scale, 0, 0, scale, borderAndPadding.width() + translate.x(), |
| 340 borderAndPadding.height() + translate.y()); | 340 borderAndPadding.height() + translate.y()); |
| 341 viewToBorderBoxTransform.scale(svg->currentScale()); | 341 viewToBorderBoxTransform.scale(svg->currentScale()); |
| 342 m_localToBorderBoxTransform.preMultiply(viewToBorderBoxTransform); | 342 m_localToBorderBoxTransform.preMultiply(viewToBorderBoxTransform); |
| 343 } | 343 } |
| 344 | 344 |
| 345 const AffineTransform& LayoutSVGRoot::localToSVGParentTransform() const { | 345 AffineTransform LayoutSVGRoot::localToSVGParentTransform() const { |
| 346 // Slightly optimized version of m_localToParentTransform = | 346 return AffineTransform::translation(roundToInt(location().x()), |
|
pdr.
2016/11/18 20:35:10
Wow, these m_localToParentTransform's were not eve
Xianzhu
2016/11/18 22:19:12
They seemed to just to satisfy the previous return
| |
| 347 // AffineTransform::translation(x(), y()) * m_localToBorderBoxTransform; | 347 roundToInt(location().y())) * |
| 348 m_localToParentTransform = m_localToBorderBoxTransform; | 348 m_localToBorderBoxTransform; |
| 349 if (location().x()) | |
| 350 m_localToParentTransform.setE(m_localToParentTransform.e() + | |
| 351 roundToInt(location().x())); | |
| 352 if (location().y()) | |
| 353 m_localToParentTransform.setF(m_localToParentTransform.f() + | |
| 354 roundToInt(location().y())); | |
| 355 return m_localToParentTransform; | |
| 356 } | 349 } |
| 357 | 350 |
| 358 LayoutRect LayoutSVGRoot::localVisualRect() const { | 351 LayoutRect LayoutSVGRoot::localVisualRect() const { |
| 359 // This is an open-coded aggregate of SVGLayoutSupport::localVisualRect | 352 // This is an open-coded aggregate of SVGLayoutSupport::localVisualRect |
| 360 // and LayoutReplaced::localVisualRect. The reason for this is to optimize/ | 353 // and LayoutReplaced::localVisualRect. The reason for this is to optimize/ |
| 361 // minimize the visual rect when the box is not "decorated" (does not have | 354 // minimize the visual rect when the box is not "decorated" (does not have |
| 362 // background/border/etc., see | 355 // background/border/etc., see |
| 363 // LayoutSVGRootTest.VisualRectMappingWithViewportClipWithoutBorder). | 356 // LayoutSVGRootTest.VisualRectMappingWithViewportClipWithoutBorder). |
| 364 | 357 |
| 365 // Return early for any cases where we don't actually paint. | 358 // Return early for any cases where we don't actually paint. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 if (result.addNodeToListBasedTestResult(node(), locationInContainer, | 460 if (result.addNodeToListBasedTestResult(node(), locationInContainer, |
| 468 boundsRect) == StopHitTesting) | 461 boundsRect) == StopHitTesting) |
| 469 return true; | 462 return true; |
| 470 } | 463 } |
| 471 } | 464 } |
| 472 | 465 |
| 473 return false; | 466 return false; |
| 474 } | 467 } |
| 475 | 468 |
| 476 } // namespace blink | 469 } // namespace blink |
| OLD | NEW |