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> |
| 11 | 11 |
| 12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 13 #include "base/numerics/safe_conversions.h" | 13 #include "base/numerics/safe_conversions.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
| 16 #include "base/trace_event/trace_event_argument.h" | 16 #include "base/trace_event/trace_event_argument.h" |
| 17 #include "cc/animation/animation_registrar.h" | 17 #include "cc/animation/animation_registrar.h" |
| 18 #include "cc/animation/mutable_properties.h" | 18 #include "cc/animation/mutable_properties.h" |
| 19 #include "cc/base/math_util.h" | 19 #include "cc/base/math_util.h" |
| 20 #include "cc/base/simple_enclosed_region.h" | 20 #include "cc/base/simple_enclosed_region.h" |
| 21 #include "cc/debug/debug_colors.h" | 21 #include "cc/debug/debug_colors.h" |
| 22 #include "cc/debug/layer_debug_info.h" | |
| 22 #include "cc/debug/layer_tree_debug_state.h" | 23 #include "cc/debug/layer_tree_debug_state.h" |
| 23 #include "cc/debug/micro_benchmark_impl.h" | 24 #include "cc/debug/micro_benchmark_impl.h" |
| 24 #include "cc/debug/traced_value.h" | 25 #include "cc/debug/traced_value.h" |
| 25 #include "cc/input/main_thread_scrolling_reason.h" | 26 #include "cc/input/main_thread_scrolling_reason.h" |
| 26 #include "cc/input/scroll_state.h" | 27 #include "cc/input/scroll_state.h" |
| 27 #include "cc/layers/layer.h" | 28 #include "cc/layers/layer.h" |
| 28 #include "cc/layers/layer_utils.h" | 29 #include "cc/layers/layer_utils.h" |
| 29 #include "cc/output/copy_output_request.h" | 30 #include "cc/output/copy_output_request.h" |
| 30 #include "cc/quads/debug_border_draw_quad.h" | 31 #include "cc/quads/debug_border_draw_quad.h" |
| 31 #include "cc/quads/render_pass.h" | 32 #include "cc/quads/render_pass.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 if (scroll_parent_ == parent) | 196 if (scroll_parent_ == parent) |
| 196 return; | 197 return; |
| 197 | 198 |
| 198 if (parent) | 199 if (parent) |
| 199 DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent); | 200 DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent); |
| 200 | 201 |
| 201 scroll_parent_ = parent; | 202 scroll_parent_ = parent; |
| 202 SetNeedsPushProperties(); | 203 SetNeedsPushProperties(); |
| 203 } | 204 } |
| 204 | 205 |
| 205 void LayerImpl::SetDebugInfo( | 206 void LayerImpl::SetDebugInfo(scoped_refptr<LayerDebugInfo> debug_info) { |
| 206 scoped_refptr<base::trace_event::ConvertableToTraceFormat> other) { | 207 debug_info_ = debug_info; |
|
danakj
2016/02/26 22:59:38
you should move() here, don't need to hold a refer
| |
| 207 debug_info_ = 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 1560 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 |