| 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/picture_layer_impl.h" | 5 #include "cc/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "cc/append_quads_data.h" | 8 #include "cc/append_quads_data.h" |
| 9 #include "cc/checkerboard_draw_quad.h" | 9 #include "cc/checkerboard_draw_quad.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 last_update_time_ = current_time; | 176 last_update_time_ = current_time; |
| 177 last_bounds_ = bounds(); | 177 last_bounds_ = bounds(); |
| 178 last_content_bounds_ = contentBounds(); | 178 last_content_bounds_ = contentBounds(); |
| 179 last_content_scale_ = contentsScaleX(); | 179 last_content_scale_ = contentsScaleX(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void PictureLayerImpl::didBecomeActive() { | 182 void PictureLayerImpl::didBecomeActive() { |
| 183 tilings_.MoveTilePriorities(PENDING_TREE, ACTIVE_TREE); | 183 tilings_.MoveTilePriorities(PENDING_TREE, ACTIVE_TREE); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void PictureLayerImpl::didLoseOutputSurface() { |
| 187 tilings_.RemoveAllTilings(); |
| 188 } |
| 189 |
| 186 void PictureLayerImpl::calculateContentsScale( | 190 void PictureLayerImpl::calculateContentsScale( |
| 187 float ideal_contents_scale, | 191 float ideal_contents_scale, |
| 188 float* contents_scale_x, | 192 float* contents_scale_x, |
| 189 float* contents_scale_y, | 193 float* contents_scale_y, |
| 190 gfx::Size* content_bounds) { | 194 gfx::Size* content_bounds) { |
| 191 if (!drawsContent()) { | 195 if (!drawsContent()) { |
| 192 DCHECK(!tilings_.num_tilings()); | 196 DCHECK(!tilings_.num_tilings()); |
| 193 return; | 197 return; |
| 194 } | 198 } |
| 195 | 199 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) == | 446 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) == |
| 443 used_tilings.end()) | 447 used_tilings.end()) |
| 444 to_remove.push_back(tiling); | 448 to_remove.push_back(tiling); |
| 445 } | 449 } |
| 446 | 450 |
| 447 for (size_t i = 0; i < to_remove.size(); ++i) | 451 for (size_t i = 0; i < to_remove.size(); ++i) |
| 448 tilings_.Remove(to_remove[i]); | 452 tilings_.Remove(to_remove[i]); |
| 449 } | 453 } |
| 450 | 454 |
| 451 } // namespace cc | 455 } // namespace cc |
| OLD | NEW |