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

Unified Diff: cc/layers/picture_layer.cc

Issue 733233003: Revert of cc: Toggle LCD text at raster time instead of record time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 29190a0588d7e49717a459ac09c2bcffdb50d74a..dbfa63c76cbbb84bbf0c344bfd49e85ad38dfcee 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -23,7 +23,7 @@
recording_source_(new PicturePile),
instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
- can_use_lcd_text_for_update_(true) {
+ can_use_lcd_text_last_frame_(can_use_lcd_text()) {
}
PictureLayer::PictureLayer(ContentLayerClient* client,
@@ -95,14 +95,18 @@
update_source_frame_number_ = layer_tree_host()->source_frame_number();
bool updated = Layer::Update(queue, occlusion);
- bool can_use_lcd_text_changed = UpdateCanUseLCDText();
+ {
+ base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
+ true);
+ UpdateCanUseLCDText();
+ }
gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
visible_content_rect(), 1.f / contents_scale_x());
gfx::Size layer_size = paint_properties().bounds;
if (last_updated_visible_content_rect_ == visible_content_rect() &&
- recording_source_->GetSize() == layer_size && !can_use_lcd_text_changed &&
+ recording_source_->GetSize() == layer_size &&
pending_invalidation_.IsEmpty()) {
// Only early out if the visible content rect of this layer hasn't changed.
return updated;
@@ -132,9 +136,9 @@
DCHECK(client_);
updated |= recording_source_->UpdateAndExpandInvalidation(
client_, &recording_invalidation_, SafeOpaqueBackgroundColor(),
- contents_opaque(), client_->FillsBoundsCompletely(),
- can_use_lcd_text_for_update_, layer_size, visible_layer_rect,
- update_source_frame_number_, Picture::RECORD_NORMALLY);
+ contents_opaque(), client_->FillsBoundsCompletely(), layer_size,
+ visible_layer_rect, update_source_frame_number_,
+ Picture::RECORD_NORMALLY);
last_updated_visible_content_rect_ = visible_content_rect();
if (updated) {
@@ -156,14 +160,13 @@
return true;
}
-bool PictureLayer::UpdateCanUseLCDText() {
- if (!can_use_lcd_text_for_update_)
- return false; // Don't allow the LCD text state to change once disabled.
- if (can_use_lcd_text_for_update_ == can_use_lcd_text())
- return false;
-
- can_use_lcd_text_for_update_ = can_use_lcd_text();
- return true;
+void PictureLayer::UpdateCanUseLCDText() {
+ if (can_use_lcd_text_last_frame_ == can_use_lcd_text())
+ return;
+
+ can_use_lcd_text_last_frame_ = can_use_lcd_text();
+ if (client_)
+ 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