Commit 6382a215 authored by ernstm@chromium.org's avatar ernstm@chromium.org

cc: don't add low-res tiling to GPU rasterized layers.

R=enne@chromium.org,vmpstr@chromium.org
BUG=332593

Review URL: https://codereview.chromium.org/132083007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244227 0039d316-1c4b-4281-b951-d872f2087c98
parent a2bc32f6
......@@ -945,8 +945,9 @@ void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen) {
// prevents wastefully creating a paired low res tiling for every new high res
// tiling during a pinch or a CSS animation.
bool is_pinching = layer_tree_impl()->PinchGestureActive();
if (!is_pinching && !animating_transform_to_screen && !low_res &&
low_res != high_res)
if (ShouldHaveLowResTiling() && !is_pinching &&
!animating_transform_to_screen &&
!low_res && low_res != high_res)
low_res = AddTiling(low_res_raster_contents_scale_);
// Set low-res if we have one.
......@@ -1092,8 +1093,8 @@ void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
tiling->contents_scale() <= max_acceptable_high_res_scale)
continue;
// Low resolution can't activate, so only keep one around.
if (tiling->resolution() == LOW_RESOLUTION)
// Keep low resolution tilings, if the layer should have them.
if (tiling->resolution() == LOW_RESOLUTION && ShouldHaveLowResTiling())
continue;
// Don't remove tilings that are being used (and thus would cause a flash.)
......
......@@ -86,6 +86,9 @@ class CC_EXPORT PictureLayerImpl
void RemoveAllTilings();
void SyncFromActiveLayer(const PictureLayerImpl* other);
void ManageTilings(bool animating_transform_to_screen);
bool ShouldHaveLowResTiling() const {
return !should_use_gpu_rasterization();
}
virtual bool ShouldAdjustRasterScale(
bool animating_transform_to_screen) const;
virtual void RecalculateRasterScales(
......
......@@ -1430,7 +1430,7 @@ TEST_F(PictureLayerImplTest, TileSizeForGpuRasterization) {
pending_layer_->CalculateContentsScale(
1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds);
ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings());
ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings());
pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment