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..5c8da3902efdc1047b657f977248fb389bbbb7b0 100644 |
--- a/cc/layers/picture_layer_impl.cc |
+++ b/cc/layers/picture_layer_impl.cc |
@@ -787,19 +787,25 @@ void PictureLayerImpl::MarkVisibleResourcesAsRequired() const { |
const PictureLayerTiling* twin_low_res = NULL; |
// As a simplification, only allow activating to skip twin tiles that the |
- // 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) |
+ // active layer is also missing when both this layer and its twin have |
+ // "simple" sets of tilings: only 2 tilings (high and low) for case, when low |
+ // res is enabled; or only 1 high res tiling, when low res is disabled. This |
+ // avoids having to iterate/track coverage of non-ideal tilings during the |
+ // last draw call on the active layer. |
+ bool should_have_low_res = ShouldHaveLowResTiling(); |
+ if (high_res && (low_res || !should_have_low_res) && twin_layer_ && |
+ tilings_->num_tilings() == twin_layer_->tilings_->num_tilings() && |
+ tilings_->num_tilings() <= 2) { |
reveman
2014/05/13 15:38:05
what if |should_have_low_res| is true but tilings_
Sergey
2014/05/14 05:53:35
If |should_have_low_res| is true and tilings_->num
reveman
2014/05/14 15:13:49
Could be low_res != NULL if high_res = NULL but we
|
+ if (should_have_low_res) |
+ twin_low_res = GetTwinTiling(low_res); |
+ if (twin_low_res || !should_have_low_res) |
reveman
2014/05/13 15:38:05
Do we need this check or could we just make it unc
Sergey
2014/05/14 05:53:35
For some reason before we only executed this if we
reveman
2014/05/14 15:13:49
Fine to keep existing logic if you prefer but clea
Sergey
2014/05/15 01:08:04
Ok, let it be my next patch :) And I would like to
|
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 || |
+ if (!twin_high_res || (!twin_low_res && should_have_low_res) || |
twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || |
draw_properties().screen_space_transform != |
twin_layer_->draw_properties().screen_space_transform) { |
@@ -810,11 +816,12 @@ void PictureLayerImpl::MarkVisibleResourcesAsRequired() const { |
// 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) && |
+ should_have_low_res) { |
reveman
2014/05/13 15:38:05
Maybe move the "should_have_low_res" check into it
Sergey
2014/05/14 05:53:35
Done.
|
// 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 |
- // content. |
+ // content. Only suitable, when low res is enabled. |
MarkVisibleTilesAsRequired( |
low_res, twin_low_res, contents_scale_x(), rect, missing_region); |
} |