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

Unified Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 1456813002: Calculate Background Image Geometries using sub-pixel values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MOAR expectations Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/BoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.cpp b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
index 709167ad0b937c0e80e5c6e5c41d0955b269d1d7..711f1e5f7403385502016512576bfcf127a872b8 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.cpp
@@ -464,15 +464,15 @@ void BoxPainter::paintFillLayerExtended(const LayoutBoxModelObject& obj, const P
// if op != SkXfermode::kSrcOver_Mode, a mask is being painted.
SkXfermode::Mode compositeOp = op == SkXfermode::kSrcOver_Mode ? bgOp : op;
const LayoutObject* clientForBackgroundImage = backgroundObject ? backgroundObject : &obj;
- RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geometry.imageContainerSize(), obj.style()->effectiveZoom());
+ RefPtr<Image> image = bgImage->image(clientForBackgroundImage, flooredIntSize(geometry.imageContainerSize()), obj.style()->effectiveZoom());
InterpolationQuality interpolationQuality = chooseInterpolationQuality(*clientForBackgroundImage, context, image.get(), &bgLayer, LayoutSize(geometry.tileSize()));
if (bgLayer.maskSourceType() == MaskLuminance)
context->setColorFilter(ColorFilterLuminanceToAlpha);
InterpolationQuality previousInterpolationQuality = context->imageInterpolationQuality();
context->setImageInterpolationQuality(interpolationQuality);
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "data", InspectorPaintImageEvent::data(obj, *bgImage));
- context->drawTiledImage(image.get(), geometry.destRect(), geometry.phase(), geometry.tileSize(),
- compositeOp, geometry.spaceSize());
+ context->drawTiledImage(image.get(), FloatRect(geometry.destRect()), FloatPoint(geometry.phase()), FloatSize(geometry.tileSize()),
+ compositeOp, FloatSize(geometry.spaceSize()));
context->setImageInterpolationQuality(previousInterpolationQuality);
}
}

Powered by Google App Engine
This is Rietveld 408576698