OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/SVGImagePainter.h" | 5 #include "core/paint/SVGImagePainter.h" |
6 | 6 |
7 #include "core/layout/ImageQualityController.h" | 7 #include "core/layout/ImageQualityController.h" |
8 #include "core/layout/LayoutImageResource.h" | 8 #include "core/layout/LayoutImageResource.h" |
9 #include "core/layout/svg/LayoutSVGImage.h" | 9 #include "core/layout/svg/LayoutSVGImage.h" |
10 #include "core/layout/svg/SVGLayoutSupport.h" | 10 #include "core/layout/svg/SVGLayoutSupport.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Images with preserveAspectRatio=none should force non-uniform scaling. Th
is can be achieved | 84 // Images with preserveAspectRatio=none should force non-uniform scaling. Th
is can be achieved |
85 // by setting the image's container size to its viewport size (i.e. concrete
object size | 85 // by setting the image's container size to its viewport size (i.e. concrete
object size |
86 // returned by the default sizing algorithm.) See | 86 // returned by the default sizing algorithm.) See |
87 // https://www.w3.org/TR/SVG/single-page.html#coords-PreserveAspectRatioAttr
ibute and | 87 // https://www.w3.org/TR/SVG/single-page.html#coords-PreserveAspectRatioAttr
ibute and |
88 // https://drafts.csswg.org/css-images-3/#default-sizing. | 88 // https://drafts.csswg.org/css-images-3/#default-sizing. |
89 | 89 |
90 // Avoid returning the size of the broken image. | 90 // Avoid returning the size of the broken image. |
91 if (cachedImage->errorOccurred()) | 91 if (cachedImage->errorOccurred()) |
92 return FloatSize(); | 92 return FloatSize(); |
93 | 93 |
94 if (cachedImage->image()->isSVGImage()) | 94 if (cachedImage->getImage()->isSVGImage()) |
95 return toSVGImage(cachedImage->image())->concreteObjectSize(m_layoutSVGI
mage.objectBoundingBox().size()); | 95 return toSVGImage(cachedImage->getImage())->concreteObjectSize(m_layoutS
VGImage.objectBoundingBox().size()); |
96 | 96 |
97 return FloatSize(cachedImage->image()->size()); | 97 return FloatSize(cachedImage->getImage()->size()); |
98 } | 98 } |
99 | 99 |
100 } // namespace blink | 100 } // namespace blink |
OLD | NEW |