Index: cc/layers/picture_layer_impl.cc |
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
index 85249812d5fbc9d5ea119537e014ae5e80eb80b2..b8e094c8d847ff09fa44bb3b7e529b30f68096f3 100644 |
--- a/cc/layers/picture_layer_impl.cc |
+++ b/cc/layers/picture_layer_impl.cc |
@@ -790,27 +790,46 @@ void PictureLayerImpl::MarkVisibleResourcesAsRequired() const { |
// active layer is also missing when both this layer and its twin have 2 |
// tilings (high and low). This avoids having to iterate/track coverage of |
// non-ideal tilings during the last draw call on the active layer. |
- if (high_res && low_res && tilings_->num_tilings() == 2 && |
- twin_layer_ && twin_layer_->tilings_->num_tilings() == 2) { |
- twin_low_res = GetTwinTiling(low_res); |
- if (twin_low_res) |
+ if (ShouldHaveLowResTiling()) { |
+ if (high_res && low_res && tilings_->num_tilings() == 2 && |
+ twin_layer_ && twin_layer_->tilings_->num_tilings() == 2) { |
+ twin_low_res = GetTwinTiling(low_res); |
+ if (twin_low_res) |
+ twin_high_res = GetTwinTiling(high_res); |
+ } |
+ } else { |
+ if (high_res && tilings_->num_tilings() == 1 && |
+ twin_layer_ && twin_layer_->tilings_->num_tilings() == 1) { |
twin_high_res = GetTwinTiling(high_res); |
+ } |
} |
+ |
// If this layer and its twin have different transforms, then don't compare |
// them and only allow activating to high res tiles, since tiles on each layer |
// will be in different places on screen. |
- if (!twin_high_res || !twin_low_res || |
- twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || |
- draw_properties().screen_space_transform != |
- twin_layer_->draw_properties().screen_space_transform) { |
- twin_high_res = NULL; |
- twin_low_res = NULL; |
+ |
+ if (ShouldHaveLowResTiling()) { |
+ if (!twin_high_res || !twin_low_res || |
+ twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || |
+ draw_properties().screen_space_transform != |
+ twin_layer_->draw_properties().screen_space_transform) { |
+ twin_high_res = NULL; |
+ twin_low_res = NULL; |
+ } |
+ } else { |
+ if (!twin_high_res || |
+ twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || |
+ draw_properties().screen_space_transform != |
+ twin_layer_->draw_properties().screen_space_transform) { |
+ twin_high_res = NULL; |
+ } |
} |
// As a second pass, mark as required any visible high res tiles not filled in |
// by acceptable non-ideal tiles from the first pass. |
if (MarkVisibleTilesAsRequired( |
- high_res, twin_high_res, contents_scale_x(), rect, missing_region)) { |
+ high_res, twin_high_res, contents_scale_x(), rect, missing_region) && |
+ ShouldHaveLowResTiling()) { |
// As an optional third pass, if a high res tile was skipped because its |
// twin was also missing, then fall back to mark low res tiles as required |
// in case the active twin is substituting those for missing high res |