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

Unified Diff: chrome/renderer/webplugin_delegate_proxy.cc

Issue 10792: Fix the painting problem with Stree View and Flash 10. After the size of the... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | « chrome/renderer/webplugin_delegate_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webplugin_delegate_proxy.cc
===================================================================
--- chrome/renderer/webplugin_delegate_proxy.cc (revision 6099)
+++ chrome/renderer/webplugin_delegate_proxy.cc (working copy)
@@ -138,7 +138,6 @@
clsid_(clsid),
plugin_(NULL),
windowless_(false),
- first_paint_(true),
npobject_(NULL),
send_deferred_update_geometry_(false),
visible_(false),
@@ -394,6 +393,7 @@
transport_store_canvas_.reset();
background_store_.reset();
background_store_canvas_.release();
+ backing_store_painted_ = gfx::Rect();
}
bool WebPluginDelegateProxy::CreateBitmap(
@@ -423,14 +423,9 @@
return;
}
- // No paint events for windowed plugins. However, if it is the first paint
- // we don't know yet whether the plugin is windowless or not, so we have to
- // send the event.
- if (!windowless_ && !first_paint_) {
- // TODO(maruel): That's not true for printing and thumbnail capture.
- // We shall use PrintWindow() to draw the window.
+ // No paint events for windowed plugins.
+ if (!windowless_)
return;
- }
// We got a paint before the plugin's coordinates, so there's no buffer to
// copy from.
@@ -450,14 +445,13 @@
rect.width(), rect.height(), hdc, rect.x(), rect.y(), SRCCOPY);
}
- if (first_paint_ || background_changed) {
- gfx::Rect offset_rect = rect;
- offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y());
+ gfx::Rect offset_rect = rect;
+ offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y());
+ if (background_changed || !backing_store_painted_.Contains(offset_rect)) {
Send(new PluginMsg_Paint(instance_id_, offset_rect));
CopyFromTransportToBacking(offset_rect);
}
- first_paint_ = false;
HDC backing_hdc = backing_store_canvas_->getTopPlatformDevice().getBitmapDC();
BitBlt(hdc, rect.x(), rect.y(), rect.width(), rect.height(), backing_hdc,
rect.x()-plugin_rect_.x(), rect.y()-plugin_rect_.y(), SRCCOPY);
@@ -702,9 +696,9 @@
// Copy the damaged rect from the transport bitmap to the backing store.
HDC backing = backing_store_canvas_->getTopPlatformDevice().getBitmapDC();
HDC transport = transport_store_canvas_->getTopPlatformDevice().getBitmapDC();
-
BitBlt(backing, rect.x(), rect.y(), rect.width(), rect.height(),
transport, rect.x(), rect.y(), SRCCOPY);
+ backing_store_painted_ = backing_store_painted_.Union(rect);
}
void WebPluginDelegateProxy::OnHandleURLRequest(
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698