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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix to ensure valid tile size plus some code cleanup Created 5 years 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/base/switches.cc ('k') | cc/output/renderer_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 0849c516bab58e63b183c957eb877e748f85187a..c2bb3e9f37895177bf55f3b2b38dcc4a3e4a7927 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -767,6 +767,13 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
tile_height = std::min(tile_height, default_tile_height);
}
+ // Ensure that tiles are an even multiple of 4 in size.
reveman 2015/12/01 17:27:24 Unconditionally use MathUtil::UncheckedRoundUp(til
christiank 2015/12/02 16:18:14 Done.
+ if (tile_width % 4 != 0 || tile_height % 4 != 0) {
+ // Round the size up to the nearest multiple of four.
+ tile_width = 4 * std::ceil(static_cast<float>(tile_width) / 4);
+ tile_height = 4 * std::ceil(static_cast<float>(tile_height) / 4);
+ }
+
// Under no circumstance should we be larger than the max texture size.
tile_width = std::min(tile_width, max_texture_size);
tile_height = std::min(tile_height, max_texture_size);
« no previous file with comments | « cc/base/switches.cc ('k') | cc/output/renderer_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698