Fix has_aligned_samples helper for SkGpuDevice::drawTextureProducer

Review URL: https://codereview.chromium.org/1454183002 .
This commit is contained in:
Brian Salomon 2015-11-18 15:19:57 -05:00
parent bc890c8490
commit a911f8f8bb

View File

@ -59,8 +59,8 @@ static const SkScalar kColorBleedTolerance = 0.001f;
static bool has_aligned_samples(const SkRect& srcRect, const SkRect& transformedRect) { static bool has_aligned_samples(const SkRect& srcRect, const SkRect& transformedRect) {
// detect pixel disalignment // detect pixel disalignment
if (SkScalarAbs(SkScalarFraction(transformedRect.left())) < kColorBleedTolerance && if (SkScalarAbs(SkScalarRoundToScalar(transformedRect.left()) - transformedRect.left()) < kColorBleedTolerance &&
SkScalarAbs(SkScalarFraction(transformedRect.top())) < kColorBleedTolerance && SkScalarAbs(SkScalarRoundToScalar(transformedRect.top()) - transformedRect.top()) < kColorBleedTolerance &&
SkScalarAbs(transformedRect.width() - srcRect.width()) < kColorBleedTolerance && SkScalarAbs(transformedRect.width() - srcRect.width()) < kColorBleedTolerance &&
SkScalarAbs(transformedRect.height() - srcRect.height()) < kColorBleedTolerance) { SkScalarAbs(transformedRect.height() - srcRect.height()) < kColorBleedTolerance) {
return true; return true;