| 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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 | 1396 |
| 1397 WhichTree PictureLayerImpl::GetTree() const { | 1397 WhichTree PictureLayerImpl::GetTree() const { |
| 1398 return layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 1398 return layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
| 1399 } | 1399 } |
| 1400 | 1400 |
| 1401 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1401 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1402 return !layer_tree_impl()->IsRecycleTree(); | 1402 return !layer_tree_impl()->IsRecycleTree(); |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 bool PictureLayerImpl::HasValidTilePriorities() const { | 1405 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1406 return IsOnActiveOrPendingTree() && | 1406 return IsOnActiveOrPendingTree() && contributes_to_drawn_render_surface(); |
| 1407 is_drawn_render_surface_layer_list_member(); | |
| 1408 } | 1407 } |
| 1409 | 1408 |
| 1410 void PictureLayerImpl::InvalidateRegionForImages( | 1409 void PictureLayerImpl::InvalidateRegionForImages( |
| 1411 const ImageIdFlatSet& images_to_invalidate) { | 1410 const ImageIdFlatSet& images_to_invalidate) { |
| 1412 TRACE_EVENT_BEGIN0("cc", "PictureLayerImpl::InvalidateRegionForImages"); | 1411 TRACE_EVENT_BEGIN0("cc", "PictureLayerImpl::InvalidateRegionForImages"); |
| 1413 | 1412 |
| 1414 InvalidationRegion image_invalidation; | 1413 InvalidationRegion image_invalidation; |
| 1415 for (auto image_id : images_to_invalidate) | 1414 for (auto image_id : images_to_invalidate) |
| 1416 image_invalidation.Union(raster_source_->GetRectForImage(image_id)); | 1415 image_invalidation.Union(raster_source_->GetRectForImage(image_id)); |
| 1417 Region invalidation; | 1416 Region invalidation; |
| 1418 image_invalidation.Swap(&invalidation); | 1417 image_invalidation.Swap(&invalidation); |
| 1419 | 1418 |
| 1420 if (invalidation.IsEmpty()) { | 1419 if (invalidation.IsEmpty()) { |
| 1421 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", | 1420 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", |
| 1422 "Invalidation", invalidation.ToString()); | 1421 "Invalidation", invalidation.ToString()); |
| 1423 return; | 1422 return; |
| 1424 } | 1423 } |
| 1425 | 1424 |
| 1426 invalidation_.Union(invalidation); | 1425 invalidation_.Union(invalidation); |
| 1427 tilings_->UpdateTilingsForImplSideInvalidation(invalidation); | 1426 tilings_->UpdateTilingsForImplSideInvalidation(invalidation); |
| 1428 SetNeedsPushProperties(); | 1427 SetNeedsPushProperties(); |
| 1429 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", | 1428 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", |
| 1430 "Invalidation", invalidation.ToString()); | 1429 "Invalidation", invalidation.ToString()); |
| 1431 } | 1430 } |
| 1432 | 1431 |
| 1433 } // namespace cc | 1432 } // namespace cc |
| OLD | NEW |