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

Unified Diff: cc/picture_pile_impl.cc

Issue 11299324: Make PicturePile pile. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix signed/unsigned mismatch warning Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/picture_pile_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_pile_impl.cc
diff --git a/cc/picture_pile_impl.cc b/cc/picture_pile_impl.cc
index 2f898281360bd2040aa0751840ebe096a5001ade..216643bf84b84b4745d56a2d750351b56ed60e59 100644
--- a/cc/picture_pile_impl.cc
+++ b/cc/picture_pile_impl.cc
@@ -23,9 +23,9 @@ PicturePileImpl::~PicturePileImpl() {
scoped_refptr<PicturePileImpl> PicturePileImpl::CloneForDrawing() const {
TRACE_EVENT0("cc", "PicturePileImpl::CloneForDrawing");
scoped_refptr<PicturePileImpl> clone = Create();
- clone->pile_.resize(pile_.size());
- for (size_t i = 0; i < pile_.size(); ++i)
- clone->pile_[i] = pile_[i]->Clone();
+ for (PicturePile::Pile::const_iterator i = pile_.begin();
+ i != pile_.end(); ++i)
+ clone->pile_.push_back((*i)->Clone());
return clone;
}
@@ -40,10 +40,11 @@ void PicturePileImpl::Raster(SkCanvas* canvas, gfx::Rect rect,
SkRect layer_skrect = SkRect::MakeXYWH(rect.x(), rect.y(),
rect.width(), rect.height());
canvas->clipRect(layer_skrect);
- for (size_t i = 0; i < pile_.size(); ++i) {
- if (!pile_[i]->LayerRect().Intersects(rect))
+ for (PicturePile::Pile::const_iterator i = pile_.begin();
+ i != pile_.end(); ++i) {
+ if (!(*i)->LayerRect().Intersects(rect))
continue;
- pile_[i]->Raster(canvas);
+ (*i)->Raster(canvas);
SkISize deviceSize = canvas->getDeviceSize();
stats->totalPixelsRasterized += deviceSize.width() * deviceSize.height();
« no previous file with comments | « cc/picture_pile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698