OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/render_widget.h" | 5 #include "chrome/renderer/render_widget.h" |
6 | 6 |
7 #include "app/surface/transport_dib.h" | 7 #include "app/surface/transport_dib.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 if (webwidget_->isAcceleratedCompositingActive()) { | 581 if (webwidget_->isAcceleratedCompositingActive()) { |
582 // Drop invalidates on the floor when we are in compositing mode. | 582 // Drop invalidates on the floor when we are in compositing mode. |
583 // TODO(nduca): Stop WebViewImpl from sending invalidates in the first | 583 // TODO(nduca): Stop WebViewImpl from sending invalidates in the first |
584 // place. | 584 // place. |
585 if (!(rect.x == 0 && rect.y == 0 && | 585 if (!(rect.x == 0 && rect.y == 0 && |
586 rect.width == 1 && rect.height == 1)) { | 586 rect.width == 1 && rect.height == 1)) { |
587 return; | 587 return; |
588 } | 588 } |
589 } | 589 } |
590 | 590 |
| 591 // Painting a not-yet-ready page would cause flicker with white blank. |
| 592 // So InvalidateRect() and PostTask() should be skipped. |
| 593 // Because we expect at least one update after loading the page and |
| 594 // InvalidateRect() without PostTask() can miss it, |
| 595 // We skip both instead of skip only PostTask(). |
| 596 if (!IsReadyToPaint()) |
| 597 return; |
| 598 |
591 // We only want one pending DoDeferredUpdate call at any time... | 599 // We only want one pending DoDeferredUpdate call at any time... |
592 bool update_pending = paint_aggregator_.HasPendingUpdate(); | 600 bool update_pending = paint_aggregator_.HasPendingUpdate(); |
593 | 601 |
594 // The invalidated rect might be outside the bounds of the view. | 602 // The invalidated rect might be outside the bounds of the view. |
595 gfx::Rect view_rect(size_); | 603 gfx::Rect view_rect(size_); |
596 gfx::Rect damaged_rect = view_rect.Intersect(rect); | 604 gfx::Rect damaged_rect = view_rect.Intersect(rect); |
597 if (damaged_rect.IsEmpty()) | 605 if (damaged_rect.IsEmpty()) |
598 return; | 606 return; |
599 | 607 |
600 paint_aggregator_.InvalidateRect(damaged_rect); | 608 paint_aggregator_.InvalidateRect(damaged_rect); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 | 998 |
991 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 999 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
992 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1000 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
993 i != plugin_window_moves_.end(); ++i) { | 1001 i != plugin_window_moves_.end(); ++i) { |
994 if (i->window == window) { | 1002 if (i->window == window) { |
995 plugin_window_moves_.erase(i); | 1003 plugin_window_moves_.erase(i); |
996 break; | 1004 break; |
997 } | 1005 } |
998 } | 1006 } |
999 } | 1007 } |
OLD | NEW |