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

Side by Side Diff: Source/core/rendering/svg/RenderSVGImage.cpp

Issue 201513003: Implement InterpolationMedium to filter animated images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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
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 paintInfo.context->drawImage(image.get(), destRect, srcRect, CompositeSource Over, DoNotRespectImageOrientation, interpolationQuality);
176 } 176 }
177 177
178 void RenderSVGImage::invalidateBufferedForeground() 178 void RenderSVGImage::invalidateBufferedForeground()
179 { 179 {
180 m_bufferedForeground.clear(); 180 m_bufferedForeground.clear();
181 } 181 }
182 182
183 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 183 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
184 { 184 {
185 // We only draw in the forground phase, so we only hit-test then. 185 // 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
227 227
228 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*) 228 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint &, const RenderLayerModelObject*)
229 { 229 {
230 // this is called from paint() after the localTransform has already been app lied 230 // this is called from paint() after the localTransform has already been app lied
231 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); 231 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates());
232 if (!contentRect.isEmpty()) 232 if (!contentRect.isEmpty())
233 rects.append(contentRect); 233 rects.append(contentRect);
234 } 234 }
235 235
236 } // namespace WebCore 236 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698