Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: third_party/WebKit/Source/core/paint/SVGImagePainter.cpp

Issue 2068053002: Rename Blink constants generated from IDL files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/paint/LayoutObjectDrawingRecorder.h" 10 #include "core/paint/LayoutObjectDrawingRecorder.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 InterpolationQuality previousInterpolationQuality = paintInfo.context.imageI nterpolationQuality(); 67 InterpolationQuality previousInterpolationQuality = paintInfo.context.imageI nterpolationQuality();
68 paintInfo.context.setImageInterpolationQuality(interpolationQuality); 68 paintInfo.context.setImageInterpolationQuality(interpolationQuality);
69 paintInfo.context.drawImage(image.get(), destRect, &srcRect); 69 paintInfo.context.drawImage(image.get(), destRect, &srcRect);
70 paintInfo.context.setImageInterpolationQuality(previousInterpolationQuality) ; 70 paintInfo.context.setImageInterpolationQuality(previousInterpolationQuality) ;
71 } 71 }
72 72
73 FloatSize SVGImagePainter::computeImageViewportSize() const 73 FloatSize SVGImagePainter::computeImageViewportSize() const
74 { 74 {
75 ASSERT(m_layoutSVGImage.imageResource()->hasImage()); 75 ASSERT(m_layoutSVGImage.imageResource()->hasImage());
76 76
77 if (toSVGImageElement(m_layoutSVGImage.element())->preserveAspectRatio()->cu rrentValue()->align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) 77 if (toSVGImageElement(m_layoutSVGImage.element())->preserveAspectRatio()->cu rrentValue()->align() != SVGPreserveAspectRatio::kSvgPreserveaspectratioNone)
78 return m_layoutSVGImage.objectBoundingBox().size(); 78 return m_layoutSVGImage.objectBoundingBox().size();
79 79
80 ImageResource* cachedImage = m_layoutSVGImage.imageResource()->cachedImage() ; 80 ImageResource* cachedImage = m_layoutSVGImage.imageResource()->cachedImage() ;
81 81
82 // Images with preserveAspectRatio=none should force non-uniform scaling. Th is can be achieved 82 // Images with preserveAspectRatio=none should force non-uniform scaling. Th is can be achieved
83 // by setting the image's container size to its viewport size (i.e. concrete object size 83 // by setting the image's container size to its viewport size (i.e. concrete object size
84 // returned by the default sizing algorithm.) See 84 // returned by the default sizing algorithm.) See
85 // https://www.w3.org/TR/SVG/single-page.html#coords-PreserveAspectRatioAttr ibute and 85 // https://www.w3.org/TR/SVG/single-page.html#coords-PreserveAspectRatioAttr ibute and
86 // https://drafts.csswg.org/css-images-3/#default-sizing. 86 // https://drafts.csswg.org/css-images-3/#default-sizing.
87 87
88 // Avoid returning the size of the broken image. 88 // Avoid returning the size of the broken image.
89 if (cachedImage->errorOccurred()) 89 if (cachedImage->errorOccurred())
90 return FloatSize(); 90 return FloatSize();
91 91
92 if (cachedImage->getImage()->isSVGImage()) 92 if (cachedImage->getImage()->isSVGImage())
93 return toSVGImage(cachedImage->getImage())->concreteObjectSize(m_layoutS VGImage.objectBoundingBox().size()); 93 return toSVGImage(cachedImage->getImage())->concreteObjectSize(m_layoutS VGImage.objectBoundingBox().size());
94 94
95 return FloatSize(cachedImage->getImage()->size()); 95 return FloatSize(cachedImage->getImage()->size());
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGClipPainter.cpp ('k') | third_party/WebKit/Source/core/svg/GradientAttributes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698