summaryrefslogtreecommitdiffstats
path: root/cc/blink
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-11-17 13:47:49 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-17 21:48:17 +0000
commitad672f645e82ca677978b097a170c908c614d184 (patch)
tree567bb95eb11adaf7729cef22b691087c7c1bc374 /cc/blink
parent9f3e33daaac0f6c0835dd69ef57c89cb89e706f8 (diff)
downloadchromium_src-ad672f645e82ca677978b097a170c908c614d184.zip
chromium_src-ad672f645e82ca677978b097a170c908c614d184.tar.gz
chromium_src-ad672f645e82ca677978b097a170c908c614d184.tar.bz2
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}
Diffstat (limited to 'cc/blink')
-rw-r--r--cc/blink/web_content_layer_impl.cc25
-rw-r--r--cc/blink/web_content_layer_impl.h1
2 files changed, 5 insertions, 21 deletions
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<WebLayerImpl> layer_;