| OLD | NEW |
| 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/property_tree_builder.h" | 5 #include "cc/trees/property_tree_builder.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 transform.Scale(device_and_page_scale_factors, device_and_page_scale_factors); | 187 transform.Scale(device_and_page_scale_factors, device_and_page_scale_factors); |
| 188 | 188 |
| 189 // TODO(vollick): We've accounted for the scroll offset here but we haven't | 189 // TODO(vollick): We've accounted for the scroll offset here but we haven't |
| 190 // taken into account snapping to screen space pixels. For the purposes of | 190 // taken into account snapping to screen space pixels. For the purposes of |
| 191 // computing rects we need to record, this should be fine (the visible rects | 191 // computing rects we need to record, this should be fine (the visible rects |
| 192 // we compute may be slightly different than what we'd compute with snapping, | 192 // we compute may be slightly different than what we'd compute with snapping, |
| 193 // but since we significantly expand the visible rect when determining what to | 193 // but since we significantly expand the visible rect when determining what to |
| 194 // record, the slight difference should be inconsequential). | 194 // record, the slight difference should be inconsequential). |
| 195 gfx::Vector2dF position = layer->position().OffsetFromOrigin(); | 195 gfx::Vector2dF position = layer->position().OffsetFromOrigin(); |
| 196 if (!layer->scroll_parent()) { | 196 if (!layer->scroll_parent()) { |
| 197 position -= gfx::Vector2dF(layer->TotalScrollOffset().x(), | 197 position -= gfx::Vector2dF(layer->CurrentScrollOffset().x(), |
| 198 layer->TotalScrollOffset().y()); | 198 layer->CurrentScrollOffset().y()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 position += parent_offset; | 201 position += parent_offset; |
| 202 | 202 |
| 203 transform.Translate3d(position.x() + layer->transform_origin().x(), | 203 transform.Translate3d(position.x() + layer->transform_origin().x(), |
| 204 position.y() + layer->transform_origin().y(), | 204 position.y() + layer->transform_origin().y(), |
| 205 layer->transform_origin().z()); | 205 layer->transform_origin().z()); |
| 206 transform.PreconcatTransform(layer->transform()); | 206 transform.PreconcatTransform(layer->transform()); |
| 207 transform.Translate3d(-layer->transform_origin().x(), | 207 transform.Translate3d(-layer->transform_origin().x(), |
| 208 -layer->transform_origin().y(), | 208 -layer->transform_origin().y(), |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 data_for_recursion.clip_tree_parent = clip_tree->Insert(root_clip, 0); | 271 data_for_recursion.clip_tree_parent = clip_tree->Insert(root_clip, 0); |
| 272 | 272 |
| 273 BuildPropertyTreesInternal(root_layer, data_for_recursion); | 273 BuildPropertyTreesInternal(root_layer, data_for_recursion); |
| 274 | 274 |
| 275 TransformNode* transform_root = transform_tree->Node(transform_root_id); | 275 TransformNode* transform_root = transform_tree->Node(transform_root_id); |
| 276 transform_root->data.set_to_parent(device_transform * | 276 transform_root->data.set_to_parent(device_transform * |
| 277 transform_root->data.to_parent); | 277 transform_root->data.to_parent); |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace cc | 280 } // namespace cc |
| OLD | NEW |