From 61d0dc68ba682c8e5b81e79d62837512f3d7c303 Mon Sep 17 00:00:00 2001 From: "pkotwicz@chromium.org" Date: Thu, 10 May 2012 01:51:56 +0000 Subject: Zoom the web contents 2x such that they are blurry in High DPI This patch applies a 2x transform to external textures. This is a quick fix till WebKit takes in DIP. Review URL: https://chromiumcodereview.appspot.com/10332077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136220 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/compositor/layer.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ui/compositor') diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index be6c577..2f376c6 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -578,17 +578,24 @@ void Layer::RecomputeDrawsContentAndUVRect() { WebKit::WebExternalTextureLayer texture_layer = web_layer_.to(); texture_layer.setTextureId(should_draw ? texture_id : 0); - gfx::Rect bounds_in_pixel = ConvertRectToPixel(this, bounds()); gfx::Size texture_size = texture_->size(); - gfx::Size size(std::min(bounds_in_pixel.width(), texture_size.width()), - std::min(bounds_in_pixel.height(), texture_size.height())); + + // As WebKit does not support DIP, WebKit is told of coordinates in DIP + // as if they were pixel coordinates. The texture is scaled here via + // the setBounds call. + // TODO(pkotwicz): Fix this code to take in account textures with pixel + // sizes once WebKit understands DIP. http://crbug.com/127455 + gfx::Size size(std::min(bounds().width(), texture_size.width()), + std::min(bounds().height(), texture_size.height())); WebKit::WebFloatRect rect( 0, 0, static_cast(size.width())/texture_size.width(), static_cast(size.height())/texture_size.height()); texture_layer.setUVRect(rect); - web_layer_.setBounds(size); + + gfx::Size size_in_pixel = ConvertSizeToPixel(this, bounds().size()); + web_layer_.setBounds(size_in_pixel); } } -- cgit v1.1