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

Unified Diff: Source/platform/DragImage.cpp

Issue 886323005: Pass InterpolationQuality into DragImage to respect image-rendering:pixelated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months 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
« Source/platform/DragImage.h ('K') | « Source/platform/DragImage.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« Source/platform/DragImage.h ('K') | « Source/platform/DragImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698