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

Unified Diff: cc/layers/picture_layer.cc

Issue 315393002: Record SkPicture with correct LCD text setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-add PictureLayer changes Created 6 years, 6 months 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/layers/picture_layer.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index ae823a6cec4f0cc8d251e86845c385559cd25777..88ed4fba58d1e11cbd27180ec68297c6371622c4 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) {}
+ update_source_frame_number_(-1),
+ can_use_lcd_text_last_frame_(can_use_lcd_text()) {
+}
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);
+ UpdateCanUseLCDText();
+
gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
visible_content_rect(), 1.f / contents_scale_x());
@@ -157,6 +161,15 @@ bool PictureLayer::SupportsLCDText() const {
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 {
// We could either flatten the PicturePile into a single SkPicture,
// or paint a fresh one depending on what we intend to do with the
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698