cleanup and adds docs

This commit is contained in:
gellert 2016-09-02 00:18:16 +02:00
parent 10ea0268e5
commit 8baaad4e0d
4 changed files with 6 additions and 3 deletions

View file

@ -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();

View file

@ -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;

View file

@ -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()) {

View file

@ -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`