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 { |