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/picture_layer_tiling.h" | 5 #include "cc/picture_layer_tiling.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/math_util.h" | 8 #include "cc/math_util.h" |
9 #include "ui/gfx/point_conversions.h" | 9 #include "ui/gfx/point_conversions.h" |
10 #include "ui/gfx/rect_conversions.h" | 10 #include "ui/gfx/rect_conversions.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // Tile holds a ref onto a picture pile. If the tile never gets invalidated | 523 // Tile holds a ref onto a picture pile. If the tile never gets invalidated |
524 // and recreated, then that picture pile ref could exist indefinitely. To | 524 // and recreated, then that picture pile ref could exist indefinitely. To |
525 // prevent this, ask the client to update the pile to its own ref. This | 525 // prevent this, ask the client to update the pile to its own ref. This |
526 // will cause PicturePileImpls and their clones to get deleted once the | 526 // will cause PicturePileImpls and their clones to get deleted once the |
527 // corresponding PictureLayerImpl and any in flight raster jobs go out of | 527 // corresponding PictureLayerImpl and any in flight raster jobs go out of |
528 // scope. | 528 // scope. |
529 client_->UpdatePile(it->second); | 529 client_->UpdatePile(it->second); |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
| 533 scoped_ptr<base::Value> PictureLayerTiling::AsValue() const { |
| 534 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 535 state->SetInteger("num_tiles", tiles_.size()); |
| 536 state->SetDouble("content_scale", contents_scale_); |
| 537 state->Set("content_bounds", |
| 538 MathUtil::asValue(ContentRect().size()).release()); |
| 539 return state.PassAs<base::Value>(); |
| 540 } |
| 541 |
533 } // namespace cc | 542 } // namespace cc |
OLD | NEW |