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

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: . 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 target_to_content.PreconcatTransform(target_to_layer); 62 target_to_content.PreconcatTransform(target_to_layer);
63 63
64 content_to_target.Translate(layer->offset_to_transform_parent().x(), 64 content_to_target.Translate(layer->offset_to_transform_parent().x(),
65 layer->offset_to_transform_parent().y()); 65 layer->offset_to_transform_parent().y());
66 content_to_target.Scale(1.0 / contents_scale_x, 1.0 / contents_scale_y); 66 content_to_target.Scale(1.0 / contents_scale_x, 1.0 / contents_scale_y);
67 67
68 gfx::Rect layer_content_rect = gfx::Rect(layer_content_bounds); 68 gfx::Rect layer_content_rect = gfx::Rect(layer_content_bounds);
69 gfx::RectF layer_content_bounds_in_target_space = 69 gfx::RectF layer_content_bounds_in_target_space =
70 MathUtil::MapClippedRect(content_to_target, layer_content_rect); 70 MathUtil::MapClippedRect(content_to_target, layer_content_rect);
71 gfx::RectF clip_rect_in_target_space; 71 gfx::RectF clip_rect_in_target_space;
72 if (target_node->id > clip_node->id) { 72 if (target_node->id > clip_node->data.transform_id) {
73 clip_rect_in_target_space = MathUtil::ProjectClippedRect( 73 clip_rect_in_target_space = MathUtil::ProjectClippedRect(
74 clip_to_target, clip_node->data.combined_clip); 74 clip_to_target, clip_node->data.combined_clip);
75 } else { 75 } else {
76 clip_rect_in_target_space = MathUtil::MapClippedRect( 76 clip_rect_in_target_space = MathUtil::MapClippedRect(
77 clip_to_target, clip_node->data.combined_clip); 77 clip_to_target, clip_node->data.combined_clip);
78 } 78 }
79 79
80 clip_rect_in_target_space.Intersect(layer_content_bounds_in_target_space); 80 clip_rect_in_target_space.Intersect(layer_content_bounds_in_target_space);
81 81
82 gfx::Rect visible_rect = 82 gfx::Rect visible_rect =
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 std::vector<Layer*> layers_to_update; 276 std::vector<Layer*> layers_to_update;
277 const bool subtree_is_visible_from_ancestor = true; 277 const bool subtree_is_visible_from_ancestor = true;
278 FindLayersThatNeedVisibleRects(root_layer, *transform_tree, 278 FindLayersThatNeedVisibleRects(root_layer, *transform_tree,
279 subtree_is_visible_from_ancestor, 279 subtree_is_visible_from_ancestor,
280 &layers_to_update); 280 &layers_to_update);
281 CalculateVisibleRects(layers_to_update, *clip_tree, *transform_tree); 281 CalculateVisibleRects(layers_to_update, *clip_tree, *transform_tree);
282 } 282 }
283 283
284 } // namespace cc 284 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | cc/trees/layer_tree_host_common_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698