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