OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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.h" | 5 #include "cc/layer.h" |
6 | 6 |
7 #include "cc/animation.h" | 7 #include "cc/animation.h" |
8 #include "cc/animation_events.h" | 8 #include "cc/animation_events.h" |
9 #include "cc/layer_animation_controller.h" | 9 #include "cc/layer_animation_controller.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 layer->SetDrawsContent(DrawsContent()); | 569 layer->SetDrawsContent(DrawsContent()); |
570 layer->SetFilters(filters()); | 570 layer->SetFilters(filters()); |
571 layer->SetFilter(filter()); | 571 layer->SetFilter(filter()); |
572 layer->SetBackgroundFilters(background_filters()); | 572 layer->SetBackgroundFilters(background_filters()); |
573 layer->SetMasksToBounds(masks_to_bounds_); | 573 layer->SetMasksToBounds(masks_to_bounds_); |
574 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 574 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
575 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 575 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
576 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 576 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
577 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 577 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
578 layer->SetContentsOpaque(contents_opaque_); | 578 layer->SetContentsOpaque(contents_opaque_); |
579 if (!OpacityIsAnimating()) | 579 if (!layer->OpacityIsAnimatingOnImplOnly()) |
580 layer->SetOpacity(opacity_); | 580 layer->SetOpacity(opacity_); |
| 581 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); |
581 layer->SetPosition(position_); | 582 layer->SetPosition(position_); |
582 layer->SetIsContainerForFixedPositionLayers( | 583 layer->SetIsContainerForFixedPositionLayers( |
583 is_container_for_fixed_position_layers_); | 584 is_container_for_fixed_position_layers_); |
584 layer->SetFixedToContainerLayer(fixed_to_container_layer_); | 585 layer->SetFixedToContainerLayer(fixed_to_container_layer_); |
585 layer->SetPreserves3d(preserves_3d()); | 586 layer->SetPreserves3d(preserves_3d()); |
586 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); | 587 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); |
587 layer->SetSublayerTransform(sublayer_transform_); | 588 layer->SetSublayerTransform(sublayer_transform_); |
588 if (!TransformIsAnimating()) | 589 if (!layer->TransformIsAnimatingOnImplOnly()) |
589 layer->SetTransform(transform_); | 590 layer->SetTransform(transform_); |
| 591 DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly())); |
590 | 592 |
591 layer->SetScrollable(scrollable_); | 593 layer->SetScrollable(scrollable_); |
592 layer->SetScrollOffset(scroll_offset_); | 594 layer->SetScrollOffset(scroll_offset_); |
593 layer->SetMaxScrollOffset(max_scroll_offset_); | 595 layer->SetMaxScrollOffset(max_scroll_offset_); |
594 | 596 |
595 // If the main thread commits multiple times before the impl thread actually | 597 // If the main thread commits multiple times before the impl thread actually |
596 // draws, then damage tracking will become incorrect if we simply clobber the | 598 // draws, then damage tracking will become incorrect if we simply clobber the |
597 // updateRect here. The LayerImpl's updateRect needs to accumulate (i.e. | 599 // updateRect here. The LayerImpl's updateRect needs to accumulate (i.e. |
598 // union) any update changes that have occurred on the main thread. | 600 // union) any update changes that have occurred on the main thread. |
599 update_rect_.Union(layer->update_rect()); | 601 update_rect_.Union(layer->update_rect()); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 if (contents_opaque()) | 804 if (contents_opaque()) |
803 return visible_content_rect(); | 805 return visible_content_rect(); |
804 return Region(); | 806 return Region(); |
805 } | 807 } |
806 | 808 |
807 ScrollbarLayer* Layer::ToScrollbarLayer() { | 809 ScrollbarLayer* Layer::ToScrollbarLayer() { |
808 return NULL; | 810 return NULL; |
809 } | 811 } |
810 | 812 |
811 } // namespace cc | 813 } // namespace cc |
OLD | NEW |