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

Side by Side Diff: cc/resources/picture_pile.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: final merge 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
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 *record_rects = vertical_clustering; 144 *record_rects = vertical_clustering;
145 return vertical_density; 145 return vertical_density;
146 } 146 }
147 147
148 } // namespace 148 } // namespace
149 149
150 namespace cc { 150 namespace cc {
151 151
152 PicturePile::PicturePile() 152 PicturePile::PicturePile() : is_suitable_for_gpu_rasterization_(true) {
153 : is_suitable_for_gpu_rasterization_(true),
154 is_solid_color_(true),
155 solid_color_(SK_ColorTRANSPARENT) {
156 } 153 }
157 154
158 PicturePile::~PicturePile() { 155 PicturePile::~PicturePile() {
159 } 156 }
160 157
161 bool PicturePile::UpdateAndExpandInvalidation( 158 bool PicturePile::UpdateAndExpandInvalidation(
162 ContentLayerClient* painter, 159 ContentLayerClient* painter,
163 Region* invalidation, 160 Region* invalidation,
164 SkColor background_color, 161 SkColor background_color,
165 bool contents_opaque, 162 bool contents_opaque,
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 if (it->second.GetPicture() != picture) 554 if (it->second.GetPicture() != picture)
558 return; 555 return;
559 } 556 }
560 skia::AnalysisCanvas canvas(recorded_viewport_.width(), 557 skia::AnalysisCanvas canvas(recorded_viewport_.width(),
561 recorded_viewport_.height()); 558 recorded_viewport_.height());
562 picture->Raster(&canvas, NULL, Region(), 1.0f); 559 picture->Raster(&canvas, NULL, Region(), 1.0f);
563 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); 560 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_);
564 } 561 }
565 562
566 } // namespace cc 563 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698