| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 6 | 6 |
| 7 #include "base/gfx/native_widget_types.h" | 7 #include "base/gfx/native_widget_types.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/renderer_host/backing_store.h" | 9 #include "chrome/browser/renderer_host/backing_store.h" |
| 10 #include "chrome/browser/renderer_host/render_process_host.h" | 10 #include "chrome/browser/renderer_host/render_process_host.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // be re-used, so the bitmap may be invalid after this call. | 433 // be re-used, so the bitmap may be invalid after this call. |
| 434 Send(new ViewMsg_PaintRect_ACK(routing_id_)); | 434 Send(new ViewMsg_PaintRect_ACK(routing_id_)); |
| 435 | 435 |
| 436 // We don't need to update the view if the view is hidden. We must do this | 436 // We don't need to update the view if the view is hidden. We must do this |
| 437 // early return after the ACK is sent, however, or the renderer will not send | 437 // early return after the ACK is sent, however, or the renderer will not send |
| 438 // is more data. | 438 // is more data. |
| 439 if (is_hidden_) | 439 if (is_hidden_) |
| 440 return; | 440 return; |
| 441 | 441 |
| 442 // Now paint the view. Watch out: it might be destroyed already. | 442 // Now paint the view. Watch out: it might be destroyed already. |
| 443 if (view_ && !suppress_view_updating_) { | 443 if (view_) { |
| 444 view_being_painted_ = true; | |
| 445 view_->MovePluginWindows(params.plugin_window_moves); | 444 view_->MovePluginWindows(params.plugin_window_moves); |
| 446 view_->DidPaintRect(params.bitmap_rect); | 445 if (!suppress_view_updating_) { |
| 447 view_being_painted_ = false; | 446 view_being_painted_ = true; |
| 447 view_->DidPaintRect(params.bitmap_rect); |
| 448 view_being_painted_ = false; |
| 449 } |
| 448 } | 450 } |
| 449 | 451 |
| 450 if (paint_observer_.get()) | 452 if (paint_observer_.get()) |
| 451 paint_observer_->RenderWidgetHostDidPaint(this); | 453 paint_observer_->RenderWidgetHostDidPaint(this); |
| 452 | 454 |
| 453 // If we got a resize ack, then perhaps we have another resize to send? | 455 // If we got a resize ack, then perhaps we have another resize to send? |
| 454 if (is_resize_ack && view_) { | 456 if (is_resize_ack && view_) { |
| 455 gfx::Rect view_bounds = view_->GetViewBounds(); | 457 gfx::Rect view_bounds = view_->GetViewBounds(); |
| 456 if (current_size_.width() != view_bounds.width() || | 458 if (current_size_.width() != view_bounds.width() || |
| 457 current_size_.height() != view_bounds.height()) { | 459 current_size_.height() != view_bounds.height()) { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 603 |
| 602 // TODO(darin): do we need to do something else if our backing store is not | 604 // TODO(darin): do we need to do something else if our backing store is not |
| 603 // the same size as the advertised view? maybe we just assume there is a | 605 // the same size as the advertised view? maybe we just assume there is a |
| 604 // full paint on its way? | 606 // full paint on its way? |
| 605 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 607 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 606 if (!backing_store || (backing_store->size() != view_size)) | 608 if (!backing_store || (backing_store->size() != view_size)) |
| 607 return; | 609 return; |
| 608 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 610 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
| 609 dx, dy, clip_rect, view_size); | 611 dx, dy, clip_rect, view_size); |
| 610 } | 612 } |
| OLD | NEW |