diff options
-rw-r--r-- | chrome/browser/render_widget_host.cc | 45 | ||||
-rw-r--r-- | chrome/browser/render_widget_host.h | 13 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 6 | ||||
-rw-r--r-- | chrome/renderer/render_widget.cc | 21 | ||||
-rw-r--r-- | chrome/renderer/render_widget.h | 2 |
5 files changed, 10 insertions, 77 deletions
diff --git a/chrome/browser/render_widget_host.cc b/chrome/browser/render_widget_host.cc index 94a8f8f..9fcfdd2 100644 --- a/chrome/browser/render_widget_host.cc +++ b/chrome/browser/render_widget_host.cc @@ -56,7 +56,6 @@ static const int kHungRendererDelayMs = 20000; RenderWidgetHost::BackingStore::BackingStore(const gfx::Size& size) : size_(size), backing_store_dib_(NULL), - renderer_bitmap_section_(NULL), original_bitmap_(NULL) { HDC screen_dc = ::GetDC(NULL); hdc_ = CreateCompatibleDC(screen_dc); @@ -72,11 +71,6 @@ RenderWidgetHost::BackingStore::~BackingStore() { DeleteObject(backing_store_dib_); backing_store_dib_ = NULL; } - - if (renderer_bitmap_section_) { - CloseHandle(renderer_bitmap_section_); - renderer_bitmap_section_ = NULL; - } } bool RenderWidgetHost::BackingStore::Refresh(HANDLE process, @@ -88,14 +82,6 @@ bool RenderWidgetHost::BackingStore::Refresh(HANDLE process, if (!valid_bitmap) return false; - // Disable this optimization to see how it impacts perf. -#if 0 - if (bitmap_rect.size() == size()) { - CreateDIBSectionBackedByRendererBitmap(bitmap_rect, valid_bitmap); - return true; - } -#endif - if (!backing_store_dib_) { backing_store_dib_ = CreateDIB(hdc_, size_.width(), size_.height(), true, NULL); @@ -132,28 +118,6 @@ bool RenderWidgetHost::BackingStore::Refresh(HANDLE process, return true; } -void RenderWidgetHost::BackingStore::CreateDIBSectionBackedByRendererBitmap( - const gfx::Rect& bitmap_rect, HANDLE bitmap_section_from_renderer) { - if (backing_store_dib_ != NULL) { - SelectObject(hdc_, original_bitmap_); - DeleteObject(backing_store_dib_); - backing_store_dib_ = NULL; - } - - if (renderer_bitmap_section_ != NULL) { - CloseHandle(renderer_bitmap_section_); - renderer_bitmap_section_ = NULL; - } - - backing_store_dib_ = CreateDIB(hdc_, bitmap_rect.width(), - bitmap_rect.height(), false, - bitmap_section_from_renderer); - DCHECK(backing_store_dib_ != NULL); - - renderer_bitmap_section_ = bitmap_section_from_renderer; - original_bitmap_ = SelectObject(hdc_, backing_store_dib_); -} - HANDLE RenderWidgetHost::BackingStore::CreateDIB(HDC dc, int width, int height, bool use_system_color_depth, HANDLE section) { @@ -433,15 +397,8 @@ void RenderWidgetHost::OnMsgPaintRect( PaintRect(params.bitmap, params.bitmap_rect, params.view_size); - bool using_renderer_bitmap_section = false; - BackingStore* backing_store = BackingStoreManager::Lookup(this); - if (backing_store) { - using_renderer_bitmap_section = - backing_store->using_renderer_bitmap_section(); - } - // ACK early so we can prefetch the next PaintRect if there is a next one. - Send(new ViewMsg_PaintRect_ACK(routing_id_, using_renderer_bitmap_section)); + Send(new ViewMsg_PaintRect_ACK(routing_id_)); // TODO(darin): This should really be done by the view_! MovePluginWindows(params.plugin_window_moves); diff --git a/chrome/browser/render_widget_host.h b/chrome/browser/render_widget_host.h index 054959d..ceefea1 100644 --- a/chrome/browser/render_widget_host.h +++ b/chrome/browser/render_widget_host.h @@ -352,16 +352,7 @@ class RenderWidgetHost::BackingStore { bool Refresh(HANDLE process, HANDLE bitmap_section, const gfx::Rect& bitmap_rect); - bool using_renderer_bitmap_section() const { - return renderer_bitmap_section_ != NULL; - } - private: - // Creates the backing store DIB backed by the renderer bitmap - // shared section. - void CreateDIBSectionBackedByRendererBitmap( - const gfx::Rect& bitmap_rect, HANDLE bitmap_section_from_renderer); - // Creates a dib conforming to the height/width/section parameters passed // in. The use_os_color_depth parameter controls whether we use the color // depth to create an appropriate dib or not. @@ -372,10 +363,6 @@ class RenderWidgetHost::BackingStore { HDC hdc_; // The size of the backing store. gfx::Size size_; - // Handle to the renderer bitmap section, valid in the browser address - // space. This is set if the backing store dib is backed by the renderer - // bitmap section. - HANDLE renderer_bitmap_section_; // Handle to the backing store dib. HANDLE backing_store_dib_; // Handle to the original bitmap in the dc. diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 738aa16..334b902 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -105,10 +105,7 @@ IPC_BEGIN_MESSAGES(View, 1) // Tells the render view that a ViewHostMsg_PaintRect message was processed. // This signals the render view that it can send another PaintRect message. - // The drop bitmap argument indicates whether the renderer should drop its - // reference on the shared section used for the dib. - IPC_MESSAGE_ROUTED1(ViewMsg_PaintRect_ACK, - bool /* drop bitmap */) + IPC_MESSAGE_ROUTED0(ViewMsg_PaintRect_ACK) // Asks the renderer to calculate the number of printed pages according to the // supplied settings. The renderer will reply with @@ -438,6 +435,7 @@ IPC_BEGIN_MESSAGES(View, 1) // passed in. IPC_MESSAGE_ROUTED1(ViewMsg_Repaint, gfx::Size /* The view size to be repainted */) + IPC_END_MESSAGES(View) diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 2560438..90ec7c6 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -296,24 +296,15 @@ void RenderWidget::OnWasRestored(bool needs_repainting) { DidInvalidateRect(webwidget_, gfx::Rect(size_.width(), size_.height())); } -void RenderWidget::OnPaintRectAck(bool drop_bitmap) { +void RenderWidget::OnPaintRectAck() { DCHECK(paint_reply_pending()); paint_reply_pending_ = false; - - 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_); - } + // 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; } - - current_paint_buf_ = NULL; - // Continue painting if necessary... DoDeferredPaint(); } diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index 48b40ee..adb1033 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -133,7 +133,7 @@ class RenderWidget : public IPC::Channel::Listener, void OnResize(const gfx::Size& new_size); void OnWasHidden(); void OnWasRestored(bool needs_repainting); - void OnPaintRectAck(bool drop_bitmap); + void OnPaintRectAck(); void OnScrollRectAck(); void OnHandleInputEvent(const IPC::Message& message); void OnMouseCaptureLost(); |