Commit 41a7fd69 authored by ajuma@chromium.org's avatar ajuma@chromium.org

Revert 261000 "Re-raster GPU-rasterized layers during scale animations"

This reverts http://crrev.com/216313007.

Re-rastering a layer with text during a scale animation can cause
many texture uploads during the animation (as new glyphs are generated
at each scale).

To re-enable this behavior in the future, we need to either make it
dependent on distance-field fonts, or we need a way to reuse glyphs
during scale animations (allowing text to become slightly blurry rather
than generating new glyphs every frame).

BUG=366225

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269701 0039d316-1c4b-4281-b951-d872f2087c98
parent 15c17966
...@@ -1034,11 +1034,6 @@ bool PictureLayerImpl::ShouldAdjustRasterScale( ...@@ -1034,11 +1034,6 @@ bool PictureLayerImpl::ShouldAdjustRasterScale(
if (was_animating_transform_to_screen_ != animating_transform_to_screen) if (was_animating_transform_to_screen_ != animating_transform_to_screen)
return true; return true;
if (animating_transform_to_screen &&
raster_contents_scale_ != ideal_contents_scale_ &&
use_gpu_rasterization())
return true;
bool is_pinching = layer_tree_impl()->PinchGestureActive(); bool is_pinching = layer_tree_impl()->PinchGestureActive();
if (is_pinching && raster_page_scale_) { if (is_pinching && raster_page_scale_) {
// We change our raster scale when it is: // We change our raster scale when it is:
...@@ -1133,10 +1128,10 @@ void PictureLayerImpl::RecalculateRasterScales( ...@@ -1133,10 +1128,10 @@ void PictureLayerImpl::RecalculateRasterScales(
raster_contents_scale_ = raster_contents_scale_ =
std::max(raster_contents_scale_, MinimumContentsScale()); std::max(raster_contents_scale_, MinimumContentsScale());
// If we're not re-rasterizing during animation, rasterize at the maximum // Since we're not re-rasterizing during animation, rasterize at the maximum
// scale that will occur during the animation, if the maximum scale is // scale that will occur during the animation, if the maximum scale is
// known. // known.
if (animating_transform_to_screen && !use_gpu_rasterization()) { if (animating_transform_to_screen) {
if (maximum_animation_contents_scale > 0.f) { if (maximum_animation_contents_scale > 0.f) {
raster_contents_scale_ = raster_contents_scale_ =
std::max(raster_contents_scale_, maximum_animation_contents_scale); std::max(raster_contents_scale_, maximum_animation_contents_scale);
......
...@@ -1945,62 +1945,6 @@ TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) { ...@@ -1945,62 +1945,6 @@ TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) {
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 4.f); EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 4.f);
} }
TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForGpuRasterization) {
gfx::Size tile_size(host_impl_.settings().default_tile_size);
SetupDefaultTrees(tile_size);
host_impl_.pending_tree()->SetUseGpuRasterization(true);
host_impl_.active_tree()->SetUseGpuRasterization(true);
EXPECT_TRUE(pending_layer_->use_gpu_rasterization());
EXPECT_TRUE(active_layer_->use_gpu_rasterization());
float contents_scale = 1.f;
float device_scale = 1.f;
float page_scale = 1.f;
float maximum_animation_scale = 1.f;
bool animating_transform = false;
SetContentsScaleOnBothLayers(contents_scale,
device_scale,
page_scale,
maximum_animation_scale,
animating_transform);
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 1.f);
// Changing contents scale during an animation should cause tiling resolution
// to change, since we're GPU-rasterizing. The maximum animation scale should
// not have any effect.
animating_transform = true;
contents_scale = 2.f;
maximum_animation_scale = 4.f;
SetContentsScaleOnBothLayers(contents_scale,
device_scale,
page_scale,
maximum_animation_scale,
animating_transform);
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 2.f);
// Since we're re-rasterizing during the animation, scales smaller than 1
// should be respected.
contents_scale = 0.5f;
SetContentsScaleOnBothLayers(contents_scale,
device_scale,
page_scale,
maximum_animation_scale,
animating_transform);
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 0.5f);
// Tiling resolution should also update once we stop animating.
contents_scale = 4.f;
animating_transform = false;
SetContentsScaleOnBothLayers(contents_scale,
device_scale,
page_scale,
maximum_animation_scale,
animating_transform);
EXPECT_BOTH_EQ(HighResTiling()->contents_scale(), 4.f);
}
TEST_F(PictureLayerImplTest, LayerRasterTileIterator) { TEST_F(PictureLayerImplTest, LayerRasterTileIterator) {
gfx::Size tile_size(100, 100); gfx::Size tile_size(100, 100);
gfx::Size layer_bounds(1000, 1000); gfx::Size layer_bounds(1000, 1000);
......
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