| OLD | NEW |
| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 PicturePile::~PicturePile() { | 31 PicturePile::~PicturePile() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void PicturePile::Update( | 34 void PicturePile::Update( |
| 35 ContentLayerClient* painter, | 35 ContentLayerClient* painter, |
| 36 SkColor background_color, | 36 SkColor background_color, |
| 37 const Region& invalidation, | 37 const Region& invalidation, |
| 38 gfx::Rect visible_layer_rect, | 38 gfx::Rect visible_layer_rect, |
| 39 RenderingStats* stats) { | 39 RenderingStatsInstrumentation* stats_instrumentation) { |
| 40 background_color_ = background_color; | 40 background_color_ = background_color; |
| 41 | 41 |
| 42 gfx::Rect interest_rect = visible_layer_rect; | 42 gfx::Rect interest_rect = visible_layer_rect; |
| 43 interest_rect.Inset( | 43 interest_rect.Inset( |
| 44 -kPixelDistanceToRecord, | 44 -kPixelDistanceToRecord, |
| 45 -kPixelDistanceToRecord, | 45 -kPixelDistanceToRecord, |
| 46 -kPixelDistanceToRecord, | 46 -kPixelDistanceToRecord, |
| 47 -kPixelDistanceToRecord); | 47 -kPixelDistanceToRecord); |
| 48 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) { | 48 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) { |
| 49 // Inflate all recordings from invalidations with a margin so that when | 49 // Inflate all recordings from invalidations with a margin so that when |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 -buffer_pixels(), | 96 -buffer_pixels(), |
| 97 -buffer_pixels(), | 97 -buffer_pixels(), |
| 98 -buffer_pixels()); | 98 -buffer_pixels()); |
| 99 scoped_refptr<Picture> base_picture = Picture::Create(tile); | 99 scoped_refptr<Picture> base_picture = Picture::Create(tile); |
| 100 pic_list.push_back(base_picture); | 100 pic_list.push_back(base_picture); |
| 101 } | 101 } |
| 102 | 102 |
| 103 for (PictureList::iterator pic = pic_list.begin(); | 103 for (PictureList::iterator pic = pic_list.begin(); |
| 104 pic != pic_list.end(); ++pic) { | 104 pic != pic_list.end(); ++pic) { |
| 105 if (!(*pic)->HasRecording()) { | 105 if (!(*pic)->HasRecording()) { |
| 106 (*pic)->Record(painter, stats, tile_grid_info_); | 106 (*pic)->Record(painter, stats_instrumentation, tile_grid_info_); |
| 107 (*pic)->CloneForDrawing(num_raster_threads_); | 107 (*pic)->CloneForDrawing(num_raster_threads_); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 UpdateRecordedRegion(); | 112 UpdateRecordedRegion(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 class FullyContainedPredicate { | 115 class FullyContainedPredicate { |
| 116 public: | 116 public: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 FullyContainedPredicate pred(picture_rect); | 152 FullyContainedPredicate pred(picture_rect); |
| 153 picture_list.erase(std::remove_if(picture_list.begin(), | 153 picture_list.erase(std::remove_if(picture_list.begin(), |
| 154 picture_list.end(), | 154 picture_list.end(), |
| 155 pred), | 155 pred), |
| 156 picture_list.end()); | 156 picture_list.end()); |
| 157 picture_list.push_back(Picture::Create(picture_rect)); | 157 picture_list.push_back(Picture::Create(picture_rect)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace cc | 160 } // namespace cc |
| OLD | NEW |