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

Unified Diff: cc/base/util.h

Issue 14230007: cc: Do GatherPixelRefs from skia at record time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile fix Created 7 years, 8 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 | cc/resources/picture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/util.h
diff --git a/cc/base/util.h b/cc/base/util.h
index b5a58c76b3b1199a4b9ebc0ce0bacc5a5dc78e36..2bf2723d4bea2c1eab42d46a439f6e8af3d98996 100644
--- a/cc/base/util.h
+++ b/cc/base/util.h
@@ -8,7 +8,13 @@
namespace cc {
template <typename T> T RoundUp(T n, T mul) {
- return ((n + mul - 1) / mul) * mul;
+ return (n > 0) ? ((n + mul - 1) / mul) * mul
+ : (n / mul) * mul;
+}
+
+template <typename T> T RoundDown(T n, T mul) {
+ return (n > 0) ? (n / mul) * mul
+ : ((n - mul + 1) / mul) * mul;
}
} // namespace cc
« no previous file with comments | « no previous file | cc/resources/picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698