| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/tiled_layer.h" | 7 #include "cc/tiled_layer.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "cc/geometry.h" | 10 #include "cc/geometry.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 bool isTiled; | 127 bool isTiled; |
| 128 if (m_tilingOption == AlwaysTile) | 128 if (m_tilingOption == AlwaysTile) |
| 129 isTiled = true; | 129 isTiled = true; |
| 130 else if (m_tilingOption == NeverTile) | 130 else if (m_tilingOption == NeverTile) |
| 131 isTiled = false; | 131 isTiled = false; |
| 132 else | 132 else |
| 133 isTiled = autoTiled; | 133 isTiled = autoTiled; |
| 134 | 134 |
| 135 gfx::Size requestedSize = isTiled ? tileSize : contentBounds(); | 135 gfx::Size requestedSize = isTiled ? tileSize : contentBounds(); |
| 136 const int maxSize = layerTreeHost()->rendererCapabilities().maxTextureSize; | 136 const int maxSize = layerTreeHost()->rendererCapabilities().maxTextureSize; |
| 137 gfx::Size clampedSize = ClampSizeFromAbove(requestedSize, gfx::Size(maxSize,
maxSize)); | 137 requestedSize.ClampToMax(gfx::Size(maxSize, maxSize)); |
| 138 setTileSize(clampedSize); | 138 setTileSize(requestedSize); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void TiledLayer::updateBounds() | 141 void TiledLayer::updateBounds() |
| 142 { | 142 { |
| 143 gfx::Size oldBounds = m_tiler->bounds(); | 143 gfx::Size oldBounds = m_tiler->bounds(); |
| 144 gfx::Size newBounds = contentBounds(); | 144 gfx::Size newBounds = contentBounds(); |
| 145 if (oldBounds == newBounds) | 145 if (oldBounds == newBounds) |
| 146 return; | 146 return; |
| 147 m_tiler->setBounds(newBounds); | 147 m_tiler->setBounds(newBounds); |
| 148 | 148 |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 gfx::Rect prepaintRect = visibleContentRect(); | 776 gfx::Rect prepaintRect = visibleContentRect(); |
| 777 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, | 777 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, |
| 778 -m_tiler->tileSize().height() * prepaintRows); | 778 -m_tiler->tileSize().height() * prepaintRows); |
| 779 gfx::Rect contentRect(gfx::Point(), contentBounds()); | 779 gfx::Rect contentRect(gfx::Point(), contentBounds()); |
| 780 prepaintRect.Intersect(contentRect); | 780 prepaintRect.Intersect(contentRect); |
| 781 | 781 |
| 782 return prepaintRect; | 782 return prepaintRect; |
| 783 } | 783 } |
| 784 | 784 |
| 785 } // namespace cc | 785 } // namespace cc |
| OLD | NEW |