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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 stacking_order_changed_(false), | 60 stacking_order_changed_(false), |
61 double_sided_(true), | 61 double_sided_(true), |
62 should_flatten_transform_(true), | 62 should_flatten_transform_(true), |
63 should_flatten_transform_from_property_tree_(false), | 63 should_flatten_transform_from_property_tree_(false), |
64 is_clipped_(false), | 64 is_clipped_(false), |
65 layer_property_changed_(false), | 65 layer_property_changed_(false), |
66 masks_to_bounds_(false), | 66 masks_to_bounds_(false), |
67 contents_opaque_(false), | 67 contents_opaque_(false), |
68 is_root_for_isolated_group_(false), | 68 is_root_for_isolated_group_(false), |
69 use_parent_backface_visibility_(false), | 69 use_parent_backface_visibility_(false), |
70 draw_checkerboard_for_missing_tiles_(false), | |
71 draws_content_(false), | 70 draws_content_(false), |
72 hide_layer_and_subtree_(false), | 71 hide_layer_and_subtree_(false), |
73 transform_is_invertible_(true), | 72 transform_is_invertible_(true), |
74 is_container_for_fixed_position_layers_(false), | 73 is_container_for_fixed_position_layers_(false), |
75 is_affected_by_page_scale_(true), | 74 is_affected_by_page_scale_(true), |
76 background_color_(0), | 75 background_color_(0), |
77 opacity_(1.0), | 76 opacity_(1.0), |
78 blend_mode_(SkXfermode::kSrcOver_Mode), | 77 blend_mode_(SkXfermode::kSrcOver_Mode), |
79 num_descendants_that_draw_content_(0), | 78 num_descendants_that_draw_content_(0), |
80 transform_tree_index_(-1), | 79 transform_tree_index_(-1), |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 539 |
541 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 540 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
542 return LayerImpl::Create(tree_impl, layer_id_, scroll_offset_); | 541 return LayerImpl::Create(tree_impl, layer_id_, scroll_offset_); |
543 } | 542 } |
544 | 543 |
545 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { | 544 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { |
546 layer->SetTransformOrigin(transform_origin_); | 545 layer->SetTransformOrigin(transform_origin_); |
547 layer->SetBackgroundColor(background_color_); | 546 layer->SetBackgroundColor(background_color_); |
548 layer->SetBounds(bounds_); | 547 layer->SetBounds(bounds_); |
549 layer->SetDoubleSided(double_sided_); | 548 layer->SetDoubleSided(double_sided_); |
550 layer->SetDrawCheckerboardForMissingTiles( | |
551 draw_checkerboard_for_missing_tiles_); | |
552 layer->SetDrawsContent(DrawsContent()); | 549 layer->SetDrawsContent(DrawsContent()); |
553 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 550 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
554 layer->SetHasRenderSurface(!!render_surface()); | 551 layer->SetHasRenderSurface(!!render_surface()); |
555 layer->SetFilters(filters()); | 552 layer->SetFilters(filters()); |
556 layer->SetBackgroundFilters(background_filters()); | 553 layer->SetBackgroundFilters(background_filters()); |
557 layer->SetMasksToBounds(masks_to_bounds_); | 554 layer->SetMasksToBounds(masks_to_bounds_); |
558 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 555 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
559 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 556 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
560 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); | 557 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); |
561 layer->SetScrollBlocksOn(scroll_blocks_on_); | 558 layer->SetScrollBlocksOn(scroll_blocks_on_); |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 } | 1901 } |
1905 | 1902 |
1906 // TODO(enne): the transform needs to come from property trees instead of | 1903 // TODO(enne): the transform needs to come from property trees instead of |
1907 // draw properties. | 1904 // draw properties. |
1908 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1905 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1909 draw_properties().target_space_transform, default_scale); | 1906 draw_properties().target_space_transform, default_scale); |
1910 return std::max(transform_scales.x(), transform_scales.y()); | 1907 return std::max(transform_scales.x(), transform_scales.y()); |
1911 } | 1908 } |
1912 | 1909 |
1913 } // namespace cc | 1910 } // namespace cc |
OLD | NEW |