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

Unified Diff: cc/layers/picture_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/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index fdf25f48e9db2760e79b7edbc243f411ff2f8901..a4a5a33067ef72a076f29f84b257f8e2ead3225a 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -21,7 +21,8 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
: client_(client),
instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
- can_use_lcd_text_last_frame_(can_use_lcd_text()) {
+ can_use_lcd_text_for_update_(false),
+ ignore_lcd_text_change_(false) {
}
PictureLayer::~PictureLayer() {
@@ -126,9 +127,9 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
DCHECK(client_);
updated |= pile_.UpdateAndExpandInvalidation(
client_, &pile_invalidation_, SafeOpaqueBackgroundColor(),
- contents_opaque(), client_->FillsBoundsCompletely(), layer_size,
- visible_layer_rect, update_source_frame_number_,
- Picture::RECORD_NORMALLY);
+ contents_opaque(), client_->FillsBoundsCompletely(),
+ can_use_lcd_text_for_update_, layer_size, visible_layer_rect,
+ update_source_frame_number_, Picture::RECORD_NORMALLY);
last_updated_visible_content_rect_ = visible_content_rect();
if (updated) {
@@ -151,12 +152,15 @@ bool PictureLayer::SupportsLCDText() const {
}
void PictureLayer::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();
}
skia::RefPtr<SkPicture> PictureLayer::GetPicture() const {

Powered by Google App Engine
This is Rietveld 408576698