| Index: cc/layers/picture_layer.cc
|
| diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
|
| index ae823a6cec4f0cc8d251e86845c385559cd25777..489c30c3b20fe346d6fd6d37941dfb8999427fea 100644
|
| --- a/cc/layers/picture_layer.cc
|
| +++ b/cc/layers/picture_layer.cc
|
| @@ -21,7 +21,9 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
|
| pile_(make_scoped_refptr(new PicturePile())),
|
| instrumentation_object_tracker_(id()),
|
| is_mask_(false),
|
| - update_source_frame_number_(-1) {}
|
| + use_lcd_text_(true),
|
| + update_source_frame_number_(-1) {
|
| +}
|
|
|
| PictureLayer::~PictureLayer() {
|
| }
|
| @@ -88,6 +90,8 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
|
| update_source_frame_number_ = layer_tree_host()->source_frame_number();
|
| bool updated = Layer::Update(queue, occlusion);
|
|
|
| + UpdateUseLCDText();
|
| +
|
| gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
|
| visible_content_rect(), 1.f / contents_scale_x());
|
|
|
| @@ -120,6 +124,7 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
|
| SafeOpaqueBackgroundColor(),
|
| contents_opaque(),
|
| client_->FillsBoundsCompletely(),
|
| + use_lcd_text_,
|
| pile_invalidation_,
|
| visible_layer_rect,
|
| update_source_frame_number_,
|
| @@ -172,6 +177,7 @@ skia::RefPtr<SkPicture> PictureLayer::GetPicture() const {
|
| SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0);
|
| client_->PaintContents(canvas,
|
| gfx::Rect(width, height),
|
| + use_lcd_text_,
|
| &opaque,
|
| ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
|
| skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
|
| @@ -186,4 +192,17 @@ void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
|
| benchmark->RunOnLayer(this);
|
| }
|
|
|
| +void PictureLayer::UpdateUseLCDText() {
|
| + if (use_lcd_text_ == can_use_lcd_text())
|
| + return;
|
| +
|
| + // LCD text starts out enabled and can only be disabled.
|
| + if (!use_lcd_text_)
|
| + return;
|
| +
|
| + use_lcd_text_ = can_use_lcd_text();
|
| + if (client_->PaintsLCDText())
|
| + SetNeedsDisplay();
|
| +}
|
| +
|
| } // namespace cc
|
|
|