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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 13863015: Add flag for drawing layers to screen with Ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 years, 7 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/test/pixel_test.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index f0e5b8ff23ad897b03d2907367361aa8cfaa2b42..b8ab367d60755965c57d02ea1d75181810c5b816 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1267,6 +1267,21 @@ static void CalculateDrawPropertiesInternal(
layer_draw_properties.render_target = layer->parent()->render_target();
}
+ // Mark whether a layer could be drawn directly to the back buffer, for
+ // example when it could use LCD text even though it's in a non-contents
+ // opaque layer. This means that it can't be drawn to an intermediate
+ // render target and also that no blending is applied to the layer as a whole
+ // (meaning that its contents don't have to be pre-composited into a bitmap or
+ // a render target).
+ //
+ // Ignoring animations is an optimization,
+ // as it means that we're going to need some retained resources for this
+ // layer in the near future even if its opacity is 1 now.
+ layer_draw_properties.can_draw_directly_to_backbuffer =
+ IsRootLayer(layer_draw_properties.render_target) &&
+ layer->draw_properties().opacity == 1.f &&
+ !animating_opacity_to_screen;
+
if (adjust_text_aa)
layer_draw_properties.can_use_lcd_text = layer_can_use_lcd_text;
« no previous file with comments | « cc/test/pixel_test.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698