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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 gfx::Rect Layer::layerRectToContentRect(const gfx::RectF& layerRect) const | 114 gfx::Rect Layer::layerRectToContentRect(const gfx::RectF& layerRect) const |
115 { | 115 { |
116 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); | 116 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); |
117 // Intersect with content rect to avoid the extra pixel because for some | 117 // Intersect with content rect to avoid the extra pixel because for some |
118 // values x and y, ceil((x / y) * y) may be x + 1. | 118 // values x and y, ceil((x / y) * y) may be x + 1. |
119 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 119 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
120 return gfx::ToEnclosingRect(contentRect); | 120 return gfx::ToEnclosingRect(contentRect); |
121 } | 121 } |
122 | 122 |
| 123 bool Layer::blocksPendingCommit() const |
| 124 { |
| 125 return false; |
| 126 } |
| 127 |
123 void Layer::setParent(Layer* layer) | 128 void Layer::setParent(Layer* layer) |
124 { | 129 { |
125 DCHECK(!layer || !layer->hasAncestor(this)); | 130 DCHECK(!layer || !layer->hasAncestor(this)); |
126 m_parent = layer; | 131 m_parent = layer; |
127 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); | 132 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); |
128 | 133 |
129 forceAutomaticRasterScaleToBeRecomputed(); | 134 forceAutomaticRasterScaleToBeRecomputed(); |
130 } | 135 } |
131 | 136 |
132 bool Layer::hasAncestor(Layer* ancestor) const | 137 bool Layer::hasAncestor(Layer* ancestor) const |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 { | 816 { |
812 return 0; | 817 return 0; |
813 } | 818 } |
814 | 819 |
815 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 820 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
816 { | 821 { |
817 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 822 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
818 } | 823 } |
819 | 824 |
820 } // namespace cc | 825 } // namespace cc |
OLD | NEW |