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

Unified Diff: third_party/WebKit/Source/platform/graphics/Image.h

Issue 2157953002: Change filter quality when scaling-down in drawImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: third_party/WebKit/Source/platform/graphics/Image.h
diff --git a/third_party/WebKit/Source/platform/graphics/Image.h b/third_party/WebKit/Source/platform/graphics/Image.h
index 841a2ea4ea92d73524c02e32082db48001097da1..344a1b51d0d50c40cfb705cf092650b617cf5e05 100644
--- a/third_party/WebKit/Source/platform/graphics/Image.h
+++ b/third_party/WebKit/Source/platform/graphics/Image.h
@@ -28,6 +28,7 @@
#define Image_h
#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatRect.h"
#include "platform/geometry/IntRect.h"
#include "platform/graphics/Color.h"
#include "platform/graphics/GraphicsTypes.h"
@@ -149,7 +150,11 @@ public:
DoNotClampImageToSourceRect
};
- virtual void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) = 0;
+ virtual void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, bool imageSmoothingEnabled, RespectImageOrientationEnum, ImageClampingMode) = 0;
f(malita) 2016/07/18 15:46:38 Instead of plumbing imageSmoothingEnabled in the I
fs 2016/07/18 15:56:55 I was about to make a note about the same thing =)
+ static bool isDrawScalingDown(const FloatRect& srcRect, const FloatRect& dstRect)
+ {
+ return dstRect.width() < srcRect.width() && dstRect.height() < srcRect.height();
+ }
virtual bool applyShader(SkPaint&, const SkMatrix& localMatrix);

Powered by Google App Engine
This is Rietveld 408576698