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

Unified Diff: src/core/SkAntiRun.h

Issue 2221103002: Analytic AntiAlias for Convex Shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make alpha computation cleaner and faster Created 4 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
Index: src/core/SkAntiRun.h
diff --git a/src/core/SkAntiRun.h b/src/core/SkAntiRun.h
index 8214e28d5b7ee8d8575c082d31b77e9f49388d5a..4537b05ac9e4e2615d75dfc2316816bcb5605d63 100644
--- a/src/core/SkAntiRun.h
+++ b/src/core/SkAntiRun.h
@@ -79,7 +79,7 @@ public:
runs += x;
x = 0;
do {
- alpha[0] = SkToU8(alpha[0] + maxValue);
+ alpha[0] = SkToU8(SkTMin<int>(0xFF, alpha[0] + maxValue));
caryclark 2016/08/10 13:08:09 In what case is this needed?
liyuqian 2016/08/16 13:22:05 Our RunBaseAdditiveBlitter uses SkAntiRun and it m
int n = runs[0];
SkASSERT(n <= middleCount);
alpha += n;
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/core/SkBlitter.cpp » ('j') | src/core/SkEdge.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698