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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 506075: Revert 34951 - Combine ViewHostMsg_{Paint,Scroll}Rect into one IPC.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years 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
Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_mac.mm (revision 34952)
+++ chrome/browser/renderer_host/render_widget_host_view_mac.mm (working copy)
@@ -275,31 +275,26 @@
caret_rect.width(), caret_rect.height());
}
-void RenderWidgetHostViewMac::DidPaintBackingStoreRects(
- const std::vector<gfx::Rect>& rects) {
+void RenderWidgetHostViewMac::DidPaintRect(const gfx::Rect& rect) {
if (is_hidden_)
return;
- for (size_t i = 0; i < rects.size(); ++i) {
- NSRect ns_rect = [cocoa_view_ RectToNSRect:rects[i]];
+ NSRect ns_rect = [cocoa_view_ RectToNSRect:rect];
- if (about_to_validate_and_paint_) {
- // As much as we'd like to use -setNeedsDisplayInRect: here, we can't.
- // We're in the middle of executing a -drawRect:, and as soon as it
- // returns Cocoa will clear its record of what needs display. If we want
- // to handle the recursive drawing, we need to do it ourselves.
- invalid_rect_ = NSUnionRect(invalid_rect_, ns_rect);
- } else {
- [cocoa_view_ setNeedsDisplayInRect:ns_rect];
- }
- }
-
- if (!about_to_validate_and_paint_)
+ if (about_to_validate_and_paint_) {
+ // As much as we'd like to use -setNeedsDisplayInRect: here, we can't. We're
+ // in the middle of executing a -drawRect:, and as soon as it returns Cocoa
+ // will clear its record of what needs display. If we want to handle the
+ // recursive drawing, we need to do it ourselves.
+ invalid_rect_ = NSUnionRect(invalid_rect_, ns_rect);
+ } else {
+ [cocoa_view_ setNeedsDisplayInRect:ns_rect];
[cocoa_view_ displayIfNeeded];
+ }
}
-void RenderWidgetHostViewMac::DidScrollBackingStoreRect(const gfx::Rect& rect,
- int dx, int dy) {
+void RenderWidgetHostViewMac::DidScrollRect(
+ const gfx::Rect& rect, int dx, int dy) {
if (is_hidden_)
return;
@@ -310,7 +305,7 @@
// TODO(rohitrao): Evaluate how slow this full redraw is. If it
// turns out to be a problem, consider scrolling only a portion of
// the view, based on where the findbar and blocked popups are.
- DidPaintBackingStoreRects(std::vector<gfx::Rect>(1, rect));
+ DidPaintRect(rect);
}
void RenderWidgetHostViewMac::RenderViewGone() {
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_mac.h ('k') | chrome/browser/renderer_host/render_widget_host_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698