summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r--chrome/renderer/render_widget.cc30
1 files changed, 24 insertions, 6 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index c5db805..2560438 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -182,6 +182,7 @@ IPC_DEFINE_MESSAGE_MAP(RenderWidget)
IPC_MESSAGE_HANDLER(ViewMsg_SetFocus, OnSetFocus)
IPC_MESSAGE_HANDLER(ViewMsg_ImeSetInputMode, OnImeSetInputMode)
IPC_MESSAGE_HANDLER(ViewMsg_ImeSetComposition, OnImeSetComposition)
+ IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnMsgRepaint)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
@@ -295,17 +296,24 @@ void RenderWidget::OnWasRestored(bool needs_repainting) {
DidInvalidateRect(webwidget_, gfx::Rect(size_.width(), size_.height()));
}
-void RenderWidget::OnPaintRectAck() {
+void RenderWidget::OnPaintRectAck(bool drop_bitmap) {
DCHECK(paint_reply_pending());
paint_reply_pending_ = false;
- // If we sent a PaintRect message with a zero-sized bitmap, then
- // we should have no current paint buf.
- if (current_paint_buf_) {
- RenderProcess::FreeSharedMemory(current_paint_buf_);
- current_paint_buf_ = NULL;
+ if (drop_bitmap) {
+ if (current_paint_buf_) {
+ RenderProcess::DeleteSharedMem(current_paint_buf_);
+ }
+ } else {
+ // If we sent a PaintRect message with a zero-sized bitmap, then
+ // we should have no current paint buf.
+ if (current_paint_buf_) {
+ RenderProcess::FreeSharedMemory(current_paint_buf_);
+ }
}
+ current_paint_buf_ = NULL;
+
// Continue painting if necessary...
DoDeferredPaint();
}
@@ -691,6 +699,16 @@ void RenderWidget::OnImeSetComposition(int string_type,
}
}
+void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) {
+ // During shutdown we can just ignore this message.
+ if (!webwidget_)
+ return;
+
+ set_next_paint_is_repaint_ack();
+ gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height());
+ DidInvalidateRect(webwidget_, repaint_rect);
+}
+
void RenderWidget::UpdateIME() {
// If a browser process does not have IMEs, its IMEs are not active, or there
// are not any attached widgets.