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

Unified Diff: src/opts/SkColorCubeFilter_opts.h

Issue 1317593007: SkColorCubeFilter_opts: rounding is actually free here. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkColorCubeFilter_opts.h
diff --git a/src/opts/SkColorCubeFilter_opts.h b/src/opts/SkColorCubeFilter_opts.h
index afd6149cffaf27c003196a49d66c2dc13a684d29..3eb243de55332732345f4f1c14e2170bd7a64c7c 100644
--- a/src/opts/SkColorCubeFilter_opts.h
+++ b/src/opts/SkColorCubeFilter_opts.h
@@ -50,7 +50,7 @@ void color_cube_filter_span(const SkPMColor src[],
const int i10 = (colorToIndex[1][g] + colorToIndex[0][b] * dim) * dim;
const int i11 = (colorToIndex[1][g] + colorToIndex[1][b] * dim) * dim;
- Sk4f color(0,0,0,0);
+ Sk4f color(0.5f); // Starting from 0.5f gets us rounding for free.
for (int x = 0; x < 2; ++x) {
const int ix = colorToIndex[x][r];
« 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