Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 1367193003: NOT FOR LANDING Allocate SVGImageForContainer on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some NeedsRebaseline and revived some LayoutListMarker code that turned out to be important Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "core/paint/BoxPainter.h" 6 #include "core/paint/BoxPainter.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/HTMLFrameOwnerElement.h" 10 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } 457 }
458 } 458 }
459 459
460 // no progressive loading of the background image 460 // no progressive loading of the background image
461 if (shouldPaintBackgroundImage) { 461 if (shouldPaintBackgroundImage) {
462 if (!geometry.destRect().isEmpty()) { 462 if (!geometry.destRect().isEmpty()) {
463 SkXfermode::Mode bgOp = WebCoreCompositeToSkiaComposite(bgLayer.comp osite(), bgLayer.blendMode()); 463 SkXfermode::Mode bgOp = WebCoreCompositeToSkiaComposite(bgLayer.comp osite(), bgLayer.blendMode());
464 // if op != SkXfermode::kSrcOver_Mode, a mask is being painted. 464 // if op != SkXfermode::kSrcOver_Mode, a mask is being painted.
465 SkXfermode::Mode compositeOp = op == SkXfermode::kSrcOver_Mode ? bgO p : op; 465 SkXfermode::Mode compositeOp = op == SkXfermode::kSrcOver_Mode ? bgO p : op;
466 const LayoutObject* clientForBackgroundImage = backgroundObject ? ba ckgroundObject : &obj; 466 const LayoutObject* clientForBackgroundImage = backgroundObject ? ba ckgroundObject : &obj;
467 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome try.tileSize()); 467 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome try.tileSize(), obj.style()->effectiveZoom(), bgImage->url());
468 InterpolationQuality interpolationQuality = chooseInterpolationQuali ty(*clientForBackgroundImage, context, image.get(), &bgLayer, LayoutSize(geometr y.tileSize())); 468 InterpolationQuality interpolationQuality = chooseInterpolationQuali ty(*clientForBackgroundImage, context, image.get(), &bgLayer, LayoutSize(geometr y.tileSize()));
469 if (bgLayer.maskSourceType() == MaskLuminance) 469 if (bgLayer.maskSourceType() == MaskLuminance)
470 context->setColorFilter(ColorFilterLuminanceToAlpha); 470 context->setColorFilter(ColorFilterLuminanceToAlpha);
471 InterpolationQuality previousInterpolationQuality = context->imageIn terpolationQuality(); 471 InterpolationQuality previousInterpolationQuality = context->imageIn terpolationQuality();
472 context->setImageInterpolationQuality(interpolationQuality); 472 context->setImageInterpolationQuality(interpolationQuality);
473 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintI mage", "data", InspectorPaintImageEvent::data(obj, *bgImage)); 473 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintI mage", "data", InspectorPaintImageEvent::data(obj, *bgImage));
474 context->drawTiledImage(image.get(), geometry.destRect(), geometry.p hase(), geometry.tileSize(), 474 context->drawTiledImage(image.get(), geometry.destRect(), geometry.p hase(), geometry.tileSize(),
475 compositeOp, geometry.spaceSize()); 475 compositeOp, geometry.spaceSize());
476 context->setImageInterpolationQuality(previousInterpolationQuality); 476 context->setImageInterpolationQuality(previousInterpolationQuality);
477 } 477 }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 } 707 }
708 } 708 }
709 709
710 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) 710 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
711 { 711 {
712 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc onomy 712 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc onomy
713 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); 713 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ());
714 } 714 }
715 715
716 } // namespace blink 716 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698