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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 775483002: cc: Remove max tiles and skewport constants from tiling client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 1827bea13d8923746825029c691e5b731226c0c1..b071c56aed3b4385e0d7adf82e4523bf68be05e8 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -598,11 +598,21 @@ void PictureLayerImpl::DidBeginTracing() {
raster_source_->DidBeginTracing();
}
-void PictureLayerImpl::ReleaseResources() {
- if (tilings_)
- RemoveAllTilings();
+void PictureLayerImpl::ResetTileCache() {
+ RemoveAllTilings();
+ if (!tilings_)
+ return;
- ResetRasterScale();
+ // Reset the settings.
+ // TODO(vmpstr): Should this funciton set tilings_ to nullptr instead?
enne (OOO) 2014/12/02 21:25:58 I'm not sure. I think previously PictureLayerImpl
danakj 2014/12/02 21:58:37 I'd like to not deal with nullptrs. With my CL it'
+ tilings_->SetMaxTilesForInterestArea(GetMaxTilesForInterestArea());
+ tilings_->SetSkewportTargetTimeInSeconds(GetSkewportTargetTimeInSeconds());
+ tilings_->SetSkewportExtrapolationLimitInContentPixels(
+ GetSkewportExtrapolationLimitInContentPixels());
+}
+
+void PictureLayerImpl::ReleaseResources() {
+ ResetTileCache();
// To avoid an edge case after lost context where the tree is up to date but
// the tilings have not been managed, request an update draw properties
@@ -865,8 +875,11 @@ void PictureLayerImpl::DoPostCommitInitialization() {
DCHECK(needs_post_commit_initialization_);
DCHECK(layer_tree_impl()->IsPendingTree());
- if (!tilings_)
- tilings_ = PictureLayerTilingSet::Create(this);
+ if (!tilings_) {
+ tilings_ = PictureLayerTilingSet::Create(
+ this, GetMaxTilesForInterestArea(), GetSkewportTargetTimeInSeconds(),
+ GetSkewportExtrapolationLimitInContentPixels());
+ }
PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer();
if (twin_layer) {

Powered by Google App Engine
This is Rietveld 408576698