Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1412663005: Introduce painted-device-scale-factor and use it when --enable-use-zoom-for-dsf is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 1a5177112af55d73bff1637492a1cb89cfcb4c05..a185fcf729be59a8447891b9eb0b25aed6ecd54a 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -99,6 +99,7 @@ LayerTreeHost::LayerTreeHost(InitParams* params)
top_controls_height_(0.f),
top_controls_shown_ratio_(0.f),
device_scale_factor_(1.f),
+ painted_device_scale_factor_(1.f),
visible_(false),
page_scale_factor_(1.f),
min_page_scale_factor_(1.f),
@@ -311,6 +312,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
// properties are set, since those trigger an update of GPU rasterization
// status, which depends on the device scale factor. (crbug.com/535700)
sync_tree->SetDeviceScaleFactor(device_scale_factor_);
+ sync_tree->set_painted_device_scale_factor(painted_device_scale_factor_);
host_impl->SetDebugState(debug_state_);
if (pending_page_scale_animation_) {
sync_tree->SetPendingPageScaleAnimation(
@@ -871,6 +873,15 @@ void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) {
SetNeedsCommit();
}
+void LayerTreeHost::SetPaintedDeviceScaleFactor(
+ float painted_device_scale_factor) {
+ if (painted_device_scale_factor == painted_device_scale_factor_)
+ return;
+ painted_device_scale_factor_ = painted_device_scale_factor;
+
+ SetNeedsCommit();
+}
+
void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints,
TopControlsState current,
bool animate) {

Powered by Google App Engine
This is Rietveld 408576698