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

Side by Side Diff: content/plugin/webplugin_proxy.cc

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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/plugin/webplugin_proxy.h" 5 #include "content/plugin/webplugin_proxy.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 // Some plugins will send invalidates larger than their own rect when 174 // Some plugins will send invalidates larger than their own rect when
175 // offscreen, so constrain invalidates to the plugin rect. 175 // offscreen, so constrain invalidates to the plugin rect.
176 gfx::Rect plugin_rect = delegate_->GetRect(); 176 gfx::Rect plugin_rect = delegate_->GetRect();
177 plugin_rect.set_origin(gfx::Point(0, 0)); 177 plugin_rect.set_origin(gfx::Point(0, 0));
178 const gfx::Rect invalidate_rect(rect.Intersect(plugin_rect)); 178 const gfx::Rect invalidate_rect(rect.Intersect(plugin_rect));
179 #else 179 #else
180 const gfx::Rect invalidate_rect(rect); 180 const gfx::Rect invalidate_rect(rect);
181 #endif 181 #endif
182 damaged_rect_ = damaged_rect_.Union(invalidate_rect); 182 damaged_rect_.Union(invalidate_rect);
183 // Ignore NPN_InvalidateRect calls with empty rects. Also don't send an 183 // Ignore NPN_InvalidateRect calls with empty rects. Also don't send an
184 // invalidate if it's outside the clipping region, since if we did it won't 184 // invalidate if it's outside the clipping region, since if we did it won't
185 // lead to a paint and we'll be stuck waiting forever for a DidPaint response. 185 // lead to a paint and we'll be stuck waiting forever for a DidPaint response.
186 // 186 //
187 // TODO(piman): There is a race condition here, because this test assumes 187 // TODO(piman): There is a race condition here, because this test assumes
188 // that when the paint actually occurs, the clip rect will not have changed. 188 // that when the paint actually occurs, the clip rect will not have changed.
189 // This is not true because scrolling (or window resize) could occur and be 189 // This is not true because scrolling (or window resize) could occur and be
190 // handled by the renderer before it receives the InvalidateRect message, 190 // handled by the renderer before it receives the InvalidateRect message,
191 // changing the clip rect and then not painting. 191 // changing the clip rect and then not painting.
192 if (damaged_rect_.IsEmpty() || 192 if (damaged_rect_.IsEmpty() ||
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 // Retrieve the IME status from a plug-in and send it to a renderer process 779 // Retrieve the IME status from a plug-in and send it to a renderer process
780 // when the plug-in has updated it. 780 // when the plug-in has updated it.
781 int input_type; 781 int input_type;
782 gfx::Rect caret_rect; 782 gfx::Rect caret_rect;
783 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) 783 if (!delegate_->GetIMEStatus(&input_type, &caret_rect))
784 return; 784 return;
785 785
786 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); 786 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect));
787 } 787 }
788 #endif 788 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698