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

Unified Diff: include/core/SkMath.h

Issue 13493016: Fixing SkTileGrid to clamp rather than clip content and querries that are outside the bounds of the… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: 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 | src/core/SkTileGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkMath.h
===================================================================
--- include/core/SkMath.h (revision 8533)
+++ include/core/SkMath.h (working copy)
@@ -55,6 +55,14 @@
return value & ~(value >> 31);
}
+/** Given an integer and an integer range, return the value
+ * pinned against min and max, inclusive.
+ * @return min if value < min, max if value > max, else value
+ */
+static inline int SkClampMinMax(int value, int min, int max) {
reed1 2013/04/09 15:23:42 How is this different from SkPin32() ?
+ return (value < min ? min : (value > max ? max : value));
+}
+
/** Given an integer and a positive (max) integer, return the value
* pinned against 0 and max, inclusive.
* @param value The value we want returned pinned between [0...max]
« no previous file with comments | « no previous file | src/core/SkTileGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698