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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_views.cc

Issue 6261019: Make a hole only as big as is necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_views.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc
index c6be0b356c3060936e84e04db8411458451fd6e6..63399f5c389450b71ef6e0355d534b597934d801 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -355,12 +355,6 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) {
return;
}
- // Paint a "hole" in the canvas so that the render of the web page is on
- // top of whatever else has already been painted in the views hierarchy.
- // Later views might still get to paint on top.
- canvas->FillRectInt(SK_ColorBLACK, 0, 0, kMaxWindowWidth, kMaxWindowHeight,
- SkXfermode::kClear_Mode);
-
// Don't do any painting if the GPU process is rendering directly
// into the View.
RenderWidgetHost* render_widget_host = GetRenderWidgetHost();
@@ -385,6 +379,15 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) {
gfx::Rect paint_rect = gfx::Rect(0, 0, kMaxWindowWidth, kMaxWindowHeight);
paint_rect = paint_rect.Intersect(invalid_rect_);
+ // Make sure we paint within the bounds.
+ paint_rect = paint_rect.Intersect(bounds());
+
+ // Paint a "hole" in the canvas so that the render of the web page is on
+ // top of whatever else has already been painted in the views hierarchy.
+ // Later views might still get to paint on top.
+ canvas->FillRectInt(SK_ColorBLACK, 0, 0,
+ paint_rect.width(), paint_rect.height(),
+ SkXfermode::kClear_Mode);
Alex Nicolaou 2011/01/21 16:00:16 You'll have to move this back up. If you're reall
sadrul 2011/01/21 16:36:19 Moved this back up.
if (backing_store) {
// Only render the widget if it is attached to a window; there's a short
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698