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

Unified Diff: webkit/tools/test_shell/webwidget_host_mac.mm

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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 | « webkit/tools/test_shell/webwidget_host_gtk.cc ('k') | webkit/tools/test_shell/webwidget_host_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/webwidget_host_mac.mm
diff --git a/webkit/tools/test_shell/webwidget_host_mac.mm b/webkit/tools/test_shell/webwidget_host_mac.mm
index 60a10f531531ea12813c2dd0e669907ca0143b1d..795430edbbd9fd1aa02338cad63f1fb32b0c39b8 100644
--- a/webkit/tools/test_shell/webwidget_host_mac.mm
+++ b/webkit/tools/test_shell/webwidget_host_mac.mm
@@ -97,10 +97,10 @@ void WebWidgetHost::DidInvalidateRect(const gfx::Rect& damaged_rect) {
// If this invalidate overlaps with a pending scroll, then we have to
// downgrade to invalidating the scroll rect.
if (damaged_rect.Intersects(scroll_rect_)) {
- paint_rect_ = paint_rect_.Union(scroll_rect_);
+ paint_rect_.Union(scroll_rect_);
ResetScrollRect();
}
- paint_rect_ = paint_rect_.Union(damaged_rect);
+ paint_rect_.Union(damaged_rect);
NSRect r = NSRectFromCGRect(damaged_rect.ToCGRect());
// flip to cocoa coordinates
@@ -114,9 +114,9 @@ void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
// If we already have a pending scroll operation or if this scroll operation
// intersects the existing paint region, then just failover to invalidating.
if (!scroll_rect_.IsEmpty() || paint_rect_.Intersects(clip_rect)) {
- paint_rect_ = paint_rect_.Union(scroll_rect_);
+ paint_rect_.Union(scroll_rect_);
ResetScrollRect();
- paint_rect_ = paint_rect_.Union(clip_rect);
+ paint_rect_.Union(clip_rect);
}
// We will perform scrolling lazily, when requested to actually paint.
@@ -161,7 +161,7 @@ WebWidgetHost::~WebWidgetHost() {
}
void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) {
- paint_rect_ = paint_rect_.Union(rect);
+ paint_rect_.Union(rect);
}
void WebWidgetHost::Paint() {
@@ -190,10 +190,10 @@ void WebWidgetHost::Paint() {
webwidget_->layout();
// Scroll the canvas if necessary
- scroll_rect_ = client_rect.Intersect(scroll_rect_);
+ scroll_rect_.Intersect(client_rect);
if (!scroll_rect_.IsEmpty()) {
// add to invalidate rect, since there's no equivalent of ScrollDC.
- paint_rect_ = paint_rect_.Union(scroll_rect_);
+ paint_rect_.Union(scroll_rect_);
}
ResetScrollRect();
@@ -201,7 +201,7 @@ void WebWidgetHost::Paint() {
// first time we call it. This is necessary because some WebCore rendering
// objects update their layout only when painted.
for (int i = 0; i < 2; ++i) {
- paint_rect_ = client_rect.Intersect(paint_rect_);
+ paint_rect_.Intersect(client_rect);
if (!paint_rect_.IsEmpty()) {
gfx::Rect rect(paint_rect_);
paint_rect_ = gfx::Rect();
« no previous file with comments | « webkit/tools/test_shell/webwidget_host_gtk.cc ('k') | webkit/tools/test_shell/webwidget_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698