Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_impl.h" | 5 #include "cc/layers/layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 if (parent) | 198 if (parent) |
| 199 DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent); | 199 DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent); |
| 200 | 200 |
| 201 scroll_parent_ = parent; | 201 scroll_parent_ = parent; |
| 202 SetNeedsPushProperties(); | 202 SetNeedsPushProperties(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void LayerImpl::SetDebugInfo( | 205 void LayerImpl::SetDebugInfo( |
| 206 scoped_refptr<base::trace_event::ConvertableToTraceFormat> other) { | 206 scoped_ptr<base::trace_event::ConvertableToTraceFormat> other) { |
| 207 debug_info_ = other; | 207 debug_info_ = std::move(other); |
| 208 SetNeedsPushProperties(); | 208 SetNeedsPushProperties(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) { | 211 void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) { |
| 212 if (scroll_children_.get() == children) | 212 if (scroll_children_.get() == children) |
| 213 return; | 213 return; |
| 214 scroll_children_.reset(children); | 214 scroll_children_.reset(children); |
| 215 SetNeedsPushProperties(); | 215 SetNeedsPushProperties(); |
| 216 } | 216 } |
| 217 | 217 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 | 602 |
| 603 layer->PassCopyRequests(©_requests_); | 603 layer->PassCopyRequests(©_requests_); |
| 604 | 604 |
| 605 // If the main thread commits multiple times before the impl thread actually | 605 // If the main thread commits multiple times before the impl thread actually |
| 606 // draws, then damage tracking will become incorrect if we simply clobber the | 606 // draws, then damage tracking will become incorrect if we simply clobber the |
| 607 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. | 607 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. |
| 608 // union) any update changes that have occurred on the main thread. | 608 // union) any update changes that have occurred on the main thread. |
| 609 update_rect_.Union(layer->update_rect()); | 609 update_rect_.Union(layer->update_rect()); |
| 610 layer->SetUpdateRect(update_rect_); | 610 layer->SetUpdateRect(update_rect_); |
| 611 | 611 |
| 612 layer->SetDebugInfo(debug_info_); | 612 layer->SetDebugInfo(std::move(debug_info_)); |
|
danakj
2016/02/25 23:10:07
For future archeologists. I don't see us tracing t
| |
| 613 | 613 |
| 614 if (frame_timing_requests_dirty_) { | 614 if (frame_timing_requests_dirty_) { |
| 615 layer->SetFrameTimingRequests(frame_timing_requests_); | 615 layer->SetFrameTimingRequests(frame_timing_requests_); |
| 616 frame_timing_requests_dirty_ = false; | 616 frame_timing_requests_dirty_ = false; |
| 617 } | 617 } |
| 618 | 618 |
| 619 // Reset any state that should be cleared for the next update. | 619 // Reset any state that should be cleared for the next update. |
| 620 layer_property_changed_ = false; | 620 layer_property_changed_ = false; |
| 621 update_rect_ = gfx::Rect(); | 621 update_rect_ = gfx::Rect(); |
| 622 needs_push_properties_ = false; | 622 needs_push_properties_ = false; |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1778 .layer_transforms_should_scale_layer_contents) { | 1778 .layer_transforms_should_scale_layer_contents) { |
| 1779 return default_scale; | 1779 return default_scale; |
| 1780 } | 1780 } |
| 1781 | 1781 |
| 1782 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1782 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1783 DrawTransform(), default_scale); | 1783 DrawTransform(), default_scale); |
| 1784 return std::max(transform_scales.x(), transform_scales.y()); | 1784 return std::max(transform_scales.x(), transform_scales.y()); |
| 1785 } | 1785 } |
| 1786 | 1786 |
| 1787 } // namespace cc | 1787 } // namespace cc |
| OLD | NEW |