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

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

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