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

Side by Side Diff: cc/trees/draw_property_utils.cc

Issue 1021823006: Fix scroll position adjustment for fixed-position layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/draw_property_utils.h" 5 #include "cc/trees/draw_property_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 content_to_target.Translate(layer->offset_to_transform_parent().x(), 71 content_to_target.Translate(layer->offset_to_transform_parent().x(),
72 layer->offset_to_transform_parent().y()); 72 layer->offset_to_transform_parent().y());
73 content_to_target.Scale(1.0 / contents_scale_x, 1.0 / contents_scale_y); 73 content_to_target.Scale(1.0 / contents_scale_x, 1.0 / contents_scale_y);
74 74
75 gfx::Rect layer_content_rect = gfx::Rect(layer_content_bounds); 75 gfx::Rect layer_content_rect = gfx::Rect(layer_content_bounds);
76 gfx::Rect layer_content_bounds_in_target_space = 76 gfx::Rect layer_content_bounds_in_target_space =
77 MathUtil::MapEnclosingClippedRect(content_to_target, 77 MathUtil::MapEnclosingClippedRect(content_to_target,
78 layer_content_rect); 78 layer_content_rect);
79 gfx::Rect clip_rect_in_target_space; 79 gfx::Rect clip_rect_in_target_space;
80 if (target_node->id > clip_node->id) { 80 if (target_node->id > clip_node->data.transform_id) {
81 clip_rect_in_target_space = 81 clip_rect_in_target_space =
82 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( 82 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
83 clip_to_target, clip_node->data.combined_clip)); 83 clip_to_target, clip_node->data.combined_clip));
84 } else { 84 } else {
85 clip_rect_in_target_space = 85 clip_rect_in_target_space =
86 gfx::ToEnclosingRect(MathUtil::MapClippedRect( 86 gfx::ToEnclosingRect(MathUtil::MapClippedRect(
87 clip_to_target, clip_node->data.combined_clip)); 87 clip_to_target, clip_node->data.combined_clip));
88 } 88 }
89 89
90 clip_rect_in_target_space.Intersect(layer_content_bounds_in_target_space); 90 clip_rect_in_target_space.Intersect(layer_content_bounds_in_target_space);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 std::vector<Layer*> layers_to_update; 285 std::vector<Layer*> layers_to_update;
286 const bool subtree_is_visible_from_ancestor = true; 286 const bool subtree_is_visible_from_ancestor = true;
287 FindLayersThatNeedVisibleRects(root_layer, *transform_tree, 287 FindLayersThatNeedVisibleRects(root_layer, *transform_tree,
288 subtree_is_visible_from_ancestor, 288 subtree_is_visible_from_ancestor,
289 &layers_to_update); 289 &layers_to_update);
290 CalculateVisibleRects(layers_to_update, *clip_tree, *transform_tree); 290 CalculateVisibleRects(layers_to_update, *clip_tree, *transform_tree);
291 } 291 }
292 292
293 } // namespace cc 293 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698