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

Unified Diff: src/core/SkMathPriv.h

Issue 1273203002: The compiler can generate smulbb perfectly well nowadays. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: parens 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 | « include/core/SkPreConfig.h ('k') | src/core/SkScan_Antihair.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMathPriv.h
diff --git a/src/core/SkMathPriv.h b/src/core/SkMathPriv.h
index 345815354cc68a887bc1ab76c5c543c90628a1b5..b9184a0726934fdb801280014a7c7f30773b6d8d 100644
--- a/src/core/SkMathPriv.h
+++ b/src/core/SkMathPriv.h
@@ -57,7 +57,7 @@ static inline unsigned SkClampUMax(unsigned value, unsigned max) {
static inline U8CPU SkMulDiv255Trunc(U8CPU a, U8CPU b) {
SkASSERT((uint8_t)a == a);
SkASSERT((uint8_t)b == b);
- unsigned prod = SkMulS16(a, b) + 1;
+ unsigned prod = a*b + 1;
return (prod + (prod >> 8)) >> 8;
}
@@ -67,7 +67,7 @@ static inline U8CPU SkMulDiv255Trunc(U8CPU a, U8CPU b) {
static inline U8CPU SkMulDiv255Ceiling(U8CPU a, U8CPU b) {
SkASSERT((uint8_t)a == a);
SkASSERT((uint8_t)b == b);
- unsigned prod = SkMulS16(a, b) + 255;
+ unsigned prod = a*b + 255;
return (prod + (prod >> 8)) >> 8;
}
« no previous file with comments | « include/core/SkPreConfig.h ('k') | src/core/SkScan_Antihair.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698