From 8f546313b66cad4ee3d38ff01bff0e956cac18ae Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Sun, 5 Mar 2017 16:19:51 +0100 Subject: [PATCH] add popup window bounds to damage_rect --- atom/browser/osr/osr_render_widget_host_view.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/atom/browser/osr/osr_render_widget_host_view.cc b/atom/browser/osr/osr_render_widget_host_view.cc index f20e96f89d62..7d370fbed651 100644 --- a/atom/browser/osr/osr_render_widget_host_view.cc +++ b/atom/browser/osr/osr_render_widget_host_view.cc @@ -1050,16 +1050,19 @@ void OffScreenRenderWidgetHostView::OnPaint( TRACE_EVENT0("electron", "OffScreenRenderWidgetHostView::OnPaint"); HoldResize(); - - if (parent_callback_) + + if (parent_callback_) { parent_callback_.Run(damage_rect, bitmap); - else if (popup_host_view_ && popup_bitmap_.get()) { + } else if (popup_host_view_ && popup_bitmap_.get()) { gfx::Rect pos = popup_host_view_->popup_position_; + gfx::Rect damage(damage_rect); + damage.Union(pos); + SkBitmap copy = SkBitmapOperations::CreateTiledBitmap(bitmap, pos.x(), pos.y(), pos.width(), pos.height()); CopyBitmapTo(bitmap, *popup_bitmap_, pos); - callback_.Run(damage_rect, bitmap); + callback_.Run(damage, bitmap); CopyBitmapTo(bitmap, copy, pos); } else { callback_.Run(damage_rect, bitmap);