diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 01:51:56 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 01:51:56 +0000 |
commit | 61d0dc68ba682c8e5b81e79d62837512f3d7c303 (patch) | |
tree | da7b5416df5e1b776347eeba6f127e1d8709ad30 | |
parent | e08255671738c597992f5067bc52eccf75f1afa1 (diff) | |
download | chromium_src-61d0dc68ba682c8e5b81e79d62837512f3d7c303.zip chromium_src-61d0dc68ba682c8e5b81e79d62837512f3d7c303.tar.gz chromium_src-61d0dc68ba682c8e5b81e79d62837512f3d7c303.tar.bz2 |
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
-rw-r--r-- | ui/compositor/layer.cc | 15 |
1 files changed, 11 insertions, 4 deletions
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<WebKit::WebExternalTextureLayer>(); 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<float>(size.width())/texture_size.width(), static_cast<float>(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); } } |