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 26 matching lines...) Expand all Loading... |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 namespace cc { | 39 namespace cc { |
40 | 40 |
41 PicturePileBase::PicturePileBase() | 41 PicturePileBase::PicturePileBase() |
42 : min_contents_scale_(0), | 42 : min_contents_scale_(0), |
43 background_color_(SkColorSetARGBInline(0, 0, 0, 0)), | 43 background_color_(SkColorSetARGBInline(0, 0, 0, 0)), |
44 slow_down_raster_scale_factor_for_debug_(0), | 44 slow_down_raster_scale_factor_for_debug_(0), |
45 contents_opaque_(false), | 45 contents_opaque_(false), |
46 show_debug_picture_borders_(false), | 46 show_debug_picture_borders_(false), |
47 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting), | 47 clear_canvas_with_debug_color_(kDefaultClearCanvasSetting) { |
48 num_raster_threads_(0) { | |
49 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); | 48 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); |
50 tile_grid_info_.fTileInterval.setEmpty(); | 49 tile_grid_info_.fTileInterval.setEmpty(); |
51 tile_grid_info_.fMargin.setEmpty(); | 50 tile_grid_info_.fMargin.setEmpty(); |
52 tile_grid_info_.fOffset.setZero(); | 51 tile_grid_info_.fOffset.setZero(); |
53 } | 52 } |
54 | 53 |
55 PicturePileBase::PicturePileBase(const PicturePileBase* other) | 54 PicturePileBase::PicturePileBase(const PicturePileBase* other) |
56 : picture_map_(other->picture_map_), | 55 : picture_map_(other->picture_map_), |
57 tiling_(other->tiling_), | 56 tiling_(other->tiling_), |
58 recorded_region_(other->recorded_region_), | 57 recorded_region_(other->recorded_region_), |
59 min_contents_scale_(other->min_contents_scale_), | 58 min_contents_scale_(other->min_contents_scale_), |
60 tile_grid_info_(other->tile_grid_info_), | 59 tile_grid_info_(other->tile_grid_info_), |
61 background_color_(other->background_color_), | 60 background_color_(other->background_color_), |
62 slow_down_raster_scale_factor_for_debug_( | 61 slow_down_raster_scale_factor_for_debug_( |
63 other->slow_down_raster_scale_factor_for_debug_), | 62 other->slow_down_raster_scale_factor_for_debug_), |
64 contents_opaque_(other->contents_opaque_), | 63 contents_opaque_(other->contents_opaque_), |
65 show_debug_picture_borders_(other->show_debug_picture_borders_), | 64 show_debug_picture_borders_(other->show_debug_picture_borders_), |
66 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 65 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_) { |
67 num_raster_threads_(other->num_raster_threads_) { | |
68 } | 66 } |
69 | 67 |
70 PicturePileBase::PicturePileBase( | 68 PicturePileBase::PicturePileBase( |
71 const PicturePileBase* other, unsigned thread_index) | 69 const PicturePileBase* other, unsigned thread_index) |
72 : tiling_(other->tiling_), | 70 : tiling_(other->tiling_), |
73 recorded_region_(other->recorded_region_), | 71 recorded_region_(other->recorded_region_), |
74 min_contents_scale_(other->min_contents_scale_), | 72 min_contents_scale_(other->min_contents_scale_), |
75 tile_grid_info_(other->tile_grid_info_), | 73 tile_grid_info_(other->tile_grid_info_), |
76 background_color_(other->background_color_), | 74 background_color_(other->background_color_), |
77 slow_down_raster_scale_factor_for_debug_( | 75 slow_down_raster_scale_factor_for_debug_( |
78 other->slow_down_raster_scale_factor_for_debug_), | 76 other->slow_down_raster_scale_factor_for_debug_), |
79 contents_opaque_(other->contents_opaque_), | 77 contents_opaque_(other->contents_opaque_), |
80 show_debug_picture_borders_(other->show_debug_picture_borders_), | 78 show_debug_picture_borders_(other->show_debug_picture_borders_), |
81 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 79 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_) { |
82 num_raster_threads_(other->num_raster_threads_) { | |
83 for (PictureMap::const_iterator it = other->picture_map_.begin(); | 80 for (PictureMap::const_iterator it = other->picture_map_.begin(); |
84 it != other->picture_map_.end(); | 81 it != other->picture_map_.end(); |
85 ++it) { | 82 ++it) { |
86 picture_map_[it->first] = it->second.CloneForThread(thread_index); | 83 picture_map_[it->first] = it->second.CloneForThread(thread_index); |
87 } | 84 } |
88 } | 85 } |
89 | 86 |
90 PicturePileBase::~PicturePileBase() { | 87 PicturePileBase::~PicturePileBase() { |
91 } | 88 } |
92 | 89 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index); | 277 info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index); |
281 return info; | 278 return info; |
282 } | 279 } |
283 | 280 |
284 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { | 281 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { |
285 return invalidation_history_.count() / | 282 return invalidation_history_.count() / |
286 static_cast<float>(INVALIDATION_FRAMES_TRACKED); | 283 static_cast<float>(INVALIDATION_FRAMES_TRACKED); |
287 } | 284 } |
288 | 285 |
289 } // namespace cc | 286 } // namespace cc |
OLD | NEW |