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

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: review 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') | cc/resources/picture.h » ('J')
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..95b020967b0413c3510a085bd28d06f178ffd738 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) * mul
+ : ((n + mul - 1) / mul) * mul;
+}
+
+template <typename T> T RoundDown(T n, T mul) {
+ return (n < 0) ? ((n - mul + 1) / mul) * mul
+ : (n / mul) * mul;
}
} // namespace cc
« no previous file with comments | « no previous file | cc/resources/picture.h » ('j') | cc/resources/picture.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698