adds invalidate method and proper resizing

This commit is contained in:
gellert 2016-09-01 19:25:12 +02:00
parent d1274bb79f
commit b4c220613f
6 changed files with 31 additions and 5 deletions

View file

@ -439,11 +439,7 @@ content::RenderWidgetHost* OffScreenRenderWidgetHostView::GetRenderWidgetHost()
void OffScreenRenderWidgetHostView::SetSize(const gfx::Size& size) {
size_ = size;
const gfx::Size& size_in_pixels =
gfx::ConvertSizeToPixel(scale_factor_, size);
GetRootLayer()->SetBounds(gfx::Rect(size));
GetCompositor()->SetScaleAndSize(scale_factor_, size_in_pixels);
ResizeRootLayer();
}
void OffScreenRenderWidgetHostView::SetBounds(const gfx::Rect& new_bounds) {
@ -892,6 +888,17 @@ 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()) {
copy_frame_generator_->GenerateCopyFrame(true, bounds_in_pixels);
}
}
void OffScreenRenderWidgetHostView::ResizeRootLayer() {
SetupFrameRate(false);