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

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

Issue 899313003: cc: Split ReleaseResources into Release and Recreate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 } 595 }
596 } 596 }
597 597
598 void PictureLayerImpl::DidBeginTracing() { 598 void PictureLayerImpl::DidBeginTracing() {
599 raster_source_->DidBeginTracing(); 599 raster_source_->DidBeginTracing();
600 } 600 }
601 601
602 void PictureLayerImpl::ReleaseResources() { 602 void PictureLayerImpl::ReleaseResources() {
603 // Recreate tilings with new settings, since some of those might change when 603 // Recreate tilings with new settings, since some of those might change when
604 // we release resources. 604 // we release resources.
605 tilings_ = nullptr;
606 ResetRasterScale();
607 }
608
609 void PictureLayerImpl::RecreateResources() {
605 tilings_ = CreatePictureLayerTilingSet(); 610 tilings_ = CreatePictureLayerTilingSet();
606 ResetRasterScale();
607 611
608 // To avoid an edge case after lost context where the tree is up to date but 612 // To avoid an edge case after lost context where the tree is up to date but
609 // the tilings have not been managed, request an update draw properties 613 // the tilings have not been managed, request an update draw properties
610 // to force tilings to get managed. 614 // to force tilings to get managed.
611 layer_tree_impl()->set_needs_update_draw_properties(); 615 layer_tree_impl()->set_needs_update_draw_properties();
612 } 616 }
613 617
614 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() { 618 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
615 return raster_source_->GetFlattenedPicture(); 619 return raster_source_->GetFlattenedPicture();
616 } 620 }
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 1232
1229 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1233 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1230 return !layer_tree_impl()->IsRecycleTree(); 1234 return !layer_tree_impl()->IsRecycleTree();
1231 } 1235 }
1232 1236
1233 bool PictureLayerImpl::HasValidTilePriorities() const { 1237 bool PictureLayerImpl::HasValidTilePriorities() const {
1234 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1238 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1235 } 1239 }
1236 1240
1237 } // namespace cc 1241 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698