Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 1418573002: cc: Add image decode control in the compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/playback/decoded_draw_image.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/playback/decoded_draw_image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698