| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> |
| 6 * Copyright (C) 2013 Google Inc. All rights reserved. | 6 * Copyright (C) 2013 Google Inc. 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& de
st) | 85 AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& de
st) |
| 86 { | 86 { |
| 87 AffineTransform transform; | 87 AffineTransform transform; |
| 88 transform.translate(dest.x() - source.x(), dest.y() - source.y()); | 88 transform.translate(dest.x() - source.x(), dest.y() - source.y()); |
| 89 transform.scale(dest.width() / source.width(), dest.height() / source.height
()); | 89 transform.scale(dest.width() / source.width(), dest.height() / source.height
()); |
| 90 return transform; | 90 return transform; |
| 91 } | 91 } |
| 92 | 92 |
| 93 FloatRect FEImage::determineAbsolutePaintRect(const FloatRect& originalRequested
Rect) | 93 FloatRect FEImage::determineAbsolutePaintRect(const FloatRect& originalRequested
Rect) const |
| 94 { | 94 { |
| 95 LayoutObject* layoutObject = referencedLayoutObject(); | 95 LayoutObject* layoutObject = referencedLayoutObject(); |
| 96 if (!m_image && !layoutObject) | 96 if (!m_image && !layoutObject) |
| 97 return FloatRect(); | 97 return FloatRect(); |
| 98 | 98 |
| 99 FloatRect requestedRect = originalRequestedRect; | 99 FloatRect requestedRect = originalRequestedRect; |
| 100 if (clipsToBounds()) | 100 if (clipsToBounds()) |
| 101 requestedRect.intersect(absoluteBounds()); | 101 requestedRect.intersect(absoluteBounds()); |
| 102 | 102 |
| 103 FloatRect destRect = getFilter()->mapLocalRectToAbsoluteRect(filterPrimitive
Subregion()); | 103 FloatRect destRect = getFilter()->mapLocalRectToAbsoluteRect(filterPrimitive
Subregion()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 117 srcRect = getFilter()->mapLocalRectToAbsoluteRect(srcRect); | 117 srcRect = getFilter()->mapLocalRectToAbsoluteRect(srcRect); |
| 118 srcRect.move(destRect.x(), destRect.y()); | 118 srcRect.move(destRect.x(), destRect.y()); |
| 119 } | 119 } |
| 120 destRect.intersect(srcRect); | 120 destRect.intersect(srcRect); |
| 121 } else { | 121 } else { |
| 122 srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size())); | 122 srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size())); |
| 123 m_preserveAspectRatio->transformRect(destRect, srcRect); | 123 m_preserveAspectRatio->transformRect(destRect, srcRect); |
| 124 } | 124 } |
| 125 | 125 |
| 126 destRect.intersect(requestedRect); | 126 destRect.intersect(requestedRect); |
| 127 addAbsolutePaintRect(destRect); | |
| 128 return destRect; | 127 return destRect; |
| 129 } | 128 } |
| 130 | 129 |
| 131 LayoutObject* FEImage::referencedLayoutObject() const | 130 LayoutObject* FEImage::referencedLayoutObject() const |
| 132 { | 131 { |
| 133 if (!m_treeScope) | 132 if (!m_treeScope) |
| 134 return nullptr; | 133 return nullptr; |
| 135 Element* hrefElement = SVGURIReference::targetElementFromIRIString(m_href, *
m_treeScope); | 134 Element* hrefElement = SVGURIReference::targetElementFromIRIString(m_href, *
m_treeScope); |
| 136 if (!hrefElement || !hrefElement->isSVGElement()) | 135 if (!hrefElement || !hrefElement->isSVGElement()) |
| 137 return nullptr; | 136 return nullptr; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 196 |
| 198 FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size())); | 197 FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size())); |
| 199 FloatRect dstRect = filterPrimitiveSubregion(); | 198 FloatRect dstRect = filterPrimitiveSubregion(); |
| 200 | 199 |
| 201 m_preserveAspectRatio->transformRect(dstRect, srcRect); | 200 m_preserveAspectRatio->transformRect(dstRect, srcRect); |
| 202 | 201 |
| 203 return SkImageSource::Make(std::move(image), srcRect, dstRect, kHigh_SkFilte
rQuality); | 202 return SkImageSource::Make(std::move(image), srcRect, dstRect, kHigh_SkFilte
rQuality); |
| 204 } | 203 } |
| 205 | 204 |
| 206 } // namespace blink | 205 } // namespace blink |
| OLD | NEW |