OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
10 * | 10 * |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 { | 200 { |
201 IntRect alignedRect = pixelSnappedIntRect(rect); | 201 IntRect alignedRect = pixelSnappedIntRect(rect); |
202 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) | 202 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) |
203 return; | 203 return; |
204 | 204 |
205 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); | 205 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); |
206 if (!img || img->isNull()) | 206 if (!img || img->isNull()) |
207 return; | 207 return; |
208 | 208 |
209 Image* image = img.get(); | 209 Image* image = img.get(); |
210 InterpolationQuality interpolationQuality = chooseInterpolationQuality(conte
xt, image, image, alignedRect.size()); | |
211 | 210 |
212 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(*this)); | 211 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(*this)); |
213 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); | 212 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
214 context->setImageInterpolationQuality(interpolationQuality); | 213 context->setImageInterpolationQuality(InterpolationLow); |
215 context->drawImage(image, alignedRect, CompositeSourceOver, shouldRespectIma
geOrientation()); | 214 context->drawImage(image, alignedRect, CompositeSourceOver, shouldRespectIma
geOrientation()); |
216 context->setImageInterpolationQuality(previousInterpolationQuality); | 215 context->setImageInterpolationQuality(previousInterpolationQuality); |
217 } | 216 } |
218 | 217 |
219 LayoutUnit RenderImage::minimumReplacedHeight() const | 218 LayoutUnit RenderImage::minimumReplacedHeight() const |
220 { | 219 { |
221 return m_imageResource->errorOccurred() ? intrinsicSize().height() : LayoutU
nit(); | 220 return m_imageResource->errorOccurred() ? intrinsicSize().height() : LayoutU
nit(); |
222 } | 221 } |
223 | 222 |
224 bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf
fset, HitTestAction hitTestAction) | 223 bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf
fset, HitTestAction hitTestAction) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 return; | 261 return; |
263 } | 262 } |
264 } | 263 } |
265 | 264 |
266 bool RenderImage::needsPreferredWidthsRecalculation() const | 265 bool RenderImage::needsPreferredWidthsRecalculation() const |
267 { | 266 { |
268 return RenderReplaced::needsPreferredWidthsRecalculation(); | 267 return RenderReplaced::needsPreferredWidthsRecalculation(); |
269 } | 268 } |
270 | 269 |
271 } // namespace blink | 270 } // namespace blink |
OLD | NEW |