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

Side by Side Diff: cc/picture_layer_impl.cc

Issue 11953005: cc: Update picture pile on tiles to prevent memory leak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "cc/append_quads_data.h" 8 #include "cc/append_quads_data.h"
9 #include "cc/checkerboard_draw_quad.h" 9 #include "cc/checkerboard_draw_quad.h"
10 #include "cc/debug_border_draw_quad.h" 10 #include "cc/debug_border_draw_quad.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 return make_scoped_refptr(new Tile( 231 return make_scoped_refptr(new Tile(
232 tile_manager, 232 tile_manager,
233 pile_.get(), 233 pile_.get(),
234 rect.size(), 234 rect.size(),
235 GL_RGBA, 235 GL_RGBA,
236 rect, 236 rect,
237 tiling->contents_scale())); 237 tiling->contents_scale()));
238 } 238 }
239 239
240 void PictureLayerImpl::UpdatePile(Tile* tile) {
241 tile->set_picture_pile(pile_);
242 }
243
240 void PictureLayerImpl::SyncFromActiveLayer() { 244 void PictureLayerImpl::SyncFromActiveLayer() {
241 DCHECK(layerTreeImpl()->IsPendingTree()); 245 DCHECK(layerTreeImpl()->IsPendingTree());
242 if (!drawsContent()) 246 if (!drawsContent())
243 return; 247 return;
244 248
245 // If there is an active tree version of this layer, get a copy of its 249 // If there is an active tree version of this layer, get a copy of its
246 // tiles. This needs to be done last, after setting invalidation and the 250 // tiles. This needs to be done last, after setting invalidation and the
247 // pile. 251 // pile.
248 PictureLayerImpl* active_twin = static_cast<PictureLayerImpl*>( 252 PictureLayerImpl* active_twin = static_cast<PictureLayerImpl*>(
249 layerTreeImpl()->FindActiveTreeLayerById(id())); 253 layerTreeImpl()->FindActiveTreeLayerById(id()));
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) == 450 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) ==
447 used_tilings.end()) 451 used_tilings.end())
448 to_remove.push_back(tiling); 452 to_remove.push_back(tiling);
449 } 453 }
450 454
451 for (size_t i = 0; i < to_remove.size(); ++i) 455 for (size_t i = 0; i < to_remove.size(); ++i)
452 tilings_.Remove(to_remove[i]); 456 tilings_.Remove(to_remove[i]);
453 } 457 }
454 458
455 } // namespace cc 459 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture_layer_impl.h ('k') | cc/picture_layer_tiling.h » ('j') | cc/picture_layer_tiling.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698