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

Unified Diff: cc/blink/web_content_layer_impl.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/blink/web_content_layer_impl.h ('k') | cc/layers/content_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_content_layer_impl.cc
diff --git a/cc/blink/web_content_layer_impl.cc b/cc/blink/web_content_layer_impl.cc
index d0a4cca4722b57166a92947c8de69e977729a4d7..6dfdad9c160fc56d7d7ef7e88863aebc33617c20 100644
--- a/cc/blink/web_content_layer_impl.cc
+++ b/cc/blink/web_content_layer_impl.cc
@@ -19,12 +19,13 @@
namespace cc_blink {
WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client)
- : client_(client) {
+ : client_(client), ignore_lcd_text_change_(false) {
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() {
@@ -53,14 +54,28 @@
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 {
« no previous file with comments | « cc/blink/web_content_layer_impl.h ('k') | cc/layers/content_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698