summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 18:51:54 +0000
committeramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 18:51:54 +0000
commitee7e3bd5902799a1b0791187cd363f194e87ac10 (patch)
treeb1852d0fc226280a01b07165dd1c7559660566ef
parentd73c8ca8571d81706a5b8fa5e95e2a57d7f1961c (diff)
downloadchromium_src-ee7e3bd5902799a1b0791187cd363f194e87ac10.zip
chromium_src-ee7e3bd5902799a1b0791187cd363f194e87ac10.tar.gz
chromium_src-ee7e3bd5902799a1b0791187cd363f194e87ac10.tar.bz2
When compositor is enabled, do not do backing store updates.
BUG=52517 TEST=enable compositor and resize the window; there should be no continuous redraws Review URL: http://codereview.chromium.org/3204004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57359 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc45
1 files changed, 25 insertions, 20 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index a1f6af2..0a06602 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -753,28 +753,33 @@ void RenderWidgetHost::OnMsgUpdateRect(
DCHECK(!params.bitmap_rect.IsEmpty());
DCHECK(!params.view_size.IsEmpty());
- const size_t size = params.bitmap_rect.height() *
- params.bitmap_rect.width() * 4;
- TransportDIB* dib = process_->GetTransportDIB(params.bitmap);
bool painted_synchronously = true; // Default to sending a paint ACK below.
- if (dib) {
- if (dib->size() < size) {
- DLOG(WARNING) << "Transport DIB too small for given rectangle";
- process()->ReceivedBadMessage(ViewHostMsg_UpdateRect__ID);
- } else {
- // Scroll the backing store.
- if (!params.scroll_rect.IsEmpty()) {
- ScrollBackingStoreRect(params.dx, params.dy,
- params.scroll_rect,
- params.view_size);
+ if (!is_gpu_rendering_active_) {
+ const size_t size = params.bitmap_rect.height() *
+ params.bitmap_rect.width() * 4;
+ TransportDIB* dib = process_->GetTransportDIB(params.bitmap);
+
+ // If gpu process does painting, scroll_rect and copy_rects are always empty
+ // and backing store is never used.
+ if (dib) {
+ if (dib->size() < size) {
+ DLOG(WARNING) << "Transport DIB too small for given rectangle";
+ process()->ReceivedBadMessage(ViewHostMsg_UpdateRect__ID);
+ } else {
+ // Scroll the backing store.
+ if (!params.scroll_rect.IsEmpty()) {
+ ScrollBackingStoreRect(params.dx, params.dy,
+ params.scroll_rect,
+ params.view_size);
+ }
+
+ // Paint the backing store. This will update it with the
+ // renderer-supplied bits. The view will read out of the backing store
+ // later to actually draw to the screen.
+ PaintBackingStoreRect(params.bitmap, params.bitmap_rect,
+ params.copy_rects, params.view_size,
+ &painted_synchronously);
}
-
- // Paint the backing store. This will update it with the renderer-supplied
- // bits. The view will read out of the backing store later to actually
- // draw to the screen.
- PaintBackingStoreRect(params.bitmap, params.bitmap_rect,
- params.copy_rects, params.view_size,
- &painted_synchronously);
}
}