summaryrefslogtreecommitdiffstats
path: root/base/gfx/rect.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 04:15:39 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 04:15:39 +0000
commitb36d9baa98e397fd194716a6041083ed989524c8 (patch)
tree335b3e294a41f795af59f72b1fc1cc0c6f171752 /base/gfx/rect.cc
parent6e41eae8b3ea421a67104fe1849d5f261a4f2b20 (diff)
downloadchromium_src-b36d9baa98e397fd194716a6041083ed989524c8.zip
chromium_src-b36d9baa98e397fd194716a6041083ed989524c8.tar.gz
chromium_src-b36d9baa98e397fd194716a6041083ed989524c8.tar.bz2
Coalesce damage rects that share an edge.
This fixes the Bloat HTTP page cycler regression, and allows me to remove the hack I checked in to disable multiple-paints due to an observed DHTML page cycler regression. I added a new histogram, RW_IntermediatePaintRectCount, that would have shown the problem clearly had it been there before. I included some cleanup in PaintAggregator: 1- rename "r" to "existing_rect" for clarity 2- check for contained (i.e., redundant) invalidates up front I also changed the opacity of the paint rects used when --show-paint-rects is specified. I find myself dogfooding with this command line option enabled, and I want it to be a little less annoying but still just as useful. R=brettw BUG=29477 TEST=none Review URL: http://codereview.chromium.org/464057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/gfx/rect.cc')
-rw-r--r--base/gfx/rect.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/gfx/rect.cc b/base/gfx/rect.cc
index 1e067e7..2a35575 100644
--- a/base/gfx/rect.cc
+++ b/base/gfx/rect.cc
@@ -225,6 +225,13 @@ Point Rect::CenterPoint() const {
return Point(x() + (width() + 1) / 2, y() + (height() + 1) / 2);
}
+bool Rect::SharesEdgeWith(const gfx::Rect& rect) const {
+ return (y() == rect.y() && height() == rect.height() &&
+ (x() == rect.right() || right() == rect.x())) ||
+ (x() == rect.x() && width() == rect.width() &&
+ (y() == rect.bottom() || bottom() == rect.y()));
+}
+
} // namespace gfx
std::ostream& operator<<(std::ostream& out, const gfx::Rect& r) {