| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_base.h" | 5 #include "cc/resources/picture_pile_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 PicturePileBase::PicturePileBase() | 42 PicturePileBase::PicturePileBase() |
| 43 : min_contents_scale_(0), | 43 : min_contents_scale_(0), |
| 44 background_color_(SkColorSetARGBInline(0, 0, 0, 0)), | 44 background_color_(SkColorSetARGBInline(0, 0, 0, 0)), |
| 45 slow_down_raster_scale_factor_for_debug_(0), | 45 slow_down_raster_scale_factor_for_debug_(0), |
| 46 contents_opaque_(false), | 46 contents_opaque_(false), |
| 47 contents_fill_bounds_completely_(false), | 47 contents_fill_bounds_completely_(false), |
| 48 show_debug_picture_borders_(false), | 48 show_debug_picture_borders_(false), |
| 49 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), | 49 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), |
| 50 has_any_recordings_(false), | 50 has_any_recordings_(false), |
| 51 has_text_(false) { | 51 has_text_(false), |
| 52 is_mask_(false) { |
| 52 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); | 53 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); |
| 53 tile_grid_info_.fTileInterval.setEmpty(); | 54 tile_grid_info_.fTileInterval.setEmpty(); |
| 54 tile_grid_info_.fMargin.setEmpty(); | 55 tile_grid_info_.fMargin.setEmpty(); |
| 55 tile_grid_info_.fOffset.setZero(); | 56 tile_grid_info_.fOffset.setZero(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 PicturePileBase::PicturePileBase(const PicturePileBase* other) | 59 PicturePileBase::PicturePileBase(const PicturePileBase* other) |
| 59 : picture_map_(other->picture_map_), | 60 : picture_map_(other->picture_map_), |
| 60 tiling_(other->tiling_), | 61 tiling_(other->tiling_), |
| 61 recorded_viewport_(other->recorded_viewport_), | 62 recorded_viewport_(other->recorded_viewport_), |
| 62 min_contents_scale_(other->min_contents_scale_), | 63 min_contents_scale_(other->min_contents_scale_), |
| 63 tile_grid_info_(other->tile_grid_info_), | 64 tile_grid_info_(other->tile_grid_info_), |
| 64 background_color_(other->background_color_), | 65 background_color_(other->background_color_), |
| 65 slow_down_raster_scale_factor_for_debug_( | 66 slow_down_raster_scale_factor_for_debug_( |
| 66 other->slow_down_raster_scale_factor_for_debug_), | 67 other->slow_down_raster_scale_factor_for_debug_), |
| 67 contents_opaque_(other->contents_opaque_), | 68 contents_opaque_(other->contents_opaque_), |
| 68 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 69 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), |
| 69 show_debug_picture_borders_(other->show_debug_picture_borders_), | 70 show_debug_picture_borders_(other->show_debug_picture_borders_), |
| 70 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 71 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
| 71 has_any_recordings_(other->has_any_recordings_), | 72 has_any_recordings_(other->has_any_recordings_), |
| 72 has_text_(other->has_text_) { | 73 has_text_(other->has_text_), |
| 74 is_mask_(other->is_mask_) { |
| 73 } | 75 } |
| 74 | 76 |
| 75 PicturePileBase::~PicturePileBase() { | 77 PicturePileBase::~PicturePileBase() { |
| 76 } | 78 } |
| 77 | 79 |
| 78 void PicturePileBase::SetMinContentsScale(float min_contents_scale) { | 80 void PicturePileBase::SetMinContentsScale(float min_contents_scale) { |
| 79 DCHECK(min_contents_scale); | 81 DCHECK(min_contents_scale); |
| 80 if (min_contents_scale_ == min_contents_scale) | 82 if (min_contents_scale_ == min_contents_scale) |
| 81 return; | 83 return; |
| 82 | 84 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 const Picture* PicturePileBase::PictureInfo::GetPicture() const { | 245 const Picture* PicturePileBase::PictureInfo::GetPicture() const { |
| 244 return picture_.get(); | 246 return picture_.get(); |
| 245 } | 247 } |
| 246 | 248 |
| 247 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { | 249 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { |
| 248 return invalidation_history_.count() / | 250 return invalidation_history_.count() / |
| 249 static_cast<float>(INVALIDATION_FRAMES_TRACKED); | 251 static_cast<float>(INVALIDATION_FRAMES_TRACKED); |
| 250 } | 252 } |
| 251 | 253 |
| 252 } // namespace cc | 254 } // namespace cc |
| OLD | NEW |