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 "cc/layers/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Invalidate any areas that the new bounds exposes. | 151 // Invalidate any areas that the new bounds exposes. |
152 Region old_region = gfx::Rect(old_bounds); | 152 Region old_region = gfx::Rect(old_bounds); |
153 Region new_region = gfx::Rect(new_bounds); | 153 Region new_region = gfx::Rect(new_bounds); |
154 new_region.Subtract(old_region); | 154 new_region.Subtract(old_region); |
155 for (Region::Iterator new_rects(new_region); | 155 for (Region::Iterator new_rects(new_region); |
156 new_rects.has_rect(); | 156 new_rects.has_rect(); |
157 new_rects.next()) | 157 new_rects.next()) |
158 InvalidateContentRect(new_rects.rect()); | 158 InvalidateContentRect(new_rects.rect()); |
159 } | 159 } |
160 | 160 |
161 void TiledLayer::SetTileSize(const gfx::Size& size) { | 161 void TiledLayer::SetTileSize(gfx::Size size) { tiler_->SetTileSize(size); } |
162 tiler_->SetTileSize(size); | |
163 } | |
164 | 162 |
165 void TiledLayer::SetBorderTexelOption( | 163 void TiledLayer::SetBorderTexelOption( |
166 LayerTilingData::BorderTexelOption border_texel_option) { | 164 LayerTilingData::BorderTexelOption border_texel_option) { |
167 tiler_->SetBorderTexelOption(border_texel_option); | 165 tiler_->SetBorderTexelOption(border_texel_option); |
168 } | 166 } |
169 | 167 |
170 bool TiledLayer::DrawsContent() const { | 168 bool TiledLayer::DrawsContent() const { |
171 if (!ContentsScalingLayer::DrawsContent()) | 169 if (!ContentsScalingLayer::DrawsContent()) |
172 return false; | 170 return false; |
173 | 171 |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 gfx::Rect prepaint_rect = visible_content_rect(); | 911 gfx::Rect prepaint_rect = visible_content_rect(); |
914 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 912 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
915 -tiler_->tile_size().height() * kPrepaintRows); | 913 -tiler_->tile_size().height() * kPrepaintRows); |
916 gfx::Rect content_rect(content_bounds()); | 914 gfx::Rect content_rect(content_bounds()); |
917 prepaint_rect.Intersect(content_rect); | 915 prepaint_rect.Intersect(content_rect); |
918 | 916 |
919 return prepaint_rect; | 917 return prepaint_rect; |
920 } | 918 } |
921 | 919 |
922 } // namespace cc | 920 } // namespace cc |
OLD | NEW |