Commit 95cd9b72 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Allow a layer to use LCD text again

Previously once a layer became not LCD-text capable, it would never
use LCD-text again. I think this was to avoid re-raterization during
animation. As we don't allow LCD text with will-change:transform and
during animation, and we skip re-rasterization on LCD text status
change during animation, there is no reason to keep that logic.

Bug: 1111195
Change-Id: Ib544be76c114e520572c0ccf5d88dd96bf7db151
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2344810Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798939}
parent efabe852
...@@ -819,10 +819,6 @@ bool PictureLayerImpl::UpdateCanUseLCDText( ...@@ -819,10 +819,6 @@ bool PictureLayerImpl::UpdateCanUseLCDText(
if (!layer_tree_impl()->IsSyncTree()) if (!layer_tree_impl()->IsSyncTree())
return false; return false;
// Once we disable lcd text, we don't re-enable it.
if (!can_use_lcd_text())
return false;
auto new_lcd_text_disallowed_reason = auto new_lcd_text_disallowed_reason =
ComputeLCDTextDisallowedReason(raster_translation_aligns_pixels); ComputeLCDTextDisallowedReason(raster_translation_aligns_pixels);
if (lcd_text_disallowed_reason_ == new_lcd_text_disallowed_reason) if (lcd_text_disallowed_reason_ == new_lcd_text_disallowed_reason)
......
...@@ -5028,11 +5028,10 @@ TEST_F(LegacySWPictureLayerImplTest, UpdateLCDTextInvalidatesPendingTree) { ...@@ -5028,11 +5028,10 @@ TEST_F(LegacySWPictureLayerImplTest, UpdateLCDTextInvalidatesPendingTree) {
pending_layer()->SetContentsOpaque(true); pending_layer()->SetContentsOpaque(true);
pending_layer()->UpdateTiles(); pending_layer()->UpdateTiles();
// Once we disable lcd text, we don't re-enable it. EXPECT_TRUE(pending_layer()->can_use_lcd_text());
EXPECT_FALSE(pending_layer()->can_use_lcd_text());
EXPECT_TRUE(pending_layer()->HighResTiling()->has_tiles()); EXPECT_TRUE(pending_layer()->HighResTiling()->has_tiles());
for (Tile* tile : pending_layer()->HighResTiling()->AllTilesForTesting()) for (Tile* tile : pending_layer()->HighResTiling()->AllTilesForTesting())
EXPECT_FALSE(tile->can_use_lcd_text()); EXPECT_TRUE(tile->can_use_lcd_text());
} }
TEST_F(LegacySWPictureLayerImplTest, UpdateLCDTextPushToActiveTree) { TEST_F(LegacySWPictureLayerImplTest, UpdateLCDTextPushToActiveTree) {
......
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