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

Side by Side Diff: cc/picture_layer_tiling.cc

Issue 12258044: cc: Add PictureLayerImpl::AsValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Size as value Created 7 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/picture_layer_tiling.h ('k') | cc/picture_layer_tiling_set.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/picture_layer_tiling.h ('k') | cc/picture_layer_tiling_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698