Commit 2eb362d2 authored by vmpstr's avatar vmpstr Committed by Commit bot

cc: Ensure that raster contents scale doesn't go below min scale.

This patch ensures that we can the raster scale to min contents scale.
We already did this, but later could modify the value again to be lower
than MinContentsScale. Now, the clamp happens near the end of the
function.

R=danakj
BUG=429397

Review URL: https://codereview.chromium.org/699053003

Cr-Commit-Position: refs/heads/master@{#302636}
parent 10e7c0fd
...@@ -1087,9 +1087,6 @@ void PictureLayerImpl::RecalculateRasterScales() { ...@@ -1087,9 +1087,6 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ / raster_device_scale_ / raster_source_scale_; raster_contents_scale_ / raster_device_scale_ / raster_source_scale_;
} }
raster_contents_scale_ =
std::max(raster_contents_scale_, MinimumContentsScale());
// If we're not re-rasterizing during animation, rasterize at the maximum // If we're not re-rasterizing during animation, rasterize at the maximum
// scale that will occur during the animation, if the maximum scale is // scale that will occur during the animation, if the maximum scale is
// known. However we want to avoid excessive memory use. If the scale is // known. However we want to avoid excessive memory use. If the scale is
...@@ -1121,6 +1118,9 @@ void PictureLayerImpl::RecalculateRasterScales() { ...@@ -1121,6 +1118,9 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_; raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_;
} }
raster_contents_scale_ =
std::max(raster_contents_scale_, MinimumContentsScale());
// If this layer would create zero or one tiles at this content scale, // If this layer would create zero or one tiles at this content scale,
// don't create a low res tiling. // don't create a low res tiling.
gfx::Size raster_bounds = gfx::ToCeiledSize( gfx::Size raster_bounds = gfx::ToCeiledSize(
...@@ -1138,6 +1138,8 @@ void PictureLayerImpl::RecalculateRasterScales() { ...@@ -1138,6 +1138,8 @@ void PictureLayerImpl::RecalculateRasterScales() {
low_res_raster_contents_scale_ = std::max( low_res_raster_contents_scale_ = std::max(
raster_contents_scale_ * low_res_factor, raster_contents_scale_ * low_res_factor,
MinimumContentsScale()); MinimumContentsScale());
DCHECK_LE(low_res_raster_contents_scale_, raster_contents_scale_);
DCHECK_GE(low_res_raster_contents_scale_, MinimumContentsScale());
} }
void PictureLayerImpl::CleanUpTilingsOnActiveLayer( void PictureLayerImpl::CleanUpTilingsOnActiveLayer(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment