From ad672f645e82ca677978b097a170c908c614d184 Mon Sep 17 00:00:00 2001 From: danakj Date: Mon, 17 Nov 2014 13:47:49 -0800 Subject: cc: Toggle LCD text at raster time instead of record time. Always tell blink that it can use LCD text (in future this can stop being passed at all). And at raster time: - If LCD text is allowed initialize SkSurfaceProps with the LegacyHost parameter which will cause skia to pick an LCD text format matching current behaviour. - If LCD is not allowed initialize SkSurfaceProps with an "unknown pixelformat" causing LCD text to not be used. This also removes the need for SK_SUPPORT_LEGACY_TEXTRENDERMODE from resource_provider.cc. R=enne,reveman BUG=430617 Review URL: https://codereview.chromium.org/684543006 Cr-Commit-Position: refs/heads/master@{#304486} --- cc/blink/web_content_layer_impl.cc | 25 +++++-------------------- cc/blink/web_content_layer_impl.h | 1 - 2 files changed, 5 insertions(+), 21 deletions(-) (limited to 'cc/blink') diff --git a/cc/blink/web_content_layer_impl.cc b/cc/blink/web_content_layer_impl.cc index 6dfdad9..d0a4cca 100644 --- a/cc/blink/web_content_layer_impl.cc +++ b/cc/blink/web_content_layer_impl.cc @@ -19,13 +19,12 @@ using cc::PictureLayer; namespace cc_blink { WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client) - : client_(client), ignore_lcd_text_change_(false) { + : client_(client) { if (WebLayerImpl::UsingPictureLayer()) layer_ = make_scoped_ptr(new WebLayerImpl(PictureLayer::Create(this))); else layer_ = make_scoped_ptr(new WebLayerImpl(ContentLayer::Create(this))); layer_->layer()->SetIsDrawable(true); - can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); } WebContentLayerImpl::~WebContentLayerImpl() { @@ -54,30 +53,16 @@ void WebContentLayerImpl::PaintContents( if (!client_) return; + // TODO(danakj): Stop passing this to blink it should always use LCD when it + // wants to. crbug.com/430617 + bool can_use_lcd_text = true; client_->paintContents( - canvas, - clip, - can_use_lcd_text_, + canvas, clip, can_use_lcd_text, graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED ? blink::WebContentLayerClient::GraphicsContextEnabled : blink::WebContentLayerClient::GraphicsContextDisabled); } -void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { - // It is important to make this comparison because the LCD text status - // here can get out of sync with that in the layer. - if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) - return; - - // LCD text cannot be enabled once disabled. - if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) - return; - - can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); - ignore_lcd_text_change_ = true; - layer_->invalidate(); -} - bool WebContentLayerImpl::FillsBoundsCompletely() const { return false; } diff --git a/cc/blink/web_content_layer_impl.h b/cc/blink/web_content_layer_impl.h index b9bb871..2966bd4 100644 --- a/cc/blink/web_content_layer_impl.h +++ b/cc/blink/web_content_layer_impl.h @@ -40,7 +40,6 @@ class WebContentLayerImpl : public blink::WebContentLayer, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus graphics_context_status) override; - void DidChangeLayerCanUseLCDText() override; bool FillsBoundsCompletely() const override; scoped_ptr layer_; -- cgit v1.1