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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 DCHECK(raster_source->GetSize().IsEmpty() || | 544 DCHECK(raster_source->GetSize().IsEmpty() || |
545 bounds() == raster_source->GetSize()) | 545 bounds() == raster_source->GetSize()) |
546 << " bounds " << bounds().ToString() << " pile " | 546 << " bounds " << bounds().ToString() << " pile " |
547 << raster_source->GetSize().ToString(); | 547 << raster_source->GetSize().ToString(); |
548 | 548 |
549 // The |raster_source_| is initially null, so have to check for that for the | 549 // The |raster_source_| is initially null, so have to check for that for the |
550 // first frame. | 550 // first frame. |
551 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); | 551 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); |
552 raster_source_.swap(raster_source); | 552 raster_source_.swap(raster_source); |
553 | 553 |
| 554 // Only set the image decode controller when we're committing. |
| 555 if (!pending_set) { |
| 556 raster_source_->SetImageDecodeController( |
| 557 layer_tree_impl()->tile_manager()->GetImageDecodeController()); |
| 558 } |
| 559 |
554 // The |new_invalidation| must be cleared before updating tilings since they | 560 // The |new_invalidation| must be cleared before updating tilings since they |
555 // access the invalidation through the PictureLayerTilingClient interface. | 561 // access the invalidation through the PictureLayerTilingClient interface. |
556 invalidation_.Clear(); | 562 invalidation_.Clear(); |
557 invalidation_.Swap(new_invalidation); | 563 invalidation_.Swap(new_invalidation); |
558 | 564 |
559 bool can_have_tilings = CanHaveTilings(); | 565 bool can_have_tilings = CanHaveTilings(); |
560 DCHECK(!pending_set || | 566 DCHECK(!pending_set || |
561 can_have_tilings == GetPendingOrActiveTwinLayer()->CanHaveTilings()); | 567 can_have_tilings == GetPendingOrActiveTwinLayer()->CanHaveTilings()); |
562 | 568 |
563 // Need to call UpdateTiles again if CanHaveTilings changed. | 569 // Need to call UpdateTiles again if CanHaveTilings changed. |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 | 1261 |
1256 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1262 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1257 return !layer_tree_impl()->IsRecycleTree(); | 1263 return !layer_tree_impl()->IsRecycleTree(); |
1258 } | 1264 } |
1259 | 1265 |
1260 bool PictureLayerImpl::HasValidTilePriorities() const { | 1266 bool PictureLayerImpl::HasValidTilePriorities() const { |
1261 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1267 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1262 } | 1268 } |
1263 | 1269 |
1264 } // namespace cc | 1270 } // namespace cc |
OLD | NEW |