OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_impl.h" | 5 #include "cc/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/animation_registrar.h" | 10 #include "cc/animation_registrar.h" |
11 #include "cc/debug_border_draw_quad.h" | 11 #include "cc/debug_border_draw_quad.h" |
12 #include "cc/debug_colors.h" | 12 #include "cc/debug_colors.h" |
13 #include "cc/layer_tree_debug_state.h" | 13 #include "cc/layer_tree_debug_state.h" |
14 #include "cc/layer_tree_impl.h" | 14 #include "cc/layer_tree_impl.h" |
15 #include "cc/layer_tree_settings.h" | 15 #include "cc/layer_tree_settings.h" |
16 #include "cc/math_util.h" | 16 #include "cc/math_util.h" |
17 #include "cc/proxy.h" | 17 #include "cc/proxy.h" |
18 #include "cc/quad_sink.h" | 18 #include "cc/quad_sink.h" |
19 #include "cc/scrollbar_animation_controller.h" | 19 #include "cc/scrollbar_animation_controller.h" |
20 #include "cc/scrollbar_animation_controller_linear_fade.h" | 20 #include "cc/scrollbar_animation_controller_linear_fade.h" |
21 #include "cc/scrollbar_layer_impl.h" | 21 #include "cc/scrollbar_layer_impl.h" |
22 #include "ui/gfx/point_conversions.h" | 22 #include "ui/gfx/point_conversions.h" |
23 #include "ui/gfx/quad_f.h" | |
23 #include "ui/gfx/rect_conversions.h" | 24 #include "ui/gfx/rect_conversions.h" |
24 | 25 |
25 namespace cc { | 26 namespace cc { |
26 | 27 |
27 LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id) | 28 LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id) |
28 : m_parent(0) | 29 : m_parent(0) |
29 , m_maskLayerId(-1) | 30 , m_maskLayerId(-1) |
30 , m_replicaLayerId(-1) | 31 , m_replicaLayerId(-1) |
31 , m_layerId(id) | 32 , m_layerId(id) |
32 , m_layerTreeImpl(treeImpl) | 33 , m_layerTreeImpl(treeImpl) |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
962 m_horizontalScrollbarLayer->setScrollLayerId(id()); | 963 m_horizontalScrollbarLayer->setScrollLayerId(id()); |
963 } | 964 } |
964 | 965 |
965 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 966 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
966 { | 967 { |
967 m_verticalScrollbarLayer = scrollbarLayer; | 968 m_verticalScrollbarLayer = scrollbarLayer; |
968 if (m_verticalScrollbarLayer) | 969 if (m_verticalScrollbarLayer) |
969 m_verticalScrollbarLayer->setScrollLayerId(id()); | 970 m_verticalScrollbarLayer->setScrollLayerId(id()); |
970 } | 971 } |
971 | 972 |
973 void LayerImpl::AsValueInto(base::DictionaryValue* dict) const | |
974 { | |
975 dict->SetInteger("id", id()); | |
976 dict->SetInteger("layer_width", bounds().width()); | |
977 dict->SetInteger("layer_height", bounds().width()); | |
nduca
2013/02/15 01:10:24
bounds_size? MathUtils should have a size->value
enne (OOO)
2013/02/15 01:14:04
Done.
| |
978 dict->SetInteger("draws_content", drawsContent()); | |
979 | |
980 bool clipped; | |
981 gfx::QuadF layer_quad = MathUtil::mapQuad( | |
982 screenSpaceTransform(), | |
983 gfx::QuadF(gfx::Rect(contentBounds())), | |
984 clipped); | |
985 dict->Set("layer_quad", MathUtil::asValue(layer_quad).release()); | |
986 | |
987 } | |
988 | |
989 scoped_ptr<base::Value> LayerImpl::AsValue() const | |
990 { | |
991 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | |
992 AsValueInto(state.get()); | |
993 return state.PassAs<base::Value>(); | |
994 } | |
995 | |
972 } // namespace cc | 996 } // namespace cc |
OLD | NEW |