Index: Source/platform/DragImage.cpp |
diff --git a/Source/platform/DragImage.cpp b/Source/platform/DragImage.cpp |
index ce770dbd25e654a15112fdd5d7351495186c4da2..10332c96330dbb6200395e6468c9f6935aa4e6a0 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, ResizeMethod resizeMethod) |
{ |
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, resizeMethod)); |
} |
} |
SkBitmap skBitmap; |
if (!bitmap->bitmap().copyTo(&skBitmap, kN32_SkColorType)) |
return nullptr; |
- return adoptPtr(new DragImage(skBitmap, deviceScaleFactor)); |
+ return adoptPtr(new DragImage(skBitmap, deviceScaleFactor, resizeMethod)); |
} |
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, ResizeMethod resizeMethod) |
: m_bitmap(bitmap) |
, m_resolutionScale(resolutionScale) |
+ , m_resizeMethod(resizeMethod) |
{ |
} |
@@ -271,7 +272,7 @@ void DragImage::scale(float scaleX, float scaleY) |
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, m_resizeMethod, imageWidth, imageHeight); |
} |
void DragImage::dissolveToFraction(float fraction) |