From 8baaad4e0d80269ab8dfe6c911a3f286c4621acd Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 2 Sep 2016 00:18:16 +0200 Subject: [PATCH] cleanup and adds docs --- atom/browser/native_window.cc | 1 + atom/browser/osr/osr_output_device.cc | 2 -- atom/browser/osr/osr_render_widget_host_view.cc | 1 - docs/api/web-contents.md | 5 +++++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index a4c8ba57a007..a889f552619c 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -207,6 +207,7 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) { void NativeWindow::SetSize(const gfx::Size& size, bool animate) { SetBounds(gfx::Rect(GetPosition(), size), animate); + // In offscreen mode call RenderWidgetHostView's SetSize explicitly const auto view = web_contents()->GetRenderWidgetHostView(); if (view) { auto old_size = view->GetViewBounds().size(); diff --git a/atom/browser/osr/osr_output_device.cc b/atom/browser/osr/osr_output_device.cc index 6245271792ae..dd806136338e 100644 --- a/atom/browser/osr/osr_output_device.cc +++ b/atom/browser/osr/osr_output_device.cc @@ -24,8 +24,6 @@ void OffScreenOutputDevice::Resize( const gfx::Size& pixel_size, float scale_factor) { scale_factor_ = scale_factor; - printf("OffScreenOutputDevice::Resize\n"); - if (viewport_pixel_size_ == pixel_size) return; viewport_pixel_size_ = pixel_size; diff --git a/atom/browser/osr/osr_render_widget_host_view.cc b/atom/browser/osr/osr_render_widget_host_view.cc index bddb604878e2..da41ac4c88a4 100644 --- a/atom/browser/osr/osr_render_widget_host_view.cc +++ b/atom/browser/osr/osr_render_widget_host_view.cc @@ -891,7 +891,6 @@ void OffScreenRenderWidgetHostView::SetupFrameRate(bool force) { void OffScreenRenderWidgetHostView::Invalidate() { const gfx::Rect& bounds_in_pixels = GetViewBounds(); - printf("Invalidate\n"); if (software_output_device_) { software_output_device_->OnPaint(bounds_in_pixels); } else if (copy_frame_generator_.get()) { diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 55cbfc63c33f..289b0e4b0903 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1146,6 +1146,11 @@ Only values between 1 and 60 are accepted. If *offscreen rendering* is enabled returns the current frame rate. +#### `contents.invalidate()` + +If *offscreen rendering* is enabled invalidates the frame and generates a new +one through the `'paint'` event. + ### Instance Properties #### `contents.id`