| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 gfx::Rect Layer::layerRectToContentRect(const gfx::RectF& layerRect) const | 119 gfx::Rect Layer::layerRectToContentRect(const gfx::RectF& layerRect) const |
| 120 { | 120 { |
| 121 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); | 121 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); |
| 122 // Intersect with content rect to avoid the extra pixel because for some | 122 // Intersect with content rect to avoid the extra pixel because for some |
| 123 // values x and y, ceil((x / y) * y) may be x + 1. | 123 // values x and y, ceil((x / y) * y) may be x + 1. |
| 124 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 124 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
| 125 return gfx::ToEnclosingRect(contentRect); | 125 return gfx::ToEnclosingRect(contentRect); |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool Layer::isPictureLayer() const |
| 129 { |
| 130 return false; |
| 131 } |
| 132 |
| 128 bool Layer::blocksPendingCommit() const | 133 bool Layer::blocksPendingCommit() const |
| 129 { | 134 { |
| 130 return false; | 135 return false; |
| 131 } | 136 } |
| 132 | 137 |
| 133 void Layer::setParent(Layer* layer) | 138 void Layer::setParent(Layer* layer) |
| 134 { | 139 { |
| 135 DCHECK(!layer || !layer->hasAncestor(this)); | 140 DCHECK(!layer || !layer->hasAncestor(this)); |
| 136 m_parent = layer; | 141 m_parent = layer; |
| 137 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); | 142 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 { | 850 { |
| 846 return 0; | 851 return 0; |
| 847 } | 852 } |
| 848 | 853 |
| 849 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 854 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
| 850 { | 855 { |
| 851 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 856 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
| 852 } | 857 } |
| 853 | 858 |
| 854 } // namespace cc | 859 } // namespace cc |
| OLD | NEW |