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 "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "cc/quads/debug_border_draw_quad.h" | 23 #include "cc/quads/debug_border_draw_quad.h" |
24 #include "cc/trees/layer_tree_impl.h" | 24 #include "cc/trees/layer_tree_impl.h" |
25 #include "cc/trees/layer_tree_settings.h" | 25 #include "cc/trees/layer_tree_settings.h" |
26 #include "cc/trees/proxy.h" | 26 #include "cc/trees/proxy.h" |
27 #include "ui/gfx/box_f.h" | 27 #include "ui/gfx/box_f.h" |
28 #include "ui/gfx/point_conversions.h" | 28 #include "ui/gfx/point_conversions.h" |
29 #include "ui/gfx/quad_f.h" | 29 #include "ui/gfx/quad_f.h" |
30 #include "ui/gfx/rect_conversions.h" | 30 #include "ui/gfx/rect_conversions.h" |
31 | 31 |
32 namespace cc { | 32 namespace cc { |
33 | |
34 LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id) | 33 LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id) |
35 : parent_(NULL), | 34 : parent_(NULL), |
36 scroll_parent_(NULL), | 35 scroll_parent_(NULL), |
37 clip_parent_(NULL), | 36 clip_parent_(NULL), |
38 mask_layer_id_(-1), | 37 mask_layer_id_(-1), |
39 replica_layer_id_(-1), | 38 replica_layer_id_(-1), |
40 layer_id_(id), | 39 layer_id_(id), |
41 layer_tree_impl_(tree_impl), | 40 layer_tree_impl_(tree_impl), |
42 anchor_point_(0.5f, 0.5f), | 41 anchor_point_(0.5f, 0.5f), |
43 anchor_point_z_(0.f), | 42 anchor_point_z_(0.f), |
44 scroll_offset_delegate_(NULL), | 43 scroll_offset_delegate_(NULL), |
45 scrollable_(false), | 44 scrollable_(false), |
46 should_scroll_on_main_thread_(false), | 45 should_scroll_on_main_thread_(false), |
47 have_wheel_event_handlers_(false), | 46 have_wheel_event_handlers_(false), |
48 user_scrollable_horizontal_(true), | 47 user_scrollable_horizontal_(true), |
49 user_scrollable_vertical_(true), | 48 user_scrollable_vertical_(true), |
50 background_color_(0), | |
51 stacking_order_changed_(false), | 49 stacking_order_changed_(false), |
52 double_sided_(true), | 50 double_sided_(true), |
53 layer_property_changed_(false), | 51 layer_property_changed_(false), |
54 masks_to_bounds_(false), | 52 masks_to_bounds_(false), |
55 contents_opaque_(false), | 53 contents_opaque_(false), |
56 opacity_(1.0), | |
57 blend_mode_(SkXfermode::kSrcOver_Mode), | |
58 is_root_for_isolated_group_(false), | 54 is_root_for_isolated_group_(false), |
59 preserves_3d_(false), | 55 preserves_3d_(false), |
60 use_parent_backface_visibility_(false), | 56 use_parent_backface_visibility_(false), |
61 draw_checkerboard_for_missing_tiles_(false), | 57 draw_checkerboard_for_missing_tiles_(false), |
62 draws_content_(false), | 58 draws_content_(false), |
63 hide_layer_and_subtree_(false), | 59 hide_layer_and_subtree_(false), |
64 force_render_surface_(false), | 60 force_render_surface_(false), |
65 is_container_for_fixed_position_layers_(false), | 61 is_container_for_fixed_position_layers_(false), |
| 62 background_color_(0), |
| 63 opacity_(1.0), |
| 64 blend_mode_(SkXfermode::kSrcOver_Mode), |
66 draw_depth_(0.f), | 65 draw_depth_(0.f), |
67 compositing_reasons_(kCompositingReasonUnknown), | 66 compositing_reasons_(kCompositingReasonUnknown), |
68 current_draw_mode_(DRAW_MODE_NONE), | 67 current_draw_mode_(DRAW_MODE_NONE), |
69 horizontal_scrollbar_layer_(NULL), | 68 horizontal_scrollbar_layer_(NULL), |
70 vertical_scrollbar_layer_(NULL) { | 69 vertical_scrollbar_layer_(NULL) { |
71 DCHECK_GT(layer_id_, 0); | 70 DCHECK_GT(layer_id_, 0); |
72 DCHECK(layer_tree_impl_); | 71 DCHECK(layer_tree_impl_); |
73 layer_tree_impl_->RegisterLayer(this); | 72 layer_tree_impl_->RegisterLayer(this); |
74 AnimationRegistrar* registrar = layer_tree_impl_->animationRegistrar(); | 73 AnimationRegistrar* registrar = layer_tree_impl_->animationRegistrar(); |
75 layer_animation_controller_ = | 74 layer_animation_controller_ = |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1412 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1414 AsValueInto(state.get()); | 1413 AsValueInto(state.get()); |
1415 return state.PassAs<base::Value>(); | 1414 return state.PassAs<base::Value>(); |
1416 } | 1415 } |
1417 | 1416 |
1418 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1417 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1419 benchmark->RunOnLayer(this); | 1418 benchmark->RunOnLayer(this); |
1420 } | 1419 } |
1421 | 1420 |
1422 } // namespace cc | 1421 } // namespace cc |
OLD | NEW |