| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "sky/engine/config.h" | 28 #include "sky/engine/config.h" |
| 29 #include "sky/engine/core/rendering/RenderImage.h" | 29 #include "sky/engine/core/rendering/RenderImage.h" |
| 30 | 30 |
| 31 #include "gen/sky/core/HTMLNames.h" | 31 #include "gen/sky/core/HTMLNames.h" |
| 32 #include "sky/engine/core/editing/FrameSelection.h" | 32 #include "sky/engine/core/editing/FrameSelection.h" |
| 33 #include "sky/engine/core/fetch/ImageResource.h" | 33 #include "sky/engine/core/fetch/ImageResource.h" |
| 34 #include "sky/engine/core/fetch/ResourceLoader.h" | 34 #include "sky/engine/core/fetch/ResourceLoader.h" |
| 35 #include "sky/engine/core/frame/LocalFrame.h" | 35 #include "sky/engine/core/frame/LocalFrame.h" |
| 36 #include "sky/engine/core/html/HTMLImageElement.h" | 36 #include "sky/engine/core/html/HTMLImageElement.h" |
| 37 #include "sky/engine/core/inspector/InspectorTraceEvents.h" | |
| 38 #include "sky/engine/core/rendering/HitTestResult.h" | 37 #include "sky/engine/core/rendering/HitTestResult.h" |
| 39 #include "sky/engine/core/rendering/PaintInfo.h" | 38 #include "sky/engine/core/rendering/PaintInfo.h" |
| 40 #include "sky/engine/core/rendering/RenderLayer.h" | 39 #include "sky/engine/core/rendering/RenderLayer.h" |
| 41 #include "sky/engine/core/rendering/RenderView.h" | 40 #include "sky/engine/core/rendering/RenderView.h" |
| 42 #include "sky/engine/core/rendering/TextRunConstructor.h" | 41 #include "sky/engine/core/rendering/TextRunConstructor.h" |
| 43 #include "sky/engine/platform/fonts/Font.h" | 42 #include "sky/engine/platform/fonts/Font.h" |
| 44 #include "sky/engine/platform/fonts/FontCache.h" | 43 #include "sky/engine/platform/fonts/FontCache.h" |
| 45 #include "sky/engine/platform/graphics/GraphicsContext.h" | 44 #include "sky/engine/platform/graphics/GraphicsContext.h" |
| 46 #include "sky/engine/platform/graphics/GraphicsContextStateSaver.h" | 45 #include "sky/engine/platform/graphics/GraphicsContextStateSaver.h" |
| 47 | 46 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 IntRect alignedRect = pixelSnappedIntRect(rect); | 188 IntRect alignedRect = pixelSnappedIntRect(rect); |
| 190 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) | 189 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) |
| 191 return; | 190 return; |
| 192 | 191 |
| 193 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); | 192 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); |
| 194 if (!img || img->isNull()) | 193 if (!img || img->isNull()) |
| 195 return; | 194 return; |
| 196 | 195 |
| 197 Image* image = img.get(); | 196 Image* image = img.get(); |
| 198 | 197 |
| 199 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(*this)); | |
| 200 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); | 198 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
| 201 context->setImageInterpolationQuality(InterpolationLow); | 199 context->setImageInterpolationQuality(InterpolationLow); |
| 202 context->drawImage(image, alignedRect, CompositeSourceOver, shouldRespectIma
geOrientation()); | 200 context->drawImage(image, alignedRect, CompositeSourceOver, shouldRespectIma
geOrientation()); |
| 203 context->setImageInterpolationQuality(previousInterpolationQuality); | 201 context->setImageInterpolationQuality(previousInterpolationQuality); |
| 204 } | 202 } |
| 205 | 203 |
| 206 LayoutUnit RenderImage::minimumReplacedHeight() const | 204 LayoutUnit RenderImage::minimumReplacedHeight() const |
| 207 { | 205 { |
| 208 return m_imageResource->errorOccurred() ? intrinsicSize().height() : LayoutU
nit(); | 206 return m_imageResource->errorOccurred() ? intrinsicSize().height() : LayoutU
nit(); |
| 209 } | 207 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 return; | 247 return; |
| 250 } | 248 } |
| 251 } | 249 } |
| 252 | 250 |
| 253 bool RenderImage::needsPreferredWidthsRecalculation() const | 251 bool RenderImage::needsPreferredWidthsRecalculation() const |
| 254 { | 252 { |
| 255 return RenderReplaced::needsPreferredWidthsRecalculation(); | 253 return RenderReplaced::needsPreferredWidthsRecalculation(); |
| 256 } | 254 } |
| 257 | 255 |
| 258 } // namespace blink | 256 } // namespace blink |
| OLD | NEW |