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

Unified Diff: src/core/Sk4px.h

Issue 1312283004: Add a note about (x*y+255)/256. (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/core/Sk4px.h
diff --git a/src/core/Sk4px.h b/src/core/Sk4px.h
index 996847fa12cdf764ab3fea64d168127601bcb117..a7f5c9f4c6fcc11e6962ef3121e8a9ed79db3d3c 100644
--- a/src/core/Sk4px.h
+++ b/src/core/Sk4px.h
@@ -103,6 +103,7 @@ public:
// May be incorrect by +-1, but is always exactly correct when *this or o is 0 or 255.
Sk4px approxMulDiv255(const Sk16b& o) const {
// (x*y + x) / 256 meets these criteria. (As of course does (x*y + y) / 256 by symmetry.)
+ // FYI: (x*y + 255) / 256 also meets these criteria. In my brief testing, it was slower.
return this->widenLo().addNarrowHi(*this * o);
}
« 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