Chromium Code Reviews| Index: cc/resources/picture_pile.cc |
| diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc |
| index 1af8b4ce05a9df51aaf5b6a4ea7da0cb658e9828..2d291aede0fe42880f4ef4cb41c0b7b961610fff 100644 |
| --- a/cc/resources/picture_pile.cc |
| +++ b/cc/resources/picture_pile.cc |
| @@ -141,8 +141,7 @@ float ClusterTiles(const std::vector<gfx::Rect>& invalid_tiles, |
| namespace cc { |
| -PicturePile::PicturePile() { |
| -} |
| +PicturePile::PicturePile() : is_suitable_for_gpu_rasterization_(true) {} |
| PicturePile::~PicturePile() { |
| } |
| @@ -244,6 +243,15 @@ bool PicturePile::Update(ContentLayerClient* painter, |
| tile_grid_info_, |
| gather_pixel_refs, |
| num_raster_threads); |
| + // Note the '&&' with previous is-suitable state. |
| + // This means that once a picture-pile becomes unsuitable for gpu |
| + // rasterization due to some content, it will continue to be unsuitable |
| + // even if that content is replaced by gpu-friendly content. |
| + // This is an optimization to avoid iterating though all pictures in |
| + // the pile after each invalidation. |
| + is_suitable_for_gpu_rasterization_ = |
|
enne (OOO)
2014/04/04 18:34:19
You could just shorten this to &=
alokp
2014/04/04 18:50:34
Done.
|
| + is_suitable_for_gpu_rasterization_ && |
| + picture->IsSuitableForGpuRasterization(); |
| base::TimeDelta duration = |
| stats_instrumentation->EndRecording(start_time); |
| best_duration = std::min(duration, best_duration); |