Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4553)

Unified Diff: cc/layers/content_layer.cc

Issue 684543006: cc: Toggle LCD text at raster time instead of record time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcdraster: bettertestsyay Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/content_layer.cc
diff --git a/cc/layers/content_layer.cc b/cc/layers/content_layer.cc
index 88031e49631cfd77c00c157a9f9931bf2e5f2d65..28375d3ff3b31e6152db6528c5a4459b27a601bf 100644
--- a/cc/layers/content_layer.cc
+++ b/cc/layers/content_layer.cc
@@ -38,7 +38,8 @@ scoped_refptr<ContentLayer> ContentLayer::Create(ContentLayerClient* client) {
ContentLayer::ContentLayer(ContentLayerClient* client)
: TiledLayer(),
client_(client),
- can_use_lcd_text_last_frame_(can_use_lcd_text()) {
+ can_use_lcd_text_for_update_(false),
+ ignore_lcd_text_change_(false) {
}
ContentLayer::~ContentLayer() {}
@@ -119,12 +120,15 @@ void ContentLayer::SetContentsOpaque(bool opaque) {
}
void ContentLayer::UpdateCanUseLCDText() {
- if (can_use_lcd_text_last_frame_ == can_use_lcd_text())
+ if (can_use_lcd_text_for_update_ == can_use_lcd_text())
+ return;
+ // Once LCD text decision has been made, only allow it to be disabled.
+ if (can_use_lcd_text() && ignore_lcd_text_change_)
return;
- can_use_lcd_text_last_frame_ = can_use_lcd_text();
- if (client_)
- client_->DidChangeLayerCanUseLCDText();
+ can_use_lcd_text_for_update_ = can_use_lcd_text();
+ ignore_lcd_text_change_ = true;
+ SetNeedsDisplay();
}
bool ContentLayer::SupportsLCDText() const {

Powered by Google App Engine
This is Rietveld 408576698