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 "cc/resources/picture_layer_tiling_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 void PictureLayerTilingSet::Clone( | 48 void PictureLayerTilingSet::Clone( |
49 const PictureLayerTiling* tiling, | 49 const PictureLayerTiling* tiling, |
50 const Region& invalidation) { | 50 const Region& invalidation) { |
51 | 51 |
52 for (size_t i = 0; i < tilings_.size(); ++i) | 52 for (size_t i = 0; i < tilings_.size(); ++i) |
53 DCHECK_NE(tilings_[i]->contents_scale(), tiling->contents_scale()); | 53 DCHECK_NE(tilings_[i]->contents_scale(), tiling->contents_scale()); |
54 | 54 |
55 tilings_.push_back(tiling->Clone()); | 55 tilings_.push_back(tiling->Clone()); |
56 gfx::Size size = tilings_.back()->layer_bounds(); | 56 gfx::Size size = tilings_.back()->layer_bounds(); |
57 tilings_.back()->SetClient(client_); | 57 tilings_.back()->SetClient(client_); |
58 tilings_.back()->Invalidate(invalidation); | |
enne (OOO)
2013/03/27 16:16:27
I like being able to get rid of this function. :)
| |
59 // Intentionally use this set's layer bounds, as it may have changed. | 58 // Intentionally use this set's layer bounds, as it may have changed. |
60 tilings_.back()->SetLayerBounds(layer_bounds_); | 59 tilings_.back()->SetLayerBounds(layer_bounds_); |
61 | 60 |
62 tilings_.sort(LargestToSmallestScaleFunctor()); | 61 tilings_.sort(LargestToSmallestScaleFunctor()); |
63 } | 62 } |
64 | 63 |
65 void PictureLayerTilingSet::SetLayerBounds(gfx::Size layer_bounds) { | 64 void PictureLayerTilingSet::SetLayerBounds(gfx::Size layer_bounds) { |
66 if (layer_bounds_ == layer_bounds) | 65 if (layer_bounds_ == layer_bounds) |
67 return; | 66 return; |
68 layer_bounds_ = layer_bounds; | 67 layer_bounds_ = layer_bounds; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 } | 298 } |
300 | 299 |
301 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { | 300 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { |
302 scoped_ptr<base::ListValue> state(new base::ListValue()); | 301 scoped_ptr<base::ListValue> state(new base::ListValue()); |
303 for (size_t i = 0; i < tilings_.size(); ++i) | 302 for (size_t i = 0; i < tilings_.size(); ++i) |
304 state->Append(tilings_[i]->AsValue().release()); | 303 state->Append(tilings_[i]->AsValue().release()); |
305 return state.PassAs<base::Value>(); | 304 return state.PassAs<base::Value>(); |
306 } | 305 } |
307 | 306 |
308 } // namespace cc | 307 } // namespace cc |
OLD | NEW |