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

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

Issue 202753002: cc: Add a tiling iterator that doesn't include borders (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: danakj review Created 6 years, 9 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/resources/picture_pile.cc ('k') | cc/resources/picture_pile_impl.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 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 gfx::Rect padded_rect = rect; 204 gfx::Rect padded_rect = rect;
205 padded_rect.Inset( 205 padded_rect.Inset(
206 -buffer_pixels(), -buffer_pixels(), -buffer_pixels(), -buffer_pixels()); 206 -buffer_pixels(), -buffer_pixels(), -buffer_pixels(), -buffer_pixels());
207 return padded_rect; 207 return padded_rect;
208 } 208 }
209 209
210 scoped_ptr<base::Value> PicturePileBase::AsValue() const { 210 scoped_ptr<base::Value> PicturePileBase::AsValue() const {
211 scoped_ptr<base::ListValue> pictures(new base::ListValue()); 211 scoped_ptr<base::ListValue> pictures(new base::ListValue());
212 gfx::Rect layer_rect(tiling_.total_size()); 212 gfx::Rect layer_rect(tiling_.total_size());
213 std::set<void*> appended_pictures; 213 std::set<void*> appended_pictures;
214 for (TilingData::Iterator tile_iter(&tiling_, layer_rect); 214 bool include_borders = true;
215 tile_iter; ++tile_iter) { 215 for (TilingData::Iterator tile_iter(&tiling_, layer_rect, include_borders);
216 tile_iter;
217 ++tile_iter) {
216 PictureMap::const_iterator map_iter = picture_map_.find(tile_iter.index()); 218 PictureMap::const_iterator map_iter = picture_map_.find(tile_iter.index());
217 if (map_iter == picture_map_.end()) 219 if (map_iter == picture_map_.end())
218 continue; 220 continue;
219 221
220 Picture* picture = map_iter->second.GetPicture(); 222 Picture* picture = map_iter->second.GetPicture();
221 if (picture && (appended_pictures.count(picture) == 0)) { 223 if (picture && (appended_pictures.count(picture) == 0)) {
222 appended_pictures.insert(picture); 224 appended_pictures.insert(picture);
223 pictures->Append(TracedValue::CreateIDRef(picture).release()); 225 pictures->Append(TracedValue::CreateIDRef(picture).release());
224 } 226 }
225 } 227 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index); 279 info.picture_ = picture_->GetCloneForDrawingOnThread(thread_index);
278 return info; 280 return info;
279 } 281 }
280 282
281 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const { 283 float PicturePileBase::PictureInfo::GetInvalidationFrequency() const {
282 return invalidation_history_.count() / 284 return invalidation_history_.count() /
283 static_cast<float>(INVALIDATION_FRAMES_TRACKED); 285 static_cast<float>(INVALIDATION_FRAMES_TRACKED);
284 } 286 }
285 287
286 } // namespace cc 288 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698