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

Unified Diff: src/gpu/SkGpuDevice_drawTexture.cpp

Issue 1454183002: Fix has_aligned_samples helper for SkGpuDevice::drawTextureProducer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice_drawTexture.cpp
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index ccc9e2a2dd0da91dc8763c2fedee02d6e073b888..534414548b793e3b85b23b42e287f745ee133551 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -59,9 +59,9 @@ static const SkScalar kColorBleedTolerance = 0.001f;
static bool has_aligned_samples(const SkRect& srcRect, const SkRect& transformedRect) {
// detect pixel disalignment
- if (SkScalarAbs(SkScalarFraction(transformedRect.left())) < kColorBleedTolerance &&
- SkScalarAbs(SkScalarFraction(transformedRect.top())) < kColorBleedTolerance &&
- SkScalarAbs(transformedRect.width() - srcRect.width()) < kColorBleedTolerance &&
+ if (SkScalarAbs(SkScalarRoundToScalar(transformedRect.left()) - transformedRect.left()) < kColorBleedTolerance &&
+ SkScalarAbs(SkScalarRoundToScalar(transformedRect.top()) - transformedRect.top()) < kColorBleedTolerance &&
+ SkScalarAbs(transformedRect.width() - srcRect.width()) < kColorBleedTolerance &&
SkScalarAbs(transformedRect.height() - srcRect.height()) < kColorBleedTolerance) {
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698