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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 749393005: Translate the overscroll elasticity layer by the overscroll amount (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aelias
Patch Set: Created 6 years 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/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_common_perftest.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 6d75687201a55b640db73bb1d10ac125bdf63c5a..5ed64246afea0e9cec12124967b383cc88d55914 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1267,6 +1267,8 @@ struct SubtreeGlobals {
float device_scale_factor;
float page_scale_factor;
const LayerType* page_scale_application_layer;
+ gfx::Vector2dF elastic_overscroll;
+ const LayerType* elastic_overscroll_application_layer;
bool can_adjust_raster_scales;
bool can_render_to_separate_surface;
bool layers_always_allowed_lcd_text;
@@ -2100,6 +2102,10 @@ static void CalculateDrawPropertiesInternal(
globals.page_scale_factor);
data_for_children.in_subtree_of_page_scale_application_layer = true;
}
+ if (layer == globals.elastic_overscroll_application_layer) {
+ data_for_children.parent_matrix.Translate(globals.elastic_overscroll.x(),
+ globals.elastic_overscroll.y());
+ }
// Flatten to 2D if the layer doesn't preserve 3D.
if (layer->should_flatten_transform())
@@ -2378,6 +2384,9 @@ static void ProcessCalcDrawPropsInputs(
inputs.device_scale_factor * device_transform_scale;
globals->page_scale_factor = inputs.page_scale_factor;
globals->page_scale_application_layer = inputs.page_scale_application_layer;
+ globals->elastic_overscroll = inputs.elastic_overscroll;
+ globals->elastic_overscroll_application_layer =
+ inputs.elastic_overscroll_application_layer;
globals->can_render_to_separate_surface =
inputs.can_render_to_separate_surface;
globals->can_adjust_raster_scales = inputs.can_adjust_raster_scales;
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_common_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698