From c7e211acd0c9201688de7ff0c9a2271c67440adf Mon Sep 17 00:00:00 2001 From: fmalita Date: Thu, 7 Jan 2016 10:34:46 -0800 Subject: SkTreatAsSprite should take AA into account Currently we always call SkTreatAsSprite with 0 subpixel bits, which means subpixel translations are ignored. This is incorrect for the anti-aliased case (drawSprite always pixel-snaps, so we lose edge AA). The CL updates SkTreatAsSprite to take an SkPaint argument and use 8 subpixel bits when AA is requested. Also remove unused SkTreatAsSpriteFilter. BUG=skia:4761 R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1566943002 Committed: https://skia.googlesource.com/skia/+/983dc2541a729609037a05eba731b3eb9788c517 Review URL: https://codereview.chromium.org/1566943002 --- src/core/SkCanvas.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/SkCanvas.cpp') diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index e5ca9ce6c1..a4acbdc94d 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2220,8 +2220,7 @@ bool SkCanvas::canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const } const SkMatrix& ctm = this->getTotalMatrix(); - const unsigned kSubpixelBits = 0; // matching SkDraw::drawBitmap() - if (!SkTreatAsSprite(ctm, w, h, kSubpixelBits)) { + if (!SkTreatAsSprite(ctm, SkISize::Make(w, h), paint)) { return false; } -- cgit v1.2.3