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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 336793003: cc: Move CalculateContentsScale from LayerImpl to LayerTreeHostCommon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed 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/layer_impl.cc ('k') | cc/trees/layer_tree_host_common_unittest.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 ccaf894505bdb567968dff4ae419797e194108b6..ebb51a88ceb943c50d9746b85637a7d99d5b4e36 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -932,9 +932,19 @@ static inline void UpdateLayerScaleDrawProperties(
layer->draw_properties().device_scale_factor = device_scale_factor;
}
-template <typename LayerType>
static inline void CalculateContentsScale(
- LayerType* layer,
+ LayerImpl* layer,
+ float contents_scale,
+ float device_scale_factor,
+ float page_scale_factor,
+ float maximum_animation_contents_scale,
+ bool animating_transform_to_screen) {
+ // LayerImpl has all of its content scales and bounds pushed from the Main
+ // thread during commit and just uses those values as-is.
+}
+
+static inline void CalculateContentsScale(
+ Layer* layer,
float contents_scale,
float device_scale_factor,
float page_scale_factor,
@@ -949,7 +959,7 @@ static inline void CalculateContentsScale(
&layer->draw_properties().contents_scale_y,
&layer->draw_properties().content_bounds);
- LayerType* mask_layer = layer->mask_layer();
+ Layer* mask_layer = layer->mask_layer();
if (mask_layer) {
mask_layer->CalculateContentsScale(
contents_scale,
@@ -962,7 +972,7 @@ static inline void CalculateContentsScale(
&mask_layer->draw_properties().content_bounds);
}
- LayerType* replica_mask_layer =
+ Layer* replica_mask_layer =
layer->replica_layer() ? layer->replica_layer()->mask_layer() : NULL;
if (replica_mask_layer) {
replica_mask_layer->CalculateContentsScale(
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698