| Index: Source/platform/DragImage.cpp
|
| diff --git a/Source/platform/DragImage.cpp b/Source/platform/DragImage.cpp
|
| index ce770dbd25e654a15112fdd5d7351495186c4da2..28dea00f034a3b5e93e9f1cc3815aa33a8fe21ca 100644
|
| --- a/Source/platform/DragImage.cpp
|
| +++ b/Source/platform/DragImage.cpp
|
| @@ -69,7 +69,7 @@ const float kMaxDragLabelStringWidth = (kMaxDragLabelWidth - 2 * kDragLabelBorde
|
| const float kDragLinkLabelFontSize = 11;
|
| const float kDragLinkUrlFontSize = 10;
|
|
|
| -PassOwnPtr<DragImage> DragImage::create(Image* image, RespectImageOrientationEnum shouldRespectImageOrientation, float deviceScaleFactor)
|
| +PassOwnPtr<DragImage> DragImage::create(Image* image, RespectImageOrientationEnum shouldRespectImageOrientation, float deviceScaleFactor, InterpolationQuality interpolationQuality)
|
| {
|
| if (!image)
|
| return nullptr;
|
| @@ -99,14 +99,14 @@ PassOwnPtr<DragImage> DragImage::create(Image* image, RespectImageOrientationEnu
|
| canvas.concat(affineTransformToSkMatrix(orientation.transformFromDefault(sizeRespectingOrientation)));
|
| canvas.drawBitmapRect(bitmap->bitmap(), 0, destRect);
|
|
|
| - return adoptPtr(new DragImage(skBitmap, deviceScaleFactor));
|
| + return adoptPtr(new DragImage(skBitmap, deviceScaleFactor, interpolationQuality));
|
| }
|
| }
|
|
|
| SkBitmap skBitmap;
|
| if (!bitmap->bitmap().copyTo(&skBitmap, kN32_SkColorType))
|
| return nullptr;
|
| - return adoptPtr(new DragImage(skBitmap, deviceScaleFactor));
|
| + return adoptPtr(new DragImage(skBitmap, deviceScaleFactor, interpolationQuality));
|
| }
|
|
|
| static Font deriveDragLabelFont(int size, FontWeight fontWeight, const FontDescription& systemFont)
|
| @@ -221,9 +221,10 @@ PassOwnPtr<DragImage> DragImage::create(const KURL& url, const String& inLabel,
|
| return DragImage::create(image.get(), DoNotRespectImageOrientation, deviceScaleFactor);
|
| }
|
|
|
| -DragImage::DragImage(const SkBitmap& bitmap, float resolutionScale)
|
| +DragImage::DragImage(const SkBitmap& bitmap, float resolutionScale, InterpolationQuality interpolationQuality)
|
| : m_bitmap(bitmap)
|
| , m_resolutionScale(resolutionScale)
|
| + , m_interpolationQuality(interpolationQuality)
|
| {
|
| }
|
|
|
| @@ -268,10 +269,10 @@ void DragImage::fitToMaxSize(const IntSize& srcSize, const IntSize& maxSize)
|
|
|
| void DragImage::scale(float scaleX, float scaleY)
|
| {
|
| + skia::ImageOperations::ResizeMethod resizeMethod = m_interpolationQuality == InterpolationNone ? skia::ImageOperations::RESIZE_BOX : skia::ImageOperations::RESIZE_LANCZOS3;
|
| int imageWidth = scaleX * m_bitmap.width();
|
| int imageHeight = scaleY * m_bitmap.height();
|
| - m_bitmap = skia::ImageOperations::Resize(
|
| - m_bitmap, skia::ImageOperations::RESIZE_LANCZOS3, imageWidth, imageHeight);
|
| + m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, imageHeight);
|
| }
|
|
|
| void DragImage::dissolveToFraction(float fraction)
|
|
|