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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 422233008: Re-raster during scale animations for GPU-rasterized layers without text (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
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 »
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 ede7da0ac3a5853216a7103b38852af889669b7e..98da42dac3a1c1adfcba5c27ff6c44cac73d88d9 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1023,6 +1023,11 @@ bool PictureLayerImpl::ShouldAdjustRasterScale() const {
draw_properties().screen_space_transform_is_animating)
return true;
+ if (draw_properties().screen_space_transform_is_animating &&
+ raster_contents_scale_ != ideal_contents_scale_ &&
+ ShouldAdjustRasterScaleDuringScaleAnimations())
+ return true;
+
bool is_pinching = layer_tree_impl()->PinchGestureActive();
if (is_pinching && raster_page_scale_) {
// We change our raster scale when it is:
@@ -1117,11 +1122,12 @@ void PictureLayerImpl::RecalculateRasterScales() {
raster_contents_scale_ =
std::max(raster_contents_scale_, MinimumContentsScale());
- // Since 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
// known. However, to avoid excessive memory use, don't rasterize at a scale
// at which this layer would become larger than the viewport.
- if (draw_properties().screen_space_transform_is_animating) {
+ if (draw_properties().screen_space_transform_is_animating &&
+ !ShouldAdjustRasterScaleDuringScaleAnimations()) {
bool can_raster_at_maximum_scale = false;
if (draw_properties().maximum_animation_contents_scale > 0.f) {
gfx::Size bounds_at_maximum_scale = gfx::ToCeiledSize(gfx::ScaleSize(
@@ -1299,6 +1305,15 @@ void PictureLayerImpl::SanityCheckTilingState() const {
#endif
}
+bool PictureLayerImpl::ShouldAdjustRasterScaleDuringScaleAnimations() const {
+ if (!layer_tree_impl()->use_gpu_rasterization())
+ return false;
+ if (pile_->has_text())
enne (OOO) 2014/08/20 18:15:49 Can you add some comments about why this is needed
ajuma 2014/08/20 18:51:29 Done.
+ return false;
+
+ return true;
+}
+
float PictureLayerImpl::MaximumTilingContentsScale() const {
float max_contents_scale = MinimumContentsScale();
for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
« 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