summaryrefslogtreecommitdiffstats
path: root/ui/compositor
diff options
context:
space:
mode:
authorjbauman <jbauman@chromium.org>2014-11-06 17:41:16 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-07 01:41:32 +0000
commit5a8f0ab2a4023c895778a103efeddf7ee951063a (patch)
tree37689f38000b7e1efa18438a136367150d2eea63 /ui/compositor
parent9ea5f76803b9c72a624fb2c5ea478f2115746b14 (diff)
downloadchromium_src-5a8f0ab2a4023c895778a103efeddf7ee951063a.zip
chromium_src-5a8f0ab2a4023c895778a103efeddf7ee951063a.tar.gz
chromium_src-5a8f0ab2a4023c895778a103efeddf7ee951063a.tar.bz2
Fix high DPI with Surfaces by treating Surface size as content bounds of layer
The size of the surface can be different from the bounds of the layer, so set the contents scale to convert between the two. Review URL: https://codereview.chromium.org/708693002 Cr-Commit-Position: refs/heads/master@{#303157}
Diffstat (limited to 'ui/compositor')
-rw-r--r--ui/compositor/layer.cc3
-rw-r--r--ui/compositor/layer.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index a2c02ac..5f8800d 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -573,12 +573,13 @@ void Layer::SetShowSurface(
cc::SurfaceId surface_id,
const cc::SurfaceLayer::SatisfyCallback& satisfy_callback,
const cc::SurfaceLayer::RequireCallback& require_callback,
+ gfx::Size surface_size,
gfx::Size frame_size_in_dip) {
DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
scoped_refptr<cc::SurfaceLayer> new_layer =
cc::SurfaceLayer::Create(satisfy_callback, require_callback);
- new_layer->SetSurfaceId(surface_id);
+ new_layer->SetSurfaceId(surface_id, surface_size);
SwitchToLayer(new_layer);
surface_layer_ = new_layer;
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index 3048355..9b54d38 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -283,6 +283,7 @@ class COMPOSITOR_EXPORT Layer
void SetShowSurface(cc::SurfaceId surface_id,
const cc::SurfaceLayer::SatisfyCallback& satisfy_callback,
const cc::SurfaceLayer::RequireCallback& require_callback,
+ gfx::Size surface_size,
gfx::Size frame_size_in_dip);
bool has_external_content() {