| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/BoxPainter.h" | 5 #include "core/paint/BoxPainter.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "core/layout/ImageQualityController.h" | 10 #include "core/layout/ImageQualityController.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 | 446 |
| 447 // no progressive loading of the background image | 447 // no progressive loading of the background image |
| 448 if (shouldPaintBackgroundImage) { | 448 if (shouldPaintBackgroundImage) { |
| 449 if (!geometry.destRect().isEmpty()) { | 449 if (!geometry.destRect().isEmpty()) { |
| 450 SkXfermode::Mode bgOp = WebCoreCompositeToSkiaComposite(bgLayer.comp
osite(), bgLayer.blendMode()); | 450 SkXfermode::Mode bgOp = WebCoreCompositeToSkiaComposite(bgLayer.comp
osite(), bgLayer.blendMode()); |
| 451 // if op != SkXfermode::kSrcOver_Mode, a mask is being painted. | 451 // if op != SkXfermode::kSrcOver_Mode, a mask is being painted. |
| 452 SkXfermode::Mode compositeOp = op == SkXfermode::kSrcOver_Mode ? bgO
p : op; | 452 SkXfermode::Mode compositeOp = op == SkXfermode::kSrcOver_Mode ? bgO
p : op; |
| 453 const LayoutObject* clientForBackgroundImage = backgroundObject ? ba
ckgroundObject : &obj; | 453 const LayoutObject* clientForBackgroundImage = backgroundObject ? ba
ckgroundObject : &obj; |
| 454 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, floor
edIntSize(geometry.imageContainerSize()), obj.style()->effectiveZoom()); | 454 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, floor
edIntSize(geometry.tileSize()), obj.style()->effectiveZoom()); |
| 455 InterpolationQuality interpolationQuality = chooseInterpolationQuali
ty(*clientForBackgroundImage, image.get(), &bgLayer, LayoutSize(geometry.tileSiz
e())); | 455 InterpolationQuality interpolationQuality = chooseInterpolationQuali
ty(*clientForBackgroundImage, image.get(), &bgLayer, LayoutSize(geometry.tileSiz
e())); |
| 456 if (bgLayer.maskSourceType() == MaskLuminance) | 456 if (bgLayer.maskSourceType() == MaskLuminance) |
| 457 context.setColorFilter(ColorFilterLuminanceToAlpha); | 457 context.setColorFilter(ColorFilterLuminanceToAlpha); |
| 458 InterpolationQuality previousInterpolationQuality = context.imageInt
erpolationQuality(); | 458 InterpolationQuality previousInterpolationQuality = context.imageInt
erpolationQuality(); |
| 459 context.setImageInterpolationQuality(interpolationQuality); | 459 context.setImageInterpolationQuality(interpolationQuality); |
| 460 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintI
mage", "data", InspectorPaintImageEvent::data(obj, *bgImage)); | 460 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintI
mage", "data", InspectorPaintImageEvent::data(obj, *bgImage)); |
| 461 context.drawTiledImage(image.get(), FloatRect(geometry.destRect()),
FloatPoint(geometry.phase()), FloatSize(geometry.tileSize()), | 461 context.drawTiledImage(image.get(), FloatRect(geometry.destRect()),
FloatPoint(geometry.phase()), FloatSize(geometry.tileSize()), |
| 462 compositeOp, FloatSize(geometry.spaceSize())); | 462 compositeOp, FloatSize(geometry.spaceSize())); |
| 463 context.setImageInterpolationQuality(previousInterpolationQuality); | 463 context.setImageInterpolationQuality(previousInterpolationQuality); |
| 464 } | 464 } |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 } | 692 } |
| 693 } | 693 } |
| 694 | 694 |
| 695 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 695 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
| 696 { | 696 { |
| 697 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus
tEconomy | 697 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus
tEconomy |
| 698 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 698 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
| 699 } | 699 } |
| 700 | 700 |
| 701 } // namespace blink | 701 } // namespace blink |
| OLD | NEW |