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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 DCHECK(raster_source->GetSize().IsEmpty() || | 531 DCHECK(raster_source->GetSize().IsEmpty() || |
532 bounds() == raster_source->GetSize()) | 532 bounds() == raster_source->GetSize()) |
533 << " bounds " << bounds().ToString() << " pile " | 533 << " bounds " << bounds().ToString() << " pile " |
534 << raster_source->GetSize().ToString(); | 534 << raster_source->GetSize().ToString(); |
535 | 535 |
536 // The |raster_source_| is initially null, so have to check for that for the | 536 // The |raster_source_| is initially null, so have to check for that for the |
537 // first frame. | 537 // first frame. |
538 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); | 538 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); |
539 raster_source_.swap(raster_source); | 539 raster_source_.swap(raster_source); |
540 | 540 |
541 // Only set the image decode controller when we're committing. | |
enne (OOO)
2015/12/02 23:33:25
...for efficiency's sake? It'd still be set later,
vmpstr
2015/12/03 21:20:23
This effectively does just this. PictureLayer sets
| |
542 if (!pending_set) { | |
543 raster_source_->SetImageDecodeController( | |
544 layer_tree_impl()->tile_manager()->GetImageDecodeController()); | |
545 } | |
546 | |
541 // The |new_invalidation| must be cleared before updating tilings since they | 547 // The |new_invalidation| must be cleared before updating tilings since they |
542 // access the invalidation through the PictureLayerTilingClient interface. | 548 // access the invalidation through the PictureLayerTilingClient interface. |
543 invalidation_.Clear(); | 549 invalidation_.Clear(); |
544 invalidation_.Swap(new_invalidation); | 550 invalidation_.Swap(new_invalidation); |
545 | 551 |
546 bool can_have_tilings = CanHaveTilings(); | 552 bool can_have_tilings = CanHaveTilings(); |
547 DCHECK(!pending_set || | 553 DCHECK(!pending_set || |
548 can_have_tilings == GetPendingOrActiveTwinLayer()->CanHaveTilings()); | 554 can_have_tilings == GetPendingOrActiveTwinLayer()->CanHaveTilings()); |
549 | 555 |
550 // Need to call UpdateTiles again if CanHaveTilings changed. | 556 // Need to call UpdateTiles again if CanHaveTilings changed. |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1240 | 1246 |
1241 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1247 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1242 return !layer_tree_impl()->IsRecycleTree(); | 1248 return !layer_tree_impl()->IsRecycleTree(); |
1243 } | 1249 } |
1244 | 1250 |
1245 bool PictureLayerImpl::HasValidTilePriorities() const { | 1251 bool PictureLayerImpl::HasValidTilePriorities() const { |
1246 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1252 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1247 } | 1253 } |
1248 | 1254 |
1249 } // namespace cc | 1255 } // namespace cc |
OLD | NEW |