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

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

Issue 2160683003: Fix MultiPictureDraw issues with GpuImageDecodeController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 | « no previous file | cc/playback/raster_source.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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 << " bounds " << bounds().ToString() << " pile " 538 << " bounds " << bounds().ToString() << " pile "
539 << raster_source->GetSize().ToString(); 539 << raster_source->GetSize().ToString();
540 540
541 // The |raster_source_| is initially null, so have to check for that for the 541 // The |raster_source_| is initially null, so have to check for that for the
542 // first frame. 542 // first frame.
543 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); 543 bool could_have_tilings = raster_source_.get() && CanHaveTilings();
544 raster_source_.swap(raster_source); 544 raster_source_.swap(raster_source);
545 545
546 // Only set the image decode controller when we're committing. 546 // Only set the image decode controller when we're committing.
547 if (!pending_set) { 547 if (!pending_set) {
548 raster_source_->SetImageDecodeController( 548 raster_source_->set_image_decode_controller(
549 layer_tree_impl()->image_decode_controller()); 549 layer_tree_impl()->image_decode_controller());
550 } 550 }
551 551
552 // The |new_invalidation| must be cleared before updating tilings since they 552 // The |new_invalidation| must be cleared before updating tilings since they
553 // access the invalidation through the PictureLayerTilingClient interface. 553 // access the invalidation through the PictureLayerTilingClient interface.
554 invalidation_.Clear(); 554 invalidation_.Clear();
555 invalidation_.Swap(new_invalidation); 555 invalidation_.Swap(new_invalidation);
556 556
557 bool can_have_tilings = CanHaveTilings(); 557 bool can_have_tilings = CanHaveTilings();
558 DCHECK(!pending_set || 558 DCHECK(!pending_set ||
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 void PictureLayerImpl::ReleaseResources() { 634 void PictureLayerImpl::ReleaseResources() {
635 // Recreate tilings with new settings, since some of those might change when 635 // Recreate tilings with new settings, since some of those might change when
636 // we release resources. 636 // we release resources.
637 tilings_ = nullptr; 637 tilings_ = nullptr;
638 ResetRasterScale(); 638 ResetRasterScale();
639 } 639 }
640 640
641 void PictureLayerImpl::RecreateResources() { 641 void PictureLayerImpl::RecreateResources() {
642 tilings_ = CreatePictureLayerTilingSet(); 642 tilings_ = CreatePictureLayerTilingSet();
643 if (raster_source_) { 643 if (raster_source_) {
644 raster_source_->SetImageDecodeController( 644 raster_source_->set_image_decode_controller(
645 layer_tree_impl()->image_decode_controller()); 645 layer_tree_impl()->image_decode_controller());
646 } 646 }
647 647
648 // To avoid an edge case after lost context where the tree is up to date but 648 // To avoid an edge case after lost context where the tree is up to date but
649 // the tilings have not been managed, request an update draw properties 649 // the tilings have not been managed, request an update draw properties
650 // to force tilings to get managed. 650 // to force tilings to get managed.
651 layer_tree_impl()->set_needs_update_draw_properties(); 651 layer_tree_impl()->set_needs_update_draw_properties();
652 } 652 }
653 653
654 Region PictureLayerImpl::GetInvalidationRegionForDebugging() { 654 Region PictureLayerImpl::GetInvalidationRegionForDebugging() {
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1304 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1305 return !layer_tree_impl()->IsRecycleTree(); 1305 return !layer_tree_impl()->IsRecycleTree();
1306 } 1306 }
1307 1307
1308 bool PictureLayerImpl::HasValidTilePriorities() const { 1308 bool PictureLayerImpl::HasValidTilePriorities() const {
1309 return IsOnActiveOrPendingTree() && 1309 return IsOnActiveOrPendingTree() &&
1310 is_drawn_render_surface_layer_list_member(); 1310 is_drawn_render_surface_layer_list_member();
1311 } 1311 }
1312 1312
1313 } // namespace cc 1313 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/playback/raster_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698