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

Unified Diff: ui/compositor/layer.cc

Issue 10332077: Zoom the web contents 2x such that they are blurry in High DPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer diff Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index be6c577f5b727c00e98b7c388d770d328b762ffb..2f376c6b56b209d3e3c6384f38703412dd6bbcdd 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
piman 2012/05/09 23:31:03 Note: once you want to provide support for that, i
+ 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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698