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

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

Issue 648293006: cc: turn on distance field text on animated layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 6 years, 2 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
« no previous file with comments | « no previous file | cc/resources/gpu_raster_worker_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 476
477 DCHECK(raster_page_scale_); 477 DCHECK(raster_page_scale_);
478 DCHECK(raster_device_scale_); 478 DCHECK(raster_device_scale_);
479 DCHECK(raster_source_scale_); 479 DCHECK(raster_source_scale_);
480 DCHECK(raster_contents_scale_); 480 DCHECK(raster_contents_scale_);
481 DCHECK(low_res_raster_contents_scale_); 481 DCHECK(low_res_raster_contents_scale_);
482 482
483 was_screen_space_transform_animating_ = 483 was_screen_space_transform_animating_ =
484 draw_properties().screen_space_transform_is_animating; 484 draw_properties().screen_space_transform_is_animating;
485 485
486 if (draw_transform_is_animating())
487 pile_->set_will_be_used_for_transform_animation(true);
488
486 should_update_tile_priorities_ = true; 489 should_update_tile_priorities_ = true;
487 490
488 UpdateTilePriorities(occlusion_in_content_space); 491 UpdateTilePriorities(occlusion_in_content_space);
489 } 492 }
490 493
491 void PictureLayerImpl::UpdateTilePriorities( 494 void PictureLayerImpl::UpdateTilePriorities(
492 const Occlusion& occlusion_in_content_space) { 495 const Occlusion& occlusion_in_content_space) {
493 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings()); 496 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings());
494 497
495 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); 498 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 } 1228 }
1226 if (tilings_->num_tilings() == 0) 1229 if (tilings_->num_tilings() == 0)
1227 return; 1230 return;
1228 1231
1229 // We should only have one high res tiling. 1232 // We should only have one high res tiling.
1230 DCHECK_EQ(1, tilings_->NumHighResTilings()); 1233 DCHECK_EQ(1, tilings_->NumHighResTilings());
1231 #endif 1234 #endif
1232 } 1235 }
1233 1236
1234 bool PictureLayerImpl::ShouldAdjustRasterScaleDuringScaleAnimations() const { 1237 bool PictureLayerImpl::ShouldAdjustRasterScaleDuringScaleAnimations() const {
1235 if (!layer_tree_impl()->use_gpu_rasterization())
1236 return false;
ajuma 2014/10/17 13:36:24 We still need this check, since we don't want to r
1237
1238 // Re-rastering text at different scales using GPU rasterization causes
1239 // texture uploads for glyphs at each scale (see crbug.com/366225). To
1240 // workaround this performance issue, we don't re-rasterize layers with
1241 // text during scale animations.
1242 // TODO(ajuma): Remove this workaround once text can be efficiently
1243 // re-rastered at different scales (e.g. by using distance-field fonts).
1244 if (pile_->has_text())
1245 return false;
1246
1247 return true; 1238 return true;
1248 } 1239 }
1249 1240
1250 float PictureLayerImpl::MaximumTilingContentsScale() const { 1241 float PictureLayerImpl::MaximumTilingContentsScale() const {
1251 float max_contents_scale = MinimumContentsScale(); 1242 float max_contents_scale = MinimumContentsScale();
1252 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { 1243 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
1253 const PictureLayerTiling* tiling = tilings_->tiling_at(i); 1244 const PictureLayerTiling* tiling = tilings_->tiling_at(i);
1254 max_contents_scale = std::max(max_contents_scale, tiling->contents_scale()); 1245 max_contents_scale = std::max(max_contents_scale, tiling->contents_scale());
1255 } 1246 }
1256 return max_contents_scale; 1247 return max_contents_scale;
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); 1661 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange();
1671 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; 1662 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start;
1672 return tiling_range.end - 1 - current_tiling_range_offset; 1663 return tiling_range.end - 1 - current_tiling_range_offset;
1673 } 1664 }
1674 } 1665 }
1675 NOTREACHED(); 1666 NOTREACHED();
1676 return 0; 1667 return 0;
1677 } 1668 }
1678 1669
1679 } // namespace cc 1670 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/gpu_raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698