cleanup and adds docs
This commit is contained in:
parent
10ea0268e5
commit
8baaad4e0d
4 changed files with 6 additions and 3 deletions
|
@ -207,6 +207,7 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
|
||||||
void NativeWindow::SetSize(const gfx::Size& size, bool animate) {
|
void NativeWindow::SetSize(const gfx::Size& size, bool animate) {
|
||||||
SetBounds(gfx::Rect(GetPosition(), size), animate);
|
SetBounds(gfx::Rect(GetPosition(), size), animate);
|
||||||
|
|
||||||
|
// In offscreen mode call RenderWidgetHostView's SetSize explicitly
|
||||||
const auto view = web_contents()->GetRenderWidgetHostView();
|
const auto view = web_contents()->GetRenderWidgetHostView();
|
||||||
if (view) {
|
if (view) {
|
||||||
auto old_size = view->GetViewBounds().size();
|
auto old_size = view->GetViewBounds().size();
|
||||||
|
|
|
@ -24,8 +24,6 @@ void OffScreenOutputDevice::Resize(
|
||||||
const gfx::Size& pixel_size, float scale_factor) {
|
const gfx::Size& pixel_size, float scale_factor) {
|
||||||
scale_factor_ = scale_factor;
|
scale_factor_ = scale_factor;
|
||||||
|
|
||||||
printf("OffScreenOutputDevice::Resize\n");
|
|
||||||
|
|
||||||
if (viewport_pixel_size_ == pixel_size) return;
|
if (viewport_pixel_size_ == pixel_size) return;
|
||||||
viewport_pixel_size_ = pixel_size;
|
viewport_pixel_size_ = pixel_size;
|
||||||
|
|
||||||
|
|
|
@ -891,7 +891,6 @@ void OffScreenRenderWidgetHostView::SetupFrameRate(bool force) {
|
||||||
void OffScreenRenderWidgetHostView::Invalidate() {
|
void OffScreenRenderWidgetHostView::Invalidate() {
|
||||||
const gfx::Rect& bounds_in_pixels = GetViewBounds();
|
const gfx::Rect& bounds_in_pixels = GetViewBounds();
|
||||||
|
|
||||||
printf("Invalidate\n");
|
|
||||||
if (software_output_device_) {
|
if (software_output_device_) {
|
||||||
software_output_device_->OnPaint(bounds_in_pixels);
|
software_output_device_->OnPaint(bounds_in_pixels);
|
||||||
} else if (copy_frame_generator_.get()) {
|
} else if (copy_frame_generator_.get()) {
|
||||||
|
|
|
@ -1146,6 +1146,11 @@ Only values between 1 and 60 are accepted.
|
||||||
|
|
||||||
If *offscreen rendering* is enabled returns the current frame rate.
|
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
|
### Instance Properties
|
||||||
|
|
||||||
#### `contents.id`
|
#### `contents.id`
|
||||||
|
|
Loading…
Reference in a new issue