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

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

Issue 2480533002: Don't free non-tile resources on GPU rasterization toggle (Closed)
Patch Set: Created 4 years, 1 month 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/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 raster_source_->DidBeginTracing(); 663 raster_source_->DidBeginTracing();
664 } 664 }
665 665
666 void PictureLayerImpl::ReleaseResources() { 666 void PictureLayerImpl::ReleaseResources() {
667 // Recreate tilings with new settings, since some of those might change when 667 // Recreate tilings with new settings, since some of those might change when
668 // we release resources. 668 // we release resources.
669 tilings_ = nullptr; 669 tilings_ = nullptr;
670 ResetRasterScale(); 670 ResetRasterScale();
671 } 671 }
672 672
673 void PictureLayerImpl::RecreateResources() { 673 void PictureLayerImpl::ReleaseTileResources() {
674 // All resources are tile resources.
675 ReleaseResources();
676 }
677
678 void PictureLayerImpl::RecreateTileResources() {
674 tilings_ = CreatePictureLayerTilingSet(); 679 tilings_ = CreatePictureLayerTilingSet();
675 if (raster_source_) { 680 if (raster_source_) {
676 raster_source_->set_image_decode_controller( 681 raster_source_->set_image_decode_controller(
677 layer_tree_impl()->image_decode_controller()); 682 layer_tree_impl()->image_decode_controller());
678 } 683 }
679 } 684 }
680 685
681 Region PictureLayerImpl::GetInvalidationRegionForDebugging() { 686 Region PictureLayerImpl::GetInvalidationRegionForDebugging() {
682 // |invalidation_| gives the invalidation contained in the source frame, but 687 // |invalidation_| gives the invalidation contained in the source frame, but
683 // is not cleared after drawing from the layer. However, update_rect() is 688 // is not cleared after drawing from the layer. However, update_rect() is
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1340 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1336 return !layer_tree_impl()->IsRecycleTree(); 1341 return !layer_tree_impl()->IsRecycleTree();
1337 } 1342 }
1338 1343
1339 bool PictureLayerImpl::HasValidTilePriorities() const { 1344 bool PictureLayerImpl::HasValidTilePriorities() const {
1340 return IsOnActiveOrPendingTree() && 1345 return IsOnActiveOrPendingTree() &&
1341 is_drawn_render_surface_layer_list_member(); 1346 is_drawn_render_surface_layer_list_member();
1342 } 1347 }
1343 1348
1344 } // namespace cc 1349 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698