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 29 matching lines...) Expand all Loading... |
40 namespace cc { | 40 namespace cc { |
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 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); | 52 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); |
52 tile_grid_info_.fTileInterval.setEmpty(); | 53 tile_grid_info_.fTileInterval.setEmpty(); |
53 tile_grid_info_.fMargin.setEmpty(); | 54 tile_grid_info_.fMargin.setEmpty(); |
54 tile_grid_info_.fOffset.setZero(); | 55 tile_grid_info_.fOffset.setZero(); |
55 } | 56 } |
56 | 57 |
57 PicturePileBase::PicturePileBase(const PicturePileBase* other) | 58 PicturePileBase::PicturePileBase(const PicturePileBase* other) |
58 : picture_map_(other->picture_map_), | 59 : picture_map_(other->picture_map_), |
59 tiling_(other->tiling_), | 60 tiling_(other->tiling_), |
60 recorded_viewport_(other->recorded_viewport_), | 61 recorded_viewport_(other->recorded_viewport_), |
61 min_contents_scale_(other->min_contents_scale_), | 62 min_contents_scale_(other->min_contents_scale_), |
62 tile_grid_info_(other->tile_grid_info_), | 63 tile_grid_info_(other->tile_grid_info_), |
63 background_color_(other->background_color_), | 64 background_color_(other->background_color_), |
64 slow_down_raster_scale_factor_for_debug_( | 65 slow_down_raster_scale_factor_for_debug_( |
65 other->slow_down_raster_scale_factor_for_debug_), | 66 other->slow_down_raster_scale_factor_for_debug_), |
66 contents_opaque_(other->contents_opaque_), | 67 contents_opaque_(other->contents_opaque_), |
67 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 68 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), |
68 show_debug_picture_borders_(other->show_debug_picture_borders_), | 69 show_debug_picture_borders_(other->show_debug_picture_borders_), |
69 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 70 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
70 has_any_recordings_(other->has_any_recordings_) {} | 71 has_any_recordings_(other->has_any_recordings_), |
| 72 has_text_(other->has_text_) { |
| 73 } |
71 | 74 |
72 PicturePileBase::PicturePileBase(const PicturePileBase* other, | 75 PicturePileBase::PicturePileBase(const PicturePileBase* other, |
73 unsigned thread_index) | 76 unsigned thread_index) |
74 : tiling_(other->tiling_), | 77 : tiling_(other->tiling_), |
75 recorded_viewport_(other->recorded_viewport_), | 78 recorded_viewport_(other->recorded_viewport_), |
76 min_contents_scale_(other->min_contents_scale_), | 79 min_contents_scale_(other->min_contents_scale_), |
77 tile_grid_info_(other->tile_grid_info_), | 80 tile_grid_info_(other->tile_grid_info_), |
78 background_color_(other->background_color_), | 81 background_color_(other->background_color_), |
79 slow_down_raster_scale_factor_for_debug_( | 82 slow_down_raster_scale_factor_for_debug_( |
80 other->slow_down_raster_scale_factor_for_debug_), | 83 other->slow_down_raster_scale_factor_for_debug_), |
81 contents_opaque_(other->contents_opaque_), | 84 contents_opaque_(other->contents_opaque_), |
82 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), | 85 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), |
83 show_debug_picture_borders_(other->show_debug_picture_borders_), | 86 show_debug_picture_borders_(other->show_debug_picture_borders_), |
84 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), | 87 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), |
85 has_any_recordings_(other->has_any_recordings_) { | 88 has_any_recordings_(other->has_any_recordings_), |
| 89 has_text_(other->has_text_) { |
86 for (PictureMap::const_iterator it = other->picture_map_.begin(); | 90 for (PictureMap::const_iterator it = other->picture_map_.begin(); |
87 it != other->picture_map_.end(); | 91 it != other->picture_map_.end(); |
88 ++it) { | 92 ++it) { |
89 picture_map_[it->first] = it->second.CloneForThread(thread_index); | 93 picture_map_[it->first] = it->second.CloneForThread(thread_index); |
90 } | 94 } |
91 } | 95 } |
92 | 96 |
93 PicturePileBase::~PicturePileBase() { | 97 PicturePileBase::~PicturePileBase() { |
94 } | 98 } |
95 | 99 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index); | 273 info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index); |
270 return info; | 274 return info; |
271 } | 275 } |
272 | 276 |
273 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { | 277 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { |
274 return invalidation_history_.count() / | 278 return invalidation_history_.count() / |
275 static_cast<float>(INVALIDATION_FRAMES_TRACKED); | 279 static_cast<float>(INVALIDATION_FRAMES_TRACKED); |
276 } | 280 } |
277 | 281 |
278 } // namespace cc | 282 } // namespace cc |
OLD | NEW |