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

Unified Diff: src/effects/SkBitmapSource.cpp

Issue 1072603002: Add GM to repro crbug.com/472795 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: renamed filter to filterQuality Created 5 years, 8 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
« no previous file with comments | « include/effects/SkBitmapSource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBitmapSource.cpp
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index 87c6053cc4a61e179f66dd8ae11bde744eafa7b7..ee8b798936a01c97c36de9d61f7c75a280a569ef 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -18,13 +18,18 @@ SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap)
, fSrcRect(SkRect::MakeWH(SkIntToScalar(bitmap.width()),
SkIntToScalar(bitmap.height())))
, fDstRect(fSrcRect)
-{}
+ , fFilterQuality(kHigh_SkFilterQuality) {
+}
-SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect)
+SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap,
+ const SkRect& srcRect, const SkRect& dstRect,
+ SkFilterQuality filterQuality)
: INHERITED(0, 0)
, fBitmap(bitmap)
, fSrcRect(srcRect)
- , fDstRect(dstRect) {}
+ , fDstRect(dstRect)
+ , fFilterQuality(filterQuality) {
+}
SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) {
SkRect src, dst;
@@ -71,12 +76,13 @@ bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const Context&
// None filtering when it's translate-only
paint.setFilterQuality(
fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.height() ?
- kNone_SkFilterQuality : kHigh_SkFilterQuality);
+ kNone_SkFilterQuality : fFilterQuality);
canvas.drawBitmapRectToRect(fBitmap, &fSrcRect, dstRect, &paint);
*result = device.get()->accessBitmap(false);
offset->fX = dstIRect.fLeft;
offset->fY = dstIRect.fTop;
+
return true;
}
« no previous file with comments | « include/effects/SkBitmapSource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698