| 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(gfx::Size size) { tiler_->SetTileSize(size); } | 161 void TiledLayer::SetTileSize(const gfx::Size& size) { |
| 162 tiler_->SetTileSize(size); |
| 163 } |
| 162 | 164 |
| 163 void TiledLayer::SetBorderTexelOption( | 165 void TiledLayer::SetBorderTexelOption( |
| 164 LayerTilingData::BorderTexelOption border_texel_option) { | 166 LayerTilingData::BorderTexelOption border_texel_option) { |
| 165 tiler_->SetBorderTexelOption(border_texel_option); | 167 tiler_->SetBorderTexelOption(border_texel_option); |
| 166 } | 168 } |
| 167 | 169 |
| 168 bool TiledLayer::DrawsContent() const { | 170 bool TiledLayer::DrawsContent() const { |
| 169 if (!ContentsScalingLayer::DrawsContent()) | 171 if (!ContentsScalingLayer::DrawsContent()) |
| 170 return false; | 172 return false; |
| 171 | 173 |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 gfx::Rect prepaint_rect = visible_content_rect(); | 913 gfx::Rect prepaint_rect = visible_content_rect(); |
| 912 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 914 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
| 913 -tiler_->tile_size().height() * kPrepaintRows); | 915 -tiler_->tile_size().height() * kPrepaintRows); |
| 914 gfx::Rect content_rect(content_bounds()); | 916 gfx::Rect content_rect(content_bounds()); |
| 915 prepaint_rect.Intersect(content_rect); | 917 prepaint_rect.Intersect(content_rect); |
| 916 | 918 |
| 917 return prepaint_rect; | 919 return prepaint_rect; |
| 918 } | 920 } |
| 919 | 921 |
| 920 } // namespace cc | 922 } // namespace cc |
| OLD | NEW |