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

Side by Side Diff: chrome/browser/render_widget_host.cc

Issue 18082: Improve scrolling performance when there are many windowed plugins in a page.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Call DestroyWindow on the right thread & ensure NPP_SetWindow is called right away Created 11 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/render_widget_host.h" 5 #include "chrome/browser/render_widget_host.h"
6 6
7 #include "base/gfx/gdi_util.h" 7 #include "base/gfx/gdi_util.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/app/chrome_dll_resource.h" 9 #include "chrome/app/chrome_dll_resource.h"
10 #include "chrome/browser/render_process_host.h" 10 #include "chrome/browser/render_process_host.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 view_being_painted_ = false; 427 view_being_painted_ = false;
428 } 428 }
429 429
430 // Log the time delta for processing a scroll message. 430 // Log the time delta for processing a scroll message.
431 TimeDelta delta = TimeTicks::Now() - scroll_start; 431 TimeDelta delta = TimeTicks::Now() - scroll_start;
432 UMA_HISTOGRAM_TIMES(L"MPArch.RWH_OnMsgScrollRect", delta); 432 UMA_HISTOGRAM_TIMES(L"MPArch.RWH_OnMsgScrollRect", delta);
433 } 433 }
434 434
435 void RenderWidgetHost::MovePluginWindows( 435 void RenderWidgetHost::MovePluginWindows(
436 const std::vector<WebPluginGeometry>& plugin_window_moves) { 436 const std::vector<WebPluginGeometry>& plugin_window_moves) {
437 if (plugin_window_moves.empty())
438 return;
439
437 HDWP defer_window_pos_info = 440 HDWP defer_window_pos_info =
438 ::BeginDeferWindowPos(static_cast<int>(plugin_window_moves.size())); 441 ::BeginDeferWindowPos(static_cast<int>(plugin_window_moves.size()));
439 442
440 if (!defer_window_pos_info) { 443 if (!defer_window_pos_info) {
441 NOTREACHED(); 444 NOTREACHED();
442 return; 445 return;
443 } 446 }
444 447
445 for (size_t i = 0; i < plugin_window_moves.size(); ++i) { 448 for (size_t i = 0; i < plugin_window_moves.size(); ++i) {
446 unsigned long flags = 0; 449 // Don't invalidate now because that would result in cross process calls
450 // that make scrolling slow. Instead the window is invalidated
451 // asynchronously by the plugin code.
452 unsigned long flags = SWP_NOREDRAW;
447 const WebPluginGeometry& move = plugin_window_moves[i]; 453 const WebPluginGeometry& move = plugin_window_moves[i];
448 454
449 if (move.visible) 455 if (move.visible)
450 flags |= SWP_SHOWWINDOW; 456 flags |= SWP_SHOWWINDOW;
451 else 457 else
452 flags |= SWP_HIDEWINDOW; 458 flags |= SWP_HIDEWINDOW;
453 459
454 HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), 460 HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(),
455 move.clip_rect.y(), 461 move.clip_rect.y(),
456 move.clip_rect.right(), 462 move.clip_rect.right(),
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 &RenderWidgetHost::CheckRendererIsUnresponsive); 842 &RenderWidgetHost::CheckRendererIsUnresponsive);
837 } 843 }
838 844
839 void RenderWidgetHost::RendererExited() { 845 void RenderWidgetHost::RendererExited() {
840 BackingStoreManager::RemoveBackingStore(this); 846 BackingStoreManager::RemoveBackingStore(this);
841 } 847 }
842 848
843 void RenderWidgetHost::SystemThemeChanged() { 849 void RenderWidgetHost::SystemThemeChanged() {
844 Send(new ViewMsg_ThemeChanged(routing_id_)); 850 Send(new ViewMsg_ThemeChanged(routing_id_));
845 } 851 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698