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

Side by Side Diff: cc/picture_pile_impl.cc

Issue 12192025: Add cheapness predictor success histogram (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased the change on top of (partial) 12194015 Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/picture_pile_impl.h ('k') | cc/test/fake_picture_layer_tiling_client.cc » ('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 "base/debug/trace_event.h" 5 #include "base/debug/trace_event.h"
6 #include "cc/picture_pile_impl.h" 6 #include "cc/picture_pile_impl.h"
7 #include "cc/region.h" 7 #include "cc/region.h"
8 #include "cc/rendering_stats.h" 8 #include "cc/rendering_stats.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkSize.h" 10 #include "third_party/skia/include/core/SkSize.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 layer_rect.height(), 161 layer_rect.height(),
162 SkPicture::kUsePathBoundsForClip_RecordingFlag); 162 SkPicture::kUsePathBoundsForClip_RecordingFlag);
163 163
164 RenderingStats stats; 164 RenderingStats stats;
165 Raster(canvas, layer_rect, 1.0, &stats); 165 Raster(canvas, layer_rect, 1.0, &stats);
166 picture->endRecording(); 166 picture->endRecording();
167 167
168 return picture; 168 return picture;
169 } 169 }
170 170
171 bool PicturePileImpl::IsCheapInRect(
172 gfx::Rect content_rect, float contents_scale) const {
173 gfx::Rect layer_rect = gfx::ToEnclosingRect(
174 gfx::ScaleRect(content_rect, 1.f / contents_scale));
175
176 for (TilingData::Iterator tile_iter(&tiling_, layer_rect);
177 tile_iter; ++tile_iter) {
178 PictureListMap::const_iterator map_iter =
179 picture_list_map_.find(tile_iter.index());
180 if (map_iter == picture_list_map_.end())
181 continue;
182
183 const PictureList& pic_list = map_iter->second;
184 for (PictureList::const_iterator i = pic_list.begin();
185 i != pic_list.end(); ++i) {
186 if (!(*i)->LayerRect().Intersects(layer_rect) || !(*i)->HasRecording())
187 continue;
188 if (!(*i)->IsCheapInRect(layer_rect))
Tom Hudson 2013/02/06 12:24:57 This layer_rect is the content_rect, inverse scale
189 return false;
190 }
191 }
192 return true;
193 }
194
171 } // namespace cc 195 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture_pile_impl.h ('k') | cc/test/fake_picture_layer_tiling_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698