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

Unified Diff: cc/base/index_rect.cc

Issue 2503303002: ps test.
Patch Set: rebase Created 4 years, 1 month 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 | « cc/base/index_rect.h ('k') | cc/base/pyramid_sequence.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/index_rect.cc
diff --git a/cc/base/index_rect.cc b/cc/base/index_rect.cc
index 0c64c42a1b03efab8c0efc881e98216a4e578351..a2613ed49ef6323d4bbc2fcf31162e5751a84d90 100644
--- a/cc/base/index_rect.cc
+++ b/cc/base/index_rect.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/strings/stringprintf.h"
+#include "ui/gfx/geometry/safe_integer_conversions.h"
namespace cc {
@@ -22,6 +23,13 @@ bool IndexRect::Contains(int index_x, int index_y) const {
index_y <= bottom_;
}
+void IndexRect::Inset(int left, int right, int top, int bottom) {
+ left_ = gfx::SafeAdd(left_, left);
+ right_ = gfx::SafeSubtract(right_, right);
+ top_ = gfx::SafeAdd(top_, top);
+ bottom_ = gfx::SafeSubtract(bottom_, bottom);
+}
+
std::string IndexRect::ToString() const {
return base::StringPrintf("%d,%d,%d,%d", left(), right(), top(), bottom());
}
« no previous file with comments | « cc/base/index_rect.h ('k') | cc/base/pyramid_sequence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698