summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjbauman <jbauman@chromium.org>2014-11-12 17:10:34 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-13 01:10:57 +0000
commitb71b07c2279f6c8b33aa65e8bf31aedcef35d750 (patch)
tree75ff5a716b78a63489d63beea1ca055a2b4e5635 /content
parent6b6aa08ec5b565a620c75c8ecf9006a2c9c13045 (diff)
downloadchromium_src-b71b07c2279f6c8b33aa65e8bf31aedcef35d750.zip
chromium_src-b71b07c2279f6c8b33aa65e8bf31aedcef35d750.tar.gz
chromium_src-b71b07c2279f6c8b33aa65e8bf31aedcef35d750.tar.bz2
Explicitly specify contents scale for SurfaceLayer.
The RWHVA changes the bounds of the layer on window resize, but the contents shouldn't be scaled to fit in that case, so specify an explicit scale when the surface id is set. Review URL: https://codereview.chromium.org/719573003 Cr-Commit-Position: refs/heads/master@{#303950}
Diffstat (limited to 'content')
-rw-r--r--content/browser/compositor/delegated_frame_host.cc7
-rw-r--r--content/browser/compositor/delegated_frame_host.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc
index 1e39486..4db278d 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -82,6 +82,7 @@ DelegatedFrameHost::DelegatedFrameHost(DelegatedFrameHostClient* client)
last_output_surface_id_(0),
pending_delegated_ack_count_(0),
skipped_frames_(false),
+ current_scale_factor_(1.f),
can_lock_compositor_(YES_CAN_LOCK),
delegated_frame_evictor_(new DelegatedFrameEvictor(this)) {
ImageTransportFactory::GetInstance()->AddObserver(this);
@@ -407,8 +408,9 @@ void DelegatedFrameHost::SwapDelegatedFrame(
surface_id_,
base::Bind(&SatisfyCallback, base::Unretained(manager)),
base::Bind(&RequireCallback, base::Unretained(manager)), frame_size,
- frame_size_in_dip);
+ frame_device_scale_factor, frame_size_in_dip);
current_surface_size_ = frame_size;
+ current_scale_factor_ = frame_device_scale_factor;
}
scoped_ptr<cc::CompositorFrame> compositor_frame =
make_scoped_ptr(new cc::CompositorFrame());
@@ -1014,7 +1016,8 @@ void DelegatedFrameHost::OnLayerRecreated(ui::Layer* old_layer,
new_layer->SetShowSurface(
surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
base::Bind(&RequireCallback, base::Unretained(manager)),
- current_surface_size_, current_frame_size_in_dip_);
+ current_surface_size_, current_scale_factor_,
+ current_frame_size_in_dip_);
}
}
diff --git a/content/browser/compositor/delegated_frame_host.h b/content/browser/compositor/delegated_frame_host.h
index a789ef6..a737bd5 100644
--- a/content/browser/compositor/delegated_frame_host.h
+++ b/content/browser/compositor/delegated_frame_host.h
@@ -268,6 +268,7 @@ class CONTENT_EXPORT DelegatedFrameHost
scoped_ptr<cc::SurfaceFactory> surface_factory_;
cc::SurfaceId surface_id_;
gfx::Size current_surface_size_;
+ float current_scale_factor_;
cc::ReturnedResourceArray surface_returned_resources_;
// This lock is the one waiting for a frame of the right size to come back