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 "Region.h" | 9 #include "Region.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 gfx::Size oldBounds = m_tiler->bounds(); | 144 gfx::Size oldBounds = m_tiler->bounds(); |
145 gfx::Size newBounds = contentBounds(); | 145 gfx::Size newBounds = contentBounds(); |
146 if (oldBounds == newBounds) | 146 if (oldBounds == newBounds) |
147 return; | 147 return; |
148 m_tiler->setBounds(newBounds); | 148 m_tiler->setBounds(newBounds); |
149 | 149 |
150 // Invalidate any areas that the new bounds exposes. | 150 // Invalidate any areas that the new bounds exposes. |
151 Region oldRegion = gfx::Rect(gfx::Point(), oldBounds); | 151 Region oldRegion = gfx::Rect(gfx::Point(), oldBounds); |
152 Region newRegion = gfx::Rect(gfx::Point(), newBounds); | 152 Region newRegion = gfx::Rect(gfx::Point(), newBounds); |
153 newRegion.Subtract(oldRegion); | 153 newRegion.Subtract(oldRegion); |
154 Vector<WebCore::IntRect> rects = newRegion.rects(); | 154 for (Region::Iterator newRects(newRegion); newRects.has_rect(); newRects.nex
t()) |
155 for (size_t i = 0; i < rects.size(); ++i) | 155 invalidateContentRect(newRects.rect()); |
156 invalidateContentRect(cc::IntRect(rects[i])); | |
157 } | 156 } |
158 | 157 |
159 void TiledLayer::setTileSize(const gfx::Size& size) | 158 void TiledLayer::setTileSize(const gfx::Size& size) |
160 { | 159 { |
161 m_tiler->setTileSize(size); | 160 m_tiler->setTileSize(size); |
162 } | 161 } |
163 | 162 |
164 void TiledLayer::setBorderTexelOption(LayerTilingData::BorderTexelOption borderT
exelOption) | 163 void TiledLayer::setBorderTexelOption(LayerTilingData::BorderTexelOption borderT
exelOption) |
165 { | 164 { |
166 m_tiler->setBorderTexelOption(borderTexelOption); | 165 m_tiler->setBorderTexelOption(borderTexelOption); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 gfx::Rect prepaintRect = visibleContentRect(); | 777 gfx::Rect prepaintRect = visibleContentRect(); |
779 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, | 778 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, |
780 -m_tiler->tileSize().height() * prepaintRows); | 779 -m_tiler->tileSize().height() * prepaintRows); |
781 gfx::Rect contentRect(gfx::Point(), contentBounds()); | 780 gfx::Rect contentRect(gfx::Point(), contentBounds()); |
782 prepaintRect.Intersect(contentRect); | 781 prepaintRect.Intersect(contentRect); |
783 | 782 |
784 return prepaintRect; | 783 return prepaintRect; |
785 } | 784 } |
786 | 785 |
787 } | 786 } |
OLD | NEW |