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

Unified Diff: cc/picture_layer.cc

Issue 12221077: Fixing tile grid size used by cc:Picture to make it respect current tile configuration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing copy pasta Created 7 years, 10 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 | « cc/picture.cc ('k') | cc/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_layer.cc
diff --git a/cc/picture_layer.cc b/cc/picture_layer.cc
index b9ce65a50240b32e79e5b2e4c94c09d4e4ca418c..ab6e2f7ad2e26415ba35497b04dce77d1aabc47b 100644
--- a/cc/picture_layer.cc
+++ b/cc/picture_layer.cc
@@ -46,8 +46,16 @@ void PictureLayer::pushPropertiesTo(LayerImpl* base_layer) {
void PictureLayer::setLayerTreeHost(LayerTreeHost* host) {
Layer::setLayerTreeHost(host);
- if (host)
- pile_->SetMinContentsScale(host->settings().minimumContentsScale);
+ if (host) {
+ pile_->SetMinContentsScale(host->settings().minimumContentsScale);
+ gfx::Size tile_size = host->settings().defaultTileSize;
+ float scale = host->deviceScaleFactor();
+ gfx::Size tile_grid_size(
+ static_cast<int>(ceil(tile_size.width() / scale)),
+ static_cast<int>(ceil(tile_size.height() / scale)));
+ int border_pixels = static_cast<int>(ceil(1.0f / scale));
enne (OOO) 2013/02/21 18:23:13 I agree that the border pixels are scaled as well,
+ pile_->SetTileGridSize(tile_grid_size, border_pixels);
+ }
}
void PictureLayer::setNeedsDisplayRect(const gfx::RectF& layer_rect) {
« no previous file with comments | « cc/picture.cc ('k') | cc/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698