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/active_animation.h" | 7 #include "cc/active_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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 setNeedsDisplay(); | 693 setNeedsDisplay(); |
694 } | 694 } |
695 | 695 |
696 void Layer::createRenderSurface() | 696 void Layer::createRenderSurface() |
697 { | 697 { |
698 DCHECK(!m_drawProperties.render_surface); | 698 DCHECK(!m_drawProperties.render_surface); |
699 m_drawProperties.render_surface = make_scoped_ptr(new RenderSurface(this)); | 699 m_drawProperties.render_surface = make_scoped_ptr(new RenderSurface(this)); |
700 m_drawProperties.render_target = this; | 700 m_drawProperties.render_target = this; |
701 } | 701 } |
702 | 702 |
703 int Layer::descendantsDrawContent() | |
704 { | |
705 int result = 0; | |
706 for (size_t i = 0; i < m_children.size(); ++i) { | |
707 if (m_children[i]->drawsContent()) | |
708 ++result; | |
709 result += m_children[i]->descendantsDrawContent(); | |
710 if (result > 1) | |
711 return result; | |
712 } | |
713 return result; | |
714 } | |
715 | |
716 int Layer::id() const | 703 int Layer::id() const |
717 { | 704 { |
718 return m_layerId; | 705 return m_layerId; |
719 } | 706 } |
720 | 707 |
721 float Layer::opacity() const | 708 float Layer::opacity() const |
722 { | 709 { |
723 return m_opacity; | 710 return m_opacity; |
724 } | 711 } |
725 | 712 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 { | 827 { |
841 return 0; | 828 return 0; |
842 } | 829 } |
843 | 830 |
844 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 831 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
845 { | 832 { |
846 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 833 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
847 } | 834 } |
848 | 835 |
849 } // namespace cc | 836 } // namespace cc |
OLD | NEW |