Hide when not painting + cursor event fix

This commit is contained in:
Heilig Benedek 2016-07-31 18:40:35 +02:00
parent 35ee99265e
commit 0098d5bca7
2 changed files with 5 additions and 0 deletions

View file

@ -1322,6 +1322,8 @@ void WebContents::OnCursorChange(const content::WebCursor& cursor) {
if (cursor.IsCustom()) { if (cursor.IsCustom()) {
Emit("cursor-changed", CursorTypeToString(info), Emit("cursor-changed", CursorTypeToString(info),
gfx::Image::CreateFrom1xBitmap(info.custom_image), gfx::Image::CreateFrom1xBitmap(info.custom_image),
gfx::Rect(info.custom_image.width(), info.custom_image.height()),
info.hotspot,
info.image_scale_factor); info.image_scale_factor);
} else { } else {
Emit("cursor-changed", CursorTypeToString(info)); Emit("cursor-changed", CursorTypeToString(info));
@ -1405,6 +1407,7 @@ void WebContents::StartPainting() {
const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>( const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView()); web_contents()->GetRenderWidgetHostView());
osr_rwhv->SetPainting(true); osr_rwhv->SetPainting(true);
osr_rwhv->Show();
} }
} }
@ -1413,6 +1416,7 @@ void WebContents::StopPainting() {
const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>( const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView()); web_contents()->GetRenderWidgetHostView());
osr_rwhv->SetPainting(false); osr_rwhv->SetPainting(false);
osr_rwhv->Hide();
} }
} }

View file

@ -508,6 +508,7 @@ void OffScreenRenderWidgetHostView::Show() {
render_widget_host_->WasShown(ui::LatencyInfo()); render_widget_host_->WasShown(ui::LatencyInfo());
delegated_frame_host_->SetCompositor(compositor_.get()); delegated_frame_host_->SetCompositor(compositor_.get());
delegated_frame_host_->WasShown(ui::LatencyInfo()); delegated_frame_host_->WasShown(ui::LatencyInfo());
compositor_->ScheduleFullRedraw();
} }
void OffScreenRenderWidgetHostView::Hide() { void OffScreenRenderWidgetHostView::Hide() {