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

Unified Diff: src/effects/SkLightingImageFilter.cpp

Issue 205073002: Use rounding to 8888 in lighting filters, raster path. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix expectations Created 6 years, 9 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 | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLightingImageFilter.cpp
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 54bb1c890bebe9b71c108051c0c44f9259893707..09ceef03ef47b380a9bad2a3fcb65bfff8ff397f 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -64,9 +64,9 @@ public:
colorScale = SkScalarClampMax(colorScale, SK_Scalar1);
SkPoint3 color(lightColor * colorScale);
return SkPackARGB32(255,
- SkClampMax(SkScalarFloorToInt(color.fX), 255),
- SkClampMax(SkScalarFloorToInt(color.fY), 255),
- SkClampMax(SkScalarFloorToInt(color.fZ), 255));
+ SkClampMax(SkScalarRoundToInt(color.fX), 255),
+ SkClampMax(SkScalarRoundToInt(color.fY), 255),
+ SkClampMax(SkScalarRoundToInt(color.fZ), 255));
}
private:
SkScalar fKD;
@@ -84,10 +84,10 @@ public:
SkScalarPow(normal.dot(halfDir), fShininess));
colorScale = SkScalarClampMax(colorScale, SK_Scalar1);
SkPoint3 color(lightColor * colorScale);
- return SkPackARGB32(SkClampMax(SkScalarFloorToInt(color.maxComponent()), 255),
- SkClampMax(SkScalarFloorToInt(color.fX), 255),
- SkClampMax(SkScalarFloorToInt(color.fY), 255),
- SkClampMax(SkScalarFloorToInt(color.fZ), 255));
+ return SkPackARGB32(SkClampMax(SkScalarRoundToInt(color.maxComponent()), 255),
+ SkClampMax(SkScalarRoundToInt(color.fX), 255),
+ SkClampMax(SkScalarRoundToInt(color.fY), 255),
+ SkClampMax(SkScalarRoundToInt(color.fZ), 255));
}
private:
SkScalar fKS;
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698