| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "cc/picture_pile.h" | 7 #include "cc/picture_pile.h" |
| 8 #include "cc/picture_pile_impl.h" | 8 #include "cc/picture_pile_impl.h" |
| 9 #include "cc/region.h" | 9 #include "cc/region.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 return; | 31 return; |
| 32 } | 32 } |
| 33 | 33 |
| 34 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) | 34 for (Region::Iterator i(invalidation); i.has_rect(); i.next()) |
| 35 InvalidateRect(i.rect()); | 35 InvalidateRect(i.rect()); |
| 36 | 36 |
| 37 for (Pile::iterator i = pile_.begin(); i != pile_.end(); ++i) { | 37 for (Pile::iterator i = pile_.begin(); i != pile_.end(); ++i) { |
| 38 if (!(*i)->HasRecording()) | 38 if (!(*i)->HasRecording()) |
| 39 (*i)->Record(painter, stats); | 39 (*i)->Record(painter, stats); |
| 40 } | 40 } |
| 41 DCHECK(!pile_.empty()); |
| 41 } | 42 } |
| 42 | 43 |
| 43 class FullyContainedPredicate { | 44 class FullyContainedPredicate { |
| 44 public: | 45 public: |
| 45 FullyContainedPredicate(gfx::Rect rect) : layer_rect_(rect) { } | 46 FullyContainedPredicate(gfx::Rect rect) : layer_rect_(rect) { } |
| 46 bool operator()(const scoped_refptr<Picture>& picture) { | 47 bool operator()(const scoped_refptr<Picture>& picture) { |
| 47 return layer_rect_.Contains(picture->LayerRect()); | 48 return layer_rect_.Contains(picture->LayerRect()); |
| 48 } | 49 } |
| 49 gfx::Rect layer_rect_; | 50 gfx::Rect layer_rect_; |
| 50 }; | 51 }; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 98 } |
| 98 | 99 |
| 99 void PicturePile::PushPropertiesTo(PicturePileImpl* other) { | 100 void PicturePile::PushPropertiesTo(PicturePileImpl* other) { |
| 100 PicturePileBase::PushPropertiesTo(other); | 101 PicturePileBase::PushPropertiesTo(other); |
| 101 | 102 |
| 102 // Remove all old clones. | 103 // Remove all old clones. |
| 103 other->clones_.clear(); | 104 other->clones_.clear(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 } // namespace cc | 107 } // namespace cc |
| OLD | NEW |