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

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: header 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
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index a6b68cc12d5f2e7801aec8fd882b6aa3392894a8..eb301bf5bd37e47399f61b4bcea8e6f79ca73bf0 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -22,7 +22,7 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
recording_source_(new PicturePile),
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_(true) {
}
PictureLayer::~PictureLayer() {
@@ -126,10 +126,12 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
// to the impl side so that it drops tiles that may not have a recording
// for them.
DCHECK(client_);
+ bool can_use_lcd_text =
+ can_use_lcd_text_for_update_ == LCD_TEXT_STATE_ALLOWED;
enne (OOO) 2014/11/12 21:47:30 Er, isn't can_use_lcd_text_for_update_ now a bool?
danakj 2014/11/12 21:47:52 Er, how did this compile?
updated |= recording_source_->UpdateAndExpandInvalidation(
client_, &recording_invalidation_, SafeOpaqueBackgroundColor(),
- contents_opaque(), client_->FillsBoundsCompletely(), layer_size,
- visible_layer_rect, update_source_frame_number_,
+ contents_opaque(), client_->FillsBoundsCompletely(), can_use_lcd_text,
+ layer_size, visible_layer_rect, update_source_frame_number_,
Picture::RECORD_NORMALLY);
last_updated_visible_content_rect_ = visible_content_rect();
@@ -153,12 +155,13 @@ 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_)
+ return; // Don't allow the LcdTextState to change once disabled.
+ if (can_use_lcd_text_for_update_ == can_use_lcd_text())
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();
+ client_->DidChangeLayerCanUseLcdText();
}
skia::RefPtr<SkPicture> PictureLayer::GetPicture() const {
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698