OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 offset_to_transform_parent().y()); | 1311 offset_to_transform_parent().y()); |
1312 } else { | 1312 } else { |
1313 // Surfaces need to apply their sublayer scale. | 1313 // Surfaces need to apply their sublayer scale. |
1314 xform.Scale(target_node->data.sublayer_scale.x(), | 1314 xform.Scale(target_node->data.sublayer_scale.x(), |
1315 target_node->data.sublayer_scale.y()); | 1315 target_node->data.sublayer_scale.y()); |
1316 } | 1316 } |
1317 xform.Scale(1.0 / contents_scale_x(), 1.0 / contents_scale_y()); | 1317 xform.Scale(1.0 / contents_scale_x(), 1.0 / contents_scale_y()); |
1318 return xform; | 1318 return xform; |
1319 } | 1319 } |
1320 | 1320 |
| 1321 float Layer::DrawOpacityFromPropertyTrees(const OpacityTree& tree) const { |
| 1322 if (!render_target()) |
| 1323 return 0.f; |
| 1324 |
| 1325 const OpacityNode* target_node = |
| 1326 tree.Node(render_target()->opacity_tree_index()); |
| 1327 const OpacityNode* node = tree.Node(opacity_tree_index()); |
| 1328 if (node == target_node) |
| 1329 return 1.f; |
| 1330 |
| 1331 float draw_opacity = 1.f; |
| 1332 while (node != target_node) { |
| 1333 draw_opacity *= node->data; |
| 1334 node = tree.parent(node); |
| 1335 } |
| 1336 return draw_opacity; |
| 1337 } |
| 1338 |
1321 void Layer::SetFrameTimingRequests( | 1339 void Layer::SetFrameTimingRequests( |
1322 const std::vector<FrameTimingRequest>& requests) { | 1340 const std::vector<FrameTimingRequest>& requests) { |
1323 frame_timing_requests_ = requests; | 1341 frame_timing_requests_ = requests; |
1324 frame_timing_requests_dirty_ = true; | 1342 frame_timing_requests_dirty_ = true; |
1325 SetNeedsCommit(); | 1343 SetNeedsCommit(); |
1326 } | 1344 } |
1327 | 1345 |
1328 } // namespace cc | 1346 } // namespace cc |
OLD | NEW |