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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) | 460 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) |
461 return; | 461 return; |
462 | 462 |
463 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); | 463 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); |
464 if (!img || img->isNull()) | 464 if (!img || img->isNull()) |
465 return; | 465 return; |
466 | 466 |
467 HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? toHTML
ImageElement(node()) : 0; | 467 HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? toHTML
ImageElement(node()) : 0; |
468 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator
() : CompositeSourceOver; | 468 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator
() : CompositeSourceOver; |
469 Image* image = m_imageResource->image().get(); | 469 Image* image = m_imageResource->image().get(); |
470 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, a
lignedRect.size()); | 470 InterpolationQuality interpolationQuality = chooseInterpolationQuality(conte
xt, image, image, alignedRect.size()); |
471 | 471 |
472 InspectorInstrumentation::willPaintImage(this); | 472 InspectorInstrumentation::willPaintImage(this); |
473 context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.h
eight()).get(), alignedRect, compositeOperator, shouldRespectImageOrientation(),
useLowQualityScaling); | 473 InterpolationQuality previousInterpolationQuality = context->imageInterpolat
ionQuality(); |
| 474 context->setImageInterpolationQuality(interpolationQuality); |
| 475 context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.h
eight()).get(), alignedRect, compositeOperator, shouldRespectImageOrientation())
; |
| 476 context->setImageInterpolationQuality(previousInterpolationQuality); |
474 InspectorInstrumentation::didPaintImage(this); | 477 InspectorInstrumentation::didPaintImage(this); |
475 } | 478 } |
476 | 479 |
477 bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance
bleedAvoidance, InlineFlowBox*) const | 480 bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance
bleedAvoidance, InlineFlowBox*) const |
478 { | 481 { |
479 if (!RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(bleedAvoidan
ce)) | 482 if (!RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(bleedAvoidan
ce)) |
480 return false; | 483 return false; |
481 | 484 |
482 return !const_cast<RenderImage*>(this)->backgroundIsKnownToBeObscured(); | 485 return !const_cast<RenderImage*>(this)->backgroundIsKnownToBeObscured(); |
483 } | 486 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 return 0; | 629 return 0; |
627 | 630 |
628 ImageResource* cachedImage = m_imageResource->cachedImage(); | 631 ImageResource* cachedImage = m_imageResource->cachedImage(); |
629 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) | 632 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) |
630 return toSVGImage(cachedImage->image())->embeddedContentBox(); | 633 return toSVGImage(cachedImage->image())->embeddedContentBox(); |
631 | 634 |
632 return 0; | 635 return 0; |
633 } | 636 } |
634 | 637 |
635 } // namespace WebCore | 638 } // namespace WebCore |
OLD | NEW |