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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 const LayoutSize& container_size) | 435 const LayoutSize& container_size) |
436 : context_(context), | 436 : context_(context), |
437 previous_interpolation_quality_(context.ImageInterpolationQuality()) { | 437 previous_interpolation_quality_(context.ImageInterpolationQuality()) { |
438 SkBlendMode bg_op = | 438 SkBlendMode bg_op = |
439 WebCoreCompositeToSkiaComposite(layer.Composite(), layer.BlendMode()); | 439 WebCoreCompositeToSkiaComposite(layer.Composite(), layer.BlendMode()); |
440 // if op != SkBlendMode::kSrcOver, a mask is being painted. | 440 // if op != SkBlendMode::kSrcOver, a mask is being painted. |
441 composite_op_ = (op == SkBlendMode::kSrcOver) ? bg_op : op; | 441 composite_op_ = (op == SkBlendMode::kSrcOver) ? bg_op : op; |
442 | 442 |
443 const LayoutObject& image_client = | 443 const LayoutObject& image_client = |
444 background_object ? *background_object : obj; | 444 background_object ? *background_object : obj; |
445 image_ = style_image.GetImage(image_client, FlooredIntSize(container_size), | 445 image_ = style_image.GetImage(image_client, FlooredIntSize(container_size)); |
446 obj.Style()->EffectiveZoom()); | |
447 | 446 |
448 interpolation_quality_ = BoxPainter::ChooseInterpolationQuality( | 447 interpolation_quality_ = BoxPainter::ChooseInterpolationQuality( |
449 image_client, image_.Get(), &layer, container_size); | 448 image_client, image_.Get(), &layer, container_size); |
450 if (interpolation_quality_ != previous_interpolation_quality_) | 449 if (interpolation_quality_ != previous_interpolation_quality_) |
451 context.SetImageInterpolationQuality(interpolation_quality_); | 450 context.SetImageInterpolationQuality(interpolation_quality_); |
452 | 451 |
453 if (layer.MaskSourceType() == kMaskLuminance) | 452 if (layer.MaskSourceType() == kMaskLuminance) |
454 context.SetColorFilter(kColorFilterLuminanceToAlpha); | 453 context.SetColorFilter(kColorFilterLuminanceToAlpha); |
455 } | 454 } |
456 | 455 |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 bool BoxPainter::ShouldForceWhiteBackgroundForPrintEconomy( | 1065 bool BoxPainter::ShouldForceWhiteBackgroundForPrintEconomy( |
1067 const ComputedStyle& style, | 1066 const ComputedStyle& style, |
1068 const Document& document) { | 1067 const Document& document) { |
1069 return document.Printing() && | 1068 return document.Printing() && |
1070 style.PrintColorAdjust() == EPrintColorAdjust::kEconomy && | 1069 style.PrintColorAdjust() == EPrintColorAdjust::kEconomy && |
1071 (!document.GetSettings() || | 1070 (!document.GetSettings() || |
1072 !document.GetSettings()->GetShouldPrintBackgrounds()); | 1071 !document.GetSettings()->GetShouldPrintBackgrounds()); |
1073 } | 1072 } |
1074 | 1073 |
1075 } // namespace blink | 1074 } // namespace blink |
OLD | NEW |