From: mtklein Date: Thu, 27 Aug 2015 19:05:56 +0000 (-0700) Subject: Add a note about (x*y+255)/256. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~1075 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6904d1d3f1a2903fcaa4c4bd17b07d5f10af2e8e;p=platform%2Fupstream%2FlibSkiaSharp.git Add a note about (x*y+255)/256. BUG=skia:4117 Review URL: https://codereview.chromium.org/1312283004 --- diff --git a/src/core/Sk4px.h b/src/core/Sk4px.h index 996847f..a7f5c9f 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); }