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

Unified Diff: third_party/agg23/agg_rasterizer_scanline_aa.cpp

Issue 2640143003: Update safe numerics package to get bitwise ops (Closed)
Patch Set: Address reviewer comments Created 3 years, 11 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 | « core/fxge/ge/fx_ge_text.cpp ('k') | third_party/base/numerics/safe_conversions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/agg23/agg_rasterizer_scanline_aa.cpp
diff --git a/third_party/agg23/agg_rasterizer_scanline_aa.cpp b/third_party/agg23/agg_rasterizer_scanline_aa.cpp
index c6b3f013a03d011ebe7b3cdfdf65ed7a7c44986c..af6dd58fe30432a36f4eb18c8049d05074f75e05 100644
--- a/third_party/agg23/agg_rasterizer_scanline_aa.cpp
+++ b/third_party/agg23/agg_rasterizer_scanline_aa.cpp
@@ -283,8 +283,8 @@ void outline_aa::render_line(int x1, int y1, int x2, int y2)
incr = -1;
dy = -dy;
}
- delta = safeP.ValueOrDie() / dy;
- mod = safeP.ValueOrDie() % dy;
+ delta = (safeP / dy).ValueOrDie();
+ mod = (safeP % dy).ValueOrDie();
if(mod < 0) {
delta--;
mod += dy;
@@ -298,8 +298,8 @@ void outline_aa::render_line(int x1, int y1, int x2, int y2)
safeP *= dx;
if (!safeP.IsValid())
return;
- lift = safeP.ValueOrDie() / dy;
- rem = safeP.ValueOrDie() % dy;
+ lift = (safeP / dy).ValueOrDie();
+ rem = (safeP % dy).ValueOrDie();
if (rem < 0) {
lift--;
rem += dy;
« no previous file with comments | « core/fxge/ge/fx_ge_text.cpp ('k') | third_party/base/numerics/safe_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698