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 | 9 |
10 namespace { | 10 namespace { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 InvalidateRect(i.rect()); | 45 InvalidateRect(i.rect()); |
46 | 46 |
47 for (Pile::iterator i = pile_.begin(); i != pile_.end(); ++i) { | 47 for (Pile::iterator i = pile_.begin(); i != pile_.end(); ++i) { |
48 if (!(*i)->HasRecording()) | 48 if (!(*i)->HasRecording()) |
49 (*i)->Record(painter, stats); | 49 (*i)->Record(painter, stats); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 class FullyContainedPredicate { | 53 class FullyContainedPredicate { |
54 public: | 54 public: |
55 FullyContainedPredicate(gfx::Rect rect) : layer_rect_(rect) { } | 55 explicit FullyContainedPredicate(gfx::Rect rect) : layer_rect_(rect) { } |
56 bool operator()(const scoped_refptr<Picture>& picture) { | 56 bool operator()(const scoped_refptr<Picture>& picture) { |
57 return layer_rect_.Contains(picture->LayerRect()); | 57 return layer_rect_.Contains(picture->LayerRect()); |
58 } | 58 } |
59 gfx::Rect layer_rect_; | 59 gfx::Rect layer_rect_; |
60 }; | 60 }; |
61 | 61 |
62 void PicturePile::InvalidateRect(gfx::Rect invalidation) { | 62 void PicturePile::InvalidateRect(gfx::Rect invalidation) { |
63 if (invalidation.IsEmpty()) | 63 if (invalidation.IsEmpty()) |
64 return; | 64 return; |
65 | 65 |
(...skipping 30 matching lines...) Expand all Loading... |
96 pile_.push_back(base_picture); | 96 pile_.push_back(base_picture); |
97 } | 97 } |
98 | 98 |
99 void PicturePile::PushPropertiesTo(PicturePileImpl* other) { | 99 void PicturePile::PushPropertiesTo(PicturePileImpl* other) { |
100 other->pile_ = pile_; | 100 other->pile_ = pile_; |
101 // Remove all old clones. | 101 // Remove all old clones. |
102 other->clones_.clear(); | 102 other->clones_.clear(); |
103 } | 103 } |
104 | 104 |
105 } // namespace cc | 105 } // namespace cc |
OLD | NEW |