fixes not expected scale factor change

This commit is contained in:
gellert 2017-05-13 00:59:25 +02:00
parent 9f682ee36b
commit af2c5d1845

View file

@ -858,6 +858,8 @@ std::unique_ptr<cc::SoftwareOutputDevice>
DCHECK(!copy_frame_generator_); DCHECK(!copy_frame_generator_);
DCHECK(!software_output_device_); DCHECK(!software_output_device_);
ResizeRootLayer();
software_output_device_ = new OffScreenOutputDevice( software_output_device_ = new OffScreenOutputDevice(
transparent_, transparent_,
base::Bind(&OffScreenRenderWidgetHostView::OnPaint, base::Bind(&OffScreenRenderWidgetHostView::OnPaint,
@ -1127,8 +1129,8 @@ void OffScreenRenderWidgetHostView::InvalidateBounds(const gfx::Rect& bounds) {
void OffScreenRenderWidgetHostView::ResizeRootLayer() { void OffScreenRenderWidgetHostView::ResizeRootLayer() {
SetupFrameRate(false); SetupFrameRate(false);
const float orgScaleFactor = scale_factor_; const float compositorScaleFactor = GetCompositor()->device_scale_factor();
const bool scaleFactorDidChange = (orgScaleFactor != scale_factor_); const bool scaleFactorDidChange = (compositorScaleFactor != scale_factor_);
gfx::Size size; gfx::Size size;
if (!IsPopupWidget()) if (!IsPopupWidget())