Commit 2df1b365 authored by brettw@chromium.org's avatar brettw@chromium.org

Don't unnecessarily paint pixles when doing optimized always-on-top pepper paints.

This just intersects the paint rect with the plugin rect (previously we used
the entire plugin rect, even when the paint rect was smaller).

TEST=manual
BUG=none
Review URL: http://codereview.chromium.org/6296010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72191 0039d316-1c4b-4281-b951-d872f2087c98
parent b7f75868
...@@ -441,7 +441,7 @@ void RenderWidget::PaintRect(const gfx::Rect& rect, ...@@ -441,7 +441,7 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
// the plugin. Unlike the DoDeferredUpdate case, an extra copy is still // the plugin. Unlike the DoDeferredUpdate case, an extra copy is still
// required. // required.
optimized_instance->Paint(webkit_glue::ToWebCanvas(canvas), optimized_instance->Paint(webkit_glue::ToWebCanvas(canvas),
optimized_copy_location, optimized_copy_location); optimized_copy_location, rect);
} else { } else {
// Normal painting case. // Normal painting case.
webwidget_->paint(webkit_glue::ToWebCanvas(canvas), rect); webwidget_->paint(webkit_glue::ToWebCanvas(canvas), rect);
...@@ -530,6 +530,8 @@ void RenderWidget::DoDeferredUpdate() { ...@@ -530,6 +530,8 @@ void RenderWidget::DoDeferredUpdate() {
!is_accelerated_compositing_active_ && !is_accelerated_compositing_active_ &&
GetBitmapForOptimizedPluginPaint(bounds, &dib, &optimized_copy_location, GetBitmapForOptimizedPluginPaint(bounds, &dib, &optimized_copy_location,
&optimized_copy_rect)) { &optimized_copy_rect)) {
// Only update the part of the plugin that actually changed.
optimized_copy_rect = optimized_copy_rect.Intersect(bounds);
bounds = optimized_copy_location; bounds = optimized_copy_location;
copy_rects.push_back(optimized_copy_rect); copy_rects.push_back(optimized_copy_rect);
dib_id = dib->id(); dib_id = dib->id();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment