OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> |
6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 void RenderSVGImage::paintForeground(PaintInfo& paintInfo) | 162 void RenderSVGImage::paintForeground(PaintInfo& paintInfo) |
163 { | 163 { |
164 RefPtr<Image> image = m_imageResource->image(); | 164 RefPtr<Image> image = m_imageResource->image(); |
165 FloatRect destRect = m_objectBoundingBox; | 165 FloatRect destRect = m_objectBoundingBox; |
166 FloatRect srcRect(0, 0, image->width(), image->height()); | 166 FloatRect srcRect(0, 0, image->width(), image->height()); |
167 | 167 |
168 SVGImageElement* imageElement = toSVGImageElement(element()); | 168 SVGImageElement* imageElement = toSVGImageElement(element()); |
169 imageElement->preserveAspectRatio()->currentValue()->transformRect(destRect,
srcRect); | 169 imageElement->preserveAspectRatio()->currentValue()->transformRect(destRect,
srcRect); |
170 | 170 |
171 bool useLowQualityScaling = false; | 171 InterpolationQuality interpolationQuality = InterpolationDefault; |
172 if (style()->svgStyle()->bufferedRendering() != BR_STATIC) | 172 if (style()->svgStyle()->bufferedRendering() != BR_STATIC) |
173 useLowQualityScaling = ImageQualityController::imageQualityController()-
>shouldPaintAtLowQuality(paintInfo.context, this, image.get(), image.get(), Layo
utSize(destRect.size())); | 173 interpolationQuality = ImageQualityController::imageQualityController()-
>chooseInterpolationQuality(paintInfo.context, this, image.get(), image.get(), L
ayoutSize(destRect.size())); |
174 | 174 |
175 paintInfo.context->drawImage(image.get(), destRect, srcRect, CompositeSource
Over, DoNotRespectImageOrientation, useLowQualityScaling); | 175 InterpolationQuality previousInterpolationQuality = paintInfo.context->image
InterpolationQuality(); |
| 176 paintInfo.context->setImageInterpolationQuality(interpolationQuality); |
| 177 paintInfo.context->drawImage(image.get(), destRect, srcRect, CompositeSource
Over); |
| 178 paintInfo.context->setImageInterpolationQuality(previousInterpolationQuality
); |
176 } | 179 } |
177 | 180 |
178 void RenderSVGImage::invalidateBufferedForeground() | 181 void RenderSVGImage::invalidateBufferedForeground() |
179 { | 182 { |
180 m_bufferedForeground.clear(); | 183 m_bufferedForeground.clear(); |
181 } | 184 } |
182 | 185 |
183 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) | 186 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) |
184 { | 187 { |
185 // We only draw in the forground phase, so we only hit-test then. | 188 // We only draw in the forground phase, so we only hit-test then. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 230 |
228 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint
&, const RenderLayerModelObject*) | 231 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint
&, const RenderLayerModelObject*) |
229 { | 232 { |
230 // this is called from paint() after the localTransform has already been app
lied | 233 // this is called from paint() after the localTransform has already been app
lied |
231 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); | 234 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); |
232 if (!contentRect.isEmpty()) | 235 if (!contentRect.isEmpty()) |
233 rects.append(contentRect); | 236 rects.append(contentRect); |
234 } | 237 } |
235 | 238 |
236 } // namespace WebCore | 239 } // namespace WebCore |
OLD | NEW |