| 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 | 1373 |
| 1374 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1374 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1375 return !layer_tree_impl()->IsRecycleTree(); | 1375 return !layer_tree_impl()->IsRecycleTree(); |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 bool PictureLayerImpl::HasValidTilePriorities() const { | 1378 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1379 return IsOnActiveOrPendingTree() && | 1379 return IsOnActiveOrPendingTree() && |
| 1380 is_drawn_render_surface_layer_list_member(); | 1380 is_drawn_render_surface_layer_list_member(); |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 void PictureLayerImpl::InvalidateRegionForImages( |
| 1384 const ImageIdFlatSet& images_to_invalidate) { |
| 1385 TRACE_EVENT_BEGIN0("cc", "PictureLayerImpl::InvalidateRegionForImages"); |
| 1386 |
| 1387 InvalidationRegion image_invalidation; |
| 1388 for (auto image_id : images_to_invalidate) |
| 1389 image_invalidation.Union(raster_source_->GetRectForImage(image_id)); |
| 1390 Region invalidation; |
| 1391 image_invalidation.Swap(&invalidation); |
| 1392 |
| 1393 if (invalidation.IsEmpty()) { |
| 1394 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", |
| 1395 "Invalidation", invalidation.ToString()); |
| 1396 return; |
| 1397 } |
| 1398 |
| 1399 invalidation_.Union(invalidation); |
| 1400 tilings_->UpdateTilingsForImplSideInvalidation(invalidation); |
| 1401 SetNeedsPushProperties(); |
| 1402 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", |
| 1403 "Invalidation", invalidation.ToString()); |
| 1404 } |
| 1405 |
| 1383 } // namespace cc | 1406 } // namespace cc |
| OLD | NEW |