Index: cc/resources/picture_pile.cc |
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc |
index 0e2e36310206d2eff158afd53993407dbe3ca342..8a15ea604e71558441fab48c7194740003c61c7a 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() { |
} |
@@ -245,6 +244,14 @@ bool PicturePile::Update(ContentLayerClient* painter, |
gather_pixel_refs, |
num_raster_threads, |
Picture::RECORD_NORMALLY); |
+ // 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_ &= |
alokp
2014/04/09 18:28:27
enne@: I need to move this flag to the impl thread
enne (OOO)
2014/04/09 18:32:53
PicturePileImpls are never updated, only overwritt
|
+ picture->IsSuitableForGpuRasterization(); |
base::TimeDelta duration = |
stats_instrumentation->EndRecording(start_time); |
best_duration = std::min(duration, best_duration); |