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

Side by Side Diff: cc/resources/picture_pile.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: Add comment 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_pile_base.h » ('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/resources/picture_pile.h" 5 #include "cc/resources/picture_pile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 num_raster_threads, 364 num_raster_threads,
365 recording_mode); 365 recording_mode);
366 // Note the '&&' with previous is-suitable state. 366 // Note the '&&' with previous is-suitable state.
367 // This means that once a picture-pile becomes unsuitable for gpu 367 // This means that once a picture-pile becomes unsuitable for gpu
368 // rasterization due to some content, it will continue to be unsuitable 368 // rasterization due to some content, it will continue to be unsuitable
369 // even if that content is replaced by gpu-friendly content. 369 // even if that content is replaced by gpu-friendly content.
370 // This is an optimization to avoid iterating though all pictures in 370 // This is an optimization to avoid iterating though all pictures in
371 // the pile after each invalidation. 371 // the pile after each invalidation.
372 is_suitable_for_gpu_rasterization_ &= 372 is_suitable_for_gpu_rasterization_ &=
373 picture->IsSuitableForGpuRasterization(); 373 picture->IsSuitableForGpuRasterization();
374 has_text_ |= picture->HasText();
374 base::TimeDelta duration = 375 base::TimeDelta duration =
375 stats_instrumentation->EndRecording(start_time); 376 stats_instrumentation->EndRecording(start_time);
376 best_duration = std::min(duration, best_duration); 377 best_duration = std::min(duration, best_duration);
377 } 378 }
378 int recorded_pixel_count = 379 int recorded_pixel_count =
379 picture->LayerRect().width() * picture->LayerRect().height(); 380 picture->LayerRect().width() * picture->LayerRect().height();
380 stats_instrumentation->AddRecord(best_duration, recorded_pixel_count); 381 stats_instrumentation->AddRecord(best_duration, recorded_pixel_count);
381 } 382 }
382 383
383 bool found_tile_for_recorded_picture = false; 384 bool found_tile_for_recorded_picture = false;
(...skipping 18 matching lines...) Expand all
402 } 403 }
403 404
404 void PicturePile::SetEmptyBounds() { 405 void PicturePile::SetEmptyBounds() {
405 tiling_.SetTilingSize(gfx::Size()); 406 tiling_.SetTilingSize(gfx::Size());
406 picture_map_.clear(); 407 picture_map_.clear();
407 has_any_recordings_ = false; 408 has_any_recordings_ = false;
408 recorded_viewport_ = gfx::Rect(); 409 recorded_viewport_ = gfx::Rect();
409 } 410 }
410 411
411 } // namespace cc 412 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698