| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
) | 375 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
) |
| 376 { | 376 { |
| 377 IntRect alignedRect = pixelSnappedIntRect(rect); | 377 IntRect alignedRect = pixelSnappedIntRect(rect); |
| 378 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) | 378 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) |
| 379 return; | 379 return; |
| 380 | 380 |
| 381 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); | 381 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); |
| 382 if (!img || img->isNull()) | 382 if (!img || img->isNull()) |
| 383 return; | 383 return; |
| 384 | 384 |
| 385 HTMLImageElement* imageElt = isHTMLImageElement(node()) ? toHTMLImageElement
(node()) : 0; | |
| 386 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator
() : CompositeSourceOver; | |
| 387 Image* image = img.get(); | 385 Image* image = img.get(); |
| 388 InterpolationQuality interpolationQuality = chooseInterpolationQuality(conte
xt, image, image, alignedRect.size()); | 386 InterpolationQuality interpolationQuality = chooseInterpolationQuality(conte
xt, image, image, alignedRect.size()); |
| 389 | 387 |
| 390 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(*this)); | 388 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", InspectorPaintImageEvent::data(*this)); |
| 391 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); | 389 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
| 392 context->setImageInterpolationQuality(interpolationQuality); | 390 context->setImageInterpolationQuality(interpolationQuality); |
| 393 context->drawImage(image, alignedRect, compositeOperator, shouldRespectImage
Orientation()); | 391 context->drawImage(image, alignedRect, CompositeSourceOver, shouldRespectIma
geOrientation()); |
| 394 context->setImageInterpolationQuality(previousInterpolationQuality); | 392 context->setImageInterpolationQuality(previousInterpolationQuality); |
| 395 } | 393 } |
| 396 | 394 |
| 397 bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance
bleedAvoidance, InlineFlowBox*) const | 395 bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance
bleedAvoidance, InlineFlowBox*) const |
| 398 { | 396 { |
| 399 if (!RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(bleedAvoidan
ce)) | 397 if (!RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(bleedAvoidan
ce)) |
| 400 return false; | 398 return false; |
| 401 | 399 |
| 402 return !const_cast<RenderImage*>(this)->boxDecorationBackgroundIsKnownToBeOb
scured(); | 400 return !const_cast<RenderImage*>(this)->boxDecorationBackgroundIsKnownToBeOb
scured(); |
| 403 } | 401 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 return; | 523 return; |
| 526 } | 524 } |
| 527 } | 525 } |
| 528 | 526 |
| 529 bool RenderImage::needsPreferredWidthsRecalculation() const | 527 bool RenderImage::needsPreferredWidthsRecalculation() const |
| 530 { | 528 { |
| 531 return RenderReplaced::needsPreferredWidthsRecalculation(); | 529 return RenderReplaced::needsPreferredWidthsRecalculation(); |
| 532 } | 530 } |
| 533 | 531 |
| 534 } // namespace blink | 532 } // namespace blink |
| OLD | NEW |