Clarify use of device_scale_factor_for_testing_.
Instead of applying it after using the device scale factor, move the
application to the top of OnSynchronizeVisualProperties() so that it
is used unconditionally and throughout the entire method.
[email protected]
Change-Id: Icf3fc4b5af3141671f49bf35916469e98cec06c8
Bug: 912193
Reviewed-on: https://chromium-review.googlesource.com/c/1436490
Commit-Queue: Daniel Cheng <[email protected]>
Auto-Submit: danakj <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#626488}
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 9545d80..e51bcafa 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -702,6 +702,12 @@
TRACE_EVENT0("renderer", "RenderWidget::OnSynchronizeVisualProperties");
VisualProperties params = original_params;
+ // Web tests can override the device scale factor in the renderer.
+ if (device_scale_factor_for_testing_) {
+ params.screen_info.device_scale_factor = *device_scale_factor_for_testing_;
+ params.compositor_viewport_pixel_size = gfx::ScaleToCeiledSize(
+ params.new_size, params.screen_info.device_scale_factor);
+ }
// Inform the rendering thread of the color space indicating the presence of
// HDR capabilities. The HDR bit happens to be globally true/false for all
@@ -754,16 +760,6 @@
params.browser_controls_shrink_blink_size;
top_controls_height_ = params.top_controls_height;
bottom_controls_height_ = params.bottom_controls_height;
-
- // TODO(fsamuel): Modifies the |params| that are used for
- // SynchronizeVisualProperties(), but does not used this modified
- // device_scale_factor for the auto-resize values, which is probably a bug.
- if (device_scale_factor_for_testing_) {
- params.screen_info.device_scale_factor =
- *device_scale_factor_for_testing_;
- params.compositor_viewport_pixel_size = gfx::ScaleToCeiledSize(
- params.new_size, params.screen_info.device_scale_factor);
- }
}
if (!resizing_mode_selector_->ShouldAbortOnResize(this, params)) {