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

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: Remove needs_conversion, fix tile size unit test and move modulo 4 DCHECK (for tests) 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
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 405d68590da67bd73005aa601c48c66c0ad97627..f54764814e2924a4c19adf8bcf2cccec6b3ad6e3 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -48,6 +48,10 @@ const int kMinHeightForGpuRasteredTile = 256;
// of using the same tile size.
const int kTileRoundUp = 64;
+// For performance reasons and to support compressed tile textures, tile
+// width and height should be an even multiple of 4 in size.
+const int kTileMinimalAlignment = 4;
+
} // namespace
namespace cc {
@@ -767,6 +771,10 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
tile_height = std::min(tile_height, default_tile_height);
}
+ // Ensure that tile width and height are properly aligned.
+ tile_width = MathUtil::UncheckedRoundUp(tile_width, kTileMinimalAlignment);
+ tile_height = MathUtil::UncheckedRoundUp(tile_height, kTileMinimalAlignment);
+
// 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);

Powered by Google App Engine
This is Rietveld 408576698