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

Side by Side Diff: cc/picture_layer_tiling_set.cc

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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_set.h ('k') | cc/picture_pile.cc » ('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_set.h" 5 #include "cc/picture_layer_tiling_set.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 namespace { 9 namespace {
10 10
11 class LargestToSmallestScaleFunctor { 11 class LargestToSmallestScaleFunctor {
12 public: 12 public:
13 bool operator() (PictureLayerTiling* left, PictureLayerTiling* right) { 13 bool operator() (PictureLayerTiling* left, PictureLayerTiling* right) {
14 return left->contents_scale() > right->contents_scale(); 14 return left->contents_scale() > right->contents_scale();
15 } 15 }
16 }; 16 };
17 17
18 } // namespace 18 } // namespace
19 19
20 20
21 PictureLayerTilingSet::PictureLayerTilingSet( 21 PictureLayerTilingSet::PictureLayerTilingSet(
22 PictureLayerTilingClient * client) 22 PictureLayerTilingClient * client)
23 : client_(client) { 23 : client_(client) {
24 } 24 }
25 25
26 PictureLayerTilingSet::~PictureLayerTilingSet() { 26 PictureLayerTilingSet::~PictureLayerTilingSet() {
27 } 27 }
28 28
29 void PictureLayerTilingSet::SetClient(PictureLayerTilingClient* client) {
30 client_ = client;
31 for (size_t i = 0; i < tilings_.size(); ++i)
32 tilings_[i]->SetClient(client_);
33 }
34
29 void PictureLayerTilingSet::CloneAll( 35 void PictureLayerTilingSet::CloneAll(
30 const PictureLayerTilingSet& other, 36 const PictureLayerTilingSet& other,
31 const Region& invalidation) { 37 const Region& invalidation) {
32 tilings_.clear(); 38 tilings_.clear();
33 tilings_.reserve(other.tilings_.size()); 39 tilings_.reserve(other.tilings_.size());
34 for (size_t i = 0; i < other.tilings_.size(); ++i) { 40 for (size_t i = 0; i < other.tilings_.size(); ++i) {
35 tilings_.push_back(other.tilings_[i]->Clone()); 41 tilings_.push_back(other.tilings_[i]->Clone());
36 // Intentionally use this set's layer bounds, as it may have changed. 42 // Intentionally use this set's layer bounds, as it may have changed.
37 tilings_.back()->SetLayerBounds(layer_bounds_); 43 tilings_.back()->SetLayerBounds(layer_bounds_);
38 tilings_.back()->SetClient(client_); 44 tilings_.back()->SetClient(client_);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 time_delta); 268 time_delta);
263 } 269 }
264 } 270 }
265 271
266 void PictureLayerTilingSet::DidBecomeActive() { 272 void PictureLayerTilingSet::DidBecomeActive() {
267 for (size_t i = 0; i < tilings_.size(); ++i) 273 for (size_t i = 0; i < tilings_.size(); ++i)
268 tilings_[i]->DidBecomeActive(); 274 tilings_[i]->DidBecomeActive();
269 } 275 }
270 276
271 } // namespace cc 277 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture_layer_tiling_set.h ('k') | cc/picture_pile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698