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

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: rebase 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
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 23351d7a3fba8e0082577ea486a6ab674e69de50..58157b54f131263d0e37e3a7631997389ec4b96e 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -68,7 +68,7 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl,
bool is_mask)
: LayerImpl(tree_impl, id),
twin_layer_(nullptr),
- tilings_(PictureLayerTilingSet::Create(this)),
+ tilings_(CreatePictureLayerTilingSet()),
// TODO(danakj): Can this be null to start?
raster_source_(PicturePileImpl::Create()),
ideal_page_scale_(0.f),
@@ -624,9 +624,10 @@ void PictureLayerImpl::DidBeginTracing() {
}
void PictureLayerImpl::ReleaseResources() {
+ // Recreate tilings with new settings, since some of those might change when
+ // we release resources. If tilings_ is null, then leave it as null.
if (tilings_)
- RemoveAllTilings();
-
+ tilings_ = CreatePictureLayerTilingSet();
ResetRasterScale();
// To avoid an edge case after lost context where the tree is up to date but
@@ -689,22 +690,6 @@ TilePriority::PriorityBin PictureLayerImpl::GetMaxTilePriorityBin() const {
return TilePriority::NOW;
}
-size_t PictureLayerImpl::GetMaxTilesForInterestArea() const {
- return layer_tree_impl()->settings().max_tiles_for_interest_area;
-}
-
-float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const {
- return layer_tree_impl()->use_gpu_rasterization()
- ? 0.f
- : layer_tree_impl()->settings().skewport_target_time_in_seconds;
-}
-
-int PictureLayerImpl::GetSkewportExtrapolationLimitInContentPixels() const {
- return layer_tree_impl()
- ->settings()
- .skewport_extrapolation_limit_in_content_pixels;
-}
-
bool PictureLayerImpl::RequiresHighResToDraw() const {
return layer_tree_impl()->RequiresHighResToDraw();
}
@@ -1154,6 +1139,17 @@ float PictureLayerImpl::MaximumTilingContentsScale() const {
return std::max(max_contents_scale, MinimumContentsScale());
}
+scoped_ptr<PictureLayerTilingSet>
+PictureLayerImpl::CreatePictureLayerTilingSet() {
+ const LayerTreeSettings& settings = layer_tree_impl()->settings();
+ return PictureLayerTilingSet::Create(
+ this, settings.max_tiles_for_interest_area,
+ layer_tree_impl()->use_gpu_rasterization()
+ ? 0.f
+ : settings.skewport_target_time_in_seconds,
+ settings.skewport_extrapolation_limit_in_content_pixels);
+}
+
void PictureLayerImpl::UpdateIdealScales() {
DCHECK(CanHaveTilings());
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698