| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resources/picture_pile.h" | 5 #include "cc/resources/picture_pile.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 contents_opaque_ = contents_opaque; | 158 contents_opaque_ = contents_opaque; |
| 159 contents_fill_bounds_completely_ = contents_fill_bounds_completely; | 159 contents_fill_bounds_completely_ = contents_fill_bounds_completely; |
| 160 | 160 |
| 161 gfx::Rect interest_rect = visible_layer_rect; | 161 gfx::Rect interest_rect = visible_layer_rect; |
| 162 interest_rect.Inset( | 162 interest_rect.Inset( |
| 163 -kPixelDistanceToRecord, | 163 -kPixelDistanceToRecord, |
| 164 -kPixelDistanceToRecord, | 164 -kPixelDistanceToRecord, |
| 165 -kPixelDistanceToRecord, | 165 -kPixelDistanceToRecord, |
| 166 -kPixelDistanceToRecord); | 166 -kPixelDistanceToRecord); |
| 167 recorded_viewport_ = interest_rect; | 167 recorded_viewport_ = interest_rect; |
| 168 recorded_viewport_.Intersect(gfx::Rect(size())); | 168 recorded_viewport_.Intersect(tiling_rect()); |
| 169 | 169 |
| 170 bool invalidated = false; | 170 bool invalidated = false; |
| 171 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) { | 171 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) { |
| 172 gfx::Rect invalidation = i.rect(); | 172 gfx::Rect invalidation = i.rect(); |
| 173 // Split this inflated invalidation across tile boundaries and apply it | 173 // Split this inflated invalidation across tile boundaries and apply it |
| 174 // to all tiles that it touches. | 174 // to all tiles that it touches. |
| 175 bool include_borders = true; | 175 bool include_borders = true; |
| 176 for (TilingData::Iterator iter(&tiling_, invalidation, include_borders); | 176 for (TilingData::Iterator iter(&tiling_, invalidation, include_borders); |
| 177 iter; | 177 iter; |
| 178 ++iter) { | 178 ++iter) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 } | 276 } |
| 277 DCHECK(found_tile_for_recorded_picture); | 277 DCHECK(found_tile_for_recorded_picture); |
| 278 } | 278 } |
| 279 | 279 |
| 280 has_any_recordings_ = true; | 280 has_any_recordings_ = true; |
| 281 DCHECK(CanRasterSlowTileCheck(recorded_viewport_)); | 281 DCHECK(CanRasterSlowTileCheck(recorded_viewport_)); |
| 282 return true; | 282 return true; |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace cc | 285 } // namespace cc |
| OLD | NEW |