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 <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 return; | 149 return; |
150 } | 150 } |
151 | 151 |
152 *record_rects = vertical_clustering; | 152 *record_rects = vertical_clustering; |
153 } | 153 } |
154 | 154 |
155 } // namespace | 155 } // namespace |
156 | 156 |
157 namespace cc { | 157 namespace cc { |
158 | 158 |
159 PicturePile::PicturePile() | 159 PicturePile::PicturePile(float min_contents_scale, |
| 160 const gfx::Size& tile_grid_size) |
160 : min_contents_scale_(0), | 161 : min_contents_scale_(0), |
161 slow_down_raster_scale_factor_for_debug_(0), | 162 slow_down_raster_scale_factor_for_debug_(0), |
162 can_use_lcd_text_(true), | 163 can_use_lcd_text_(true), |
163 has_any_recordings_(false), | 164 has_any_recordings_(false), |
164 is_solid_color_(false), | 165 is_solid_color_(false), |
165 solid_color_(SK_ColorTRANSPARENT), | 166 solid_color_(SK_ColorTRANSPARENT), |
166 pixel_record_distance_(kPixelDistanceToRecord), | 167 pixel_record_distance_(kPixelDistanceToRecord), |
167 is_suitable_for_gpu_rasterization_(true) { | 168 is_suitable_for_gpu_rasterization_(true) { |
168 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); | 169 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); |
| 170 SetMinContentsScale(min_contents_scale); |
| 171 SetTileGridSize(tile_grid_size); |
169 } | 172 } |
170 | 173 |
171 PicturePile::~PicturePile() { | 174 PicturePile::~PicturePile() { |
172 } | 175 } |
173 | 176 |
174 bool PicturePile::UpdateAndExpandInvalidation( | 177 bool PicturePile::UpdateAndExpandInvalidation( |
175 ContentLayerClient* painter, | 178 ContentLayerClient* painter, |
176 Region* invalidation, | 179 Region* invalidation, |
177 bool can_use_lcd_text, | 180 bool can_use_lcd_text, |
178 const gfx::Size& layer_size, | 181 const gfx::Size& layer_size, |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 const Picture* PicturePile::PictureInfo::GetPicture() const { | 759 const Picture* PicturePile::PictureInfo::GetPicture() const { |
757 return picture_.get(); | 760 return picture_.get(); |
758 } | 761 } |
759 | 762 |
760 float PicturePile::PictureInfo::GetInvalidationFrequency() const { | 763 float PicturePile::PictureInfo::GetInvalidationFrequency() const { |
761 return invalidation_history_.count() / | 764 return invalidation_history_.count() / |
762 static_cast<float>(INVALIDATION_FRAMES_TRACKED); | 765 static_cast<float>(INVALIDATION_FRAMES_TRACKED); |
763 } | 766 } |
764 | 767 |
765 } // namespace cc | 768 } // namespace cc |
OLD | NEW |