Chromium Code Reviews| 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 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1360 | 1360 |
| 1361 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1361 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1362 return !layer_tree_impl()->IsRecycleTree(); | 1362 return !layer_tree_impl()->IsRecycleTree(); |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 bool PictureLayerImpl::HasValidTilePriorities() const { | 1365 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1366 return IsOnActiveOrPendingTree() && | 1366 return IsOnActiveOrPendingTree() && |
| 1367 is_drawn_render_surface_layer_list_member(); | 1367 is_drawn_render_surface_layer_list_member(); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 void PictureLayerImpl::InvalidateRegionForImages( | |
| 1371 const std::unordered_set<ImageId>& images_to_invalidate) { | |
| 1372 TRACE_EVENT_BEGIN0("cc", "PictureLayerImpl::InvalidateRegionForImages"); | |
| 1373 | |
| 1374 InvalidationRegion image_invalidation; | |
| 1375 for (auto image_id : images_to_invalidate) | |
| 1376 image_invalidation.Union(raster_source_->GetRectForImage(image_id)); | |
| 1377 Region invalidation; | |
| 1378 image_invalidation.Swap(&invalidation); | |
| 1379 | |
| 1380 TRACE_EVENT_END1("cc", "PictureLayerImpl::InvalidateRegionForImages", | |
|
vmpstr
2017/02/13 22:49:30
Hmm, this doesn't capture the duration of the Unio
Khushal
2017/02/14 05:10:22
Done.
| |
| 1381 "Invalidation", invalidation.ToString()); | |
| 1382 | |
| 1383 if (invalidation.IsEmpty()) | |
| 1384 return; | |
| 1385 invalidation_.Union(invalidation); | |
| 1386 tilings_->UpdateTilingsForImplSideInvalidation(invalidation); | |
| 1387 SetNeedsPushProperties(); | |
| 1388 } | |
| 1389 | |
| 1370 } // namespace cc | 1390 } // namespace cc |
| OLD | NEW |