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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 2681183002: cc: Add flag to disable future mask tiling. (Closed)
Patch Set: Correct my mistake in rebase. Created 3 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/layers/picture_layer.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('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 626c4ae4b16356b6e7c50f9a3cff829d927902bd..f112497b5d1c026ba8285769add88377b8ab57d2 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -692,13 +692,11 @@ std::unique_ptr<Tile> PictureLayerImpl::CreateTile(
const Tile::CreateInfo& info) {
int flags = 0;
- // We don't handle solid color masks, so we shouldn't bother analyzing those.
+ // We don't handle solid color masks if mask tiling is disabled, we also don't
+ // handle solid color single texture masks if the flag is enabled, so we
+ // shouldn't bother analyzing those.
// Otherwise, always analyze to maximize memory savings.
- // TODO(sunxd): the condition should be (mask_type_ ==
- // Layer::LayerMaskType::NOT_MASK
- // || (layer_tree_impl()->settings().enable_mask_tiling && mask_type ==
- // Layer::LayerMaskType::MULTI_TEXTURE_MASK)).
- if (mask_type_ == Layer::LayerMaskType::NOT_MASK)
+ if (mask_type_ != Layer::LayerMaskType::SINGLE_TEXTURE_MASK)
flags = Tile::USE_PICTURE_ANALYSIS;
if (contents_opaque())
@@ -740,11 +738,7 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
int max_texture_size =
layer_tree_impl()->resource_provider()->max_texture_size();
- // TODO(sunxd): the condition should be mask_type_ == Layer::LayerMaskType::
- // SINGLE_TEXTURE_MASK || (mask_type_ ==
- // Layer::LayerMaskType::MULTI_TEXTURE_MASK &&
- // !layer_tree_impl()->settings().enable_mask_tiling)
- if (mask_type_ != Layer::LayerMaskType::NOT_MASK) {
+ if (mask_type_ == Layer::LayerMaskType::SINGLE_TEXTURE_MASK) {
// Masks are not tiled, so if we can't cover the whole mask with one tile,
// we shouldn't have such a tiling at all.
DCHECK_LE(content_bounds.width(), max_texture_size);
@@ -1178,16 +1172,12 @@ float PictureLayerImpl::MinimumContentsScale() const {
}
float PictureLayerImpl::MaximumContentsScale() const {
- // Masks can not have tilings that would become larger than the
- // max_texture_size since they use a single tile for the entire
- // tiling. Other layers can have tilings such that dimension * scale
- // does not overflow.
- // TODO(sunxd): the condition should be:
- // mask_type_ == Layer::LayerMaskType::SINGLE_TEXTURE_MASK || (mask_type_ ==
- // Layer::LayerMaskType::MULTI_TEXTURE_MASK && !layer_tree_impl()->settings().
- // enable_mask_tiling)
+ // When mask tiling is disabled or the mask is single textured, masks can not
+ // have tilings that would become larger than the max_texture_size since they
+ // use a single tile for the entire tiling. Other layers can have tilings such
+ // that dimension * scale does not overflow.
float max_dimension = static_cast<float>(
- mask_type_ != Layer::LayerMaskType::NOT_MASK
+ mask_type_ == Layer::LayerMaskType::SINGLE_TEXTURE_MASK
? layer_tree_impl()->resource_provider()->max_texture_size()
: std::numeric_limits<int>::max());
float max_scale_width = max_dimension / bounds().width();
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698