Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: cc/resources/picture_pile_base.cc

Issue 519583003: Use the solid color detection to create solid layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused variable Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 is_mask_(false),
53 is_solid_color_(false),
54 solid_color_(SK_ColorTRANSPARENT) {
53 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize)); 55 tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize));
54 tile_grid_info_.fTileInterval.setEmpty(); 56 tile_grid_info_.fTileInterval.setEmpty();
55 tile_grid_info_.fMargin.setEmpty(); 57 tile_grid_info_.fMargin.setEmpty();
56 tile_grid_info_.fOffset.setZero(); 58 tile_grid_info_.fOffset.setZero();
57 } 59 }
58 60
59 PicturePileBase::PicturePileBase(const PicturePileBase* other) 61 PicturePileBase::PicturePileBase(const PicturePileBase* other)
60 : picture_map_(other->picture_map_), 62 : picture_map_(other->picture_map_),
61 tiling_(other->tiling_), 63 tiling_(other->tiling_),
62 recorded_viewport_(other->recorded_viewport_), 64 recorded_viewport_(other->recorded_viewport_),
63 min_contents_scale_(other->min_contents_scale_), 65 min_contents_scale_(other->min_contents_scale_),
64 tile_grid_info_(other->tile_grid_info_), 66 tile_grid_info_(other->tile_grid_info_),
65 background_color_(other->background_color_), 67 background_color_(other->background_color_),
66 slow_down_raster_scale_factor_for_debug_( 68 slow_down_raster_scale_factor_for_debug_(
67 other->slow_down_raster_scale_factor_for_debug_), 69 other->slow_down_raster_scale_factor_for_debug_),
68 contents_opaque_(other->contents_opaque_), 70 contents_opaque_(other->contents_opaque_),
69 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_), 71 contents_fill_bounds_completely_(other->contents_fill_bounds_completely_),
70 show_debug_picture_borders_(other->show_debug_picture_borders_), 72 show_debug_picture_borders_(other->show_debug_picture_borders_),
71 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), 73 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_),
72 has_any_recordings_(other->has_any_recordings_), 74 has_any_recordings_(other->has_any_recordings_),
73 has_text_(other->has_text_), 75 has_text_(other->has_text_),
74 is_mask_(other->is_mask_) { 76 is_mask_(other->is_mask_),
77 is_solid_color_(other->is_solid_color_),
78 solid_color_(other->solid_color_) {
75 } 79 }
76 80
77 PicturePileBase::~PicturePileBase() { 81 PicturePileBase::~PicturePileBase() {
78 } 82 }
79 83
80 void PicturePileBase::SetMinContentsScale(float min_contents_scale) { 84 void PicturePileBase::SetMinContentsScale(float min_contents_scale) {
81 DCHECK(min_contents_scale); 85 DCHECK(min_contents_scale);
82 if (min_contents_scale_ == min_contents_scale) 86 if (min_contents_scale_ == min_contents_scale)
83 return; 87 return;
84 88
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 const Picture* PicturePileBase::PictureInfo::GetPicture() const { 249 const Picture* PicturePileBase::PictureInfo::GetPicture() const {
246 return picture_.get(); 250 return picture_.get();
247 } 251 }
248 252
249 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { 253 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const {
250 return invalidation_history_.count() / 254 return invalidation_history_.count() /
251 static_cast<float>(INVALIDATION_FRAMES_TRACKED); 255 static_cast<float>(INVALIDATION_FRAMES_TRACKED);
252 } 256 }
253 257
254 } // namespace cc 258 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698